alistair23-linux/drivers
Matt Fleming 123abd76ed efivars: efivarfs_valid_name() should handle pstore syntax
Stricter validation was introduced with commit da27a24383
("efivarfs: guid part of filenames are case-insensitive") and commit
47f531e8ba ("efivarfs: Validate filenames much more aggressively"),
which is necessary for the guid portion of efivarfs filenames, but we
don't need to be so strict with the first part, the variable name. The
UEFI specification doesn't impose any constraints on variable names
other than they be a NULL-terminated string.

The above commits caused a regression that resulted in users seeing
the following message,

  $ sudo mount -v /sys/firmware/efi/efivars mount: Cannot allocate memory

whenever pstore EFI variables were present in the variable store,
since their variable names failed to pass the following check,

    /* GUID should be right after the first '-' */
    if (s - 1 != strchr(str, '-'))

as a typical pstore filename is of the form, dump-type0-10-1-<guid>.
The fix is trivial since the guid portion of the filename is GUID_LEN
bytes, we can use (len - GUID_LEN) to ensure the '-' character is
where we expect it to be.

(The bogus ENOMEM error value will be fixed in a separate patch.)

Reported-by: Joseph Yasi <joe.yasi@gmail.com>
Tested-by: Joseph Yasi <joe.yasi@gmail.com>
Reported-by: Lingzhu Xiang <lxiang@redhat.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Cc: Jeremy Kerr <jk@ozlabs.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: <stable@vger.kernel.org> # v3.8
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-03-06 14:46:04 +00:00
..
accessibility
acpi x86, ACPI, mm: Revert movablemem_map support 2013-03-02 09:34:39 -08:00
amba Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-03-03 11:54:39 -08:00
ata 1) apply, and then revert, the sysfs export of ATA host controller number. 2013-02-24 17:32:15 -08:00
atm hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
auxdisplay
base CHROMIUM: dma-buf: restore args on failure of dma_buf_mmap 2013-02-27 15:14:02 +05:30
bcma
block Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2013-02-28 17:43:09 -08:00
bluetooth Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-02-21 17:40:58 -08:00
bus
cdrom
char drivers/char/misc.c:misc_register(): do not loop on misc_list unconditionally 2013-02-27 19:10:21 -08:00
clk hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
clocksource ImgTec Meta architecture changes for v3.9-rc1 2013-03-03 12:06:09 -08:00
connector
cpufreq ACPI and power management fixes for 3.9-rc1 2013-02-25 21:25:17 -08:00
cpuidle arm-soc: soc-specific updates 2013-02-21 15:27:22 -08:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2013-02-25 15:56:15 -08:00
dca dca: convert to idr_alloc() 2013-02-27 19:10:15 -08:00
devfreq
dio
dma Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2013-03-03 10:20:22 -08:00
edac Merge branch 'linux_next' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac 2013-02-28 20:42:33 -08:00
eisa
extcon Char/Misc driver patches for 3.9-rc1 2013-02-21 13:57:13 -08:00
firewire firewire: convert to idr_alloc() 2013-02-27 19:10:15 -08:00
firmware efivars: efivarfs_valid_name() should handle pstore syntax 2013-03-06 14:46:04 +00:00
gpio gpio: convert to idr_alloc() 2013-02-27 19:10:15 -08:00
gpu hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
hsi hsi: fix kernel-doc warnings 2013-03-01 13:39:00 -08:00
hv Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interrupts 2013-02-27 10:15:53 -08:00
hwmon ACPI and power management updates for 3.9-rc1 2013-02-20 11:26:56 -08:00
hwspinlock
i2c idr: remove MAX_IDR_MASK and move left MAX_IDR_* into idr.c 2013-02-27 19:10:20 -08:00
ide Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
idle Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-22 19:25:09 -08:00
iio Staging tree update for 3.9-rc1 2013-02-21 12:11:44 -08:00
infiniband hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2013-03-03 12:58:43 -08:00
iommu Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
ipack Char/Misc driver patches for 3.9-rc1 2013-02-21 13:57:13 -08:00
irqchip ImgTec Meta architecture changes for v3.9-rc1 2013-03-03 12:06:09 -08:00
isdn hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
leds Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds 2013-02-26 09:29:02 -08:00
lguest All trivial, thanks to the stuff which didn't quite make it time. 2013-02-26 14:49:12 -08:00
macintosh Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2013-02-23 17:09:55 -08:00
mailbox
md dm cache: add cleaner policy 2013-03-01 22:45:52 +00:00
media arm-soc: late OMAP changes 2013-02-28 20:00:40 -08:00
memory
memstick memstick: move the dereference below the NULL test 2013-02-27 19:10:23 -08:00
message
mfd mfd: convert to idr_alloc() 2013-02-27 19:10:17 -08:00
misc KGDB/KDB fixes and cleanups 2013-03-02 08:31:39 -08:00
mmc Merge branches 'devel-stable', 'fixes' and 'mmci' into for-linus 2013-03-03 00:32:50 +00:00
mtd Fairly unexciting MTD merge for 3.9: 2013-03-02 16:33:54 -08:00
net Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2013-03-02 07:44:16 -08:00
nfc
ntb
nubus
of Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-02-21 17:40:58 -08:00
oprofile oprofilefs: add missing ->i_mutex locking in object creation 2013-02-22 23:31:38 -05:00
parisc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
parport Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2013-02-21 17:54:03 -08:00
pci hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
pcmcia Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-02-21 17:40:58 -08:00
pinctrl arm-soc: device tree conversions 2013-02-21 15:38:49 -08:00
platform Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86 2013-03-03 10:16:19 -08:00
pnp Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
power power: convert to idr_alloc() 2013-02-27 19:10:18 -08:00
pps drivers/pps/clients/pps-gpio.c: use devm_kzalloc 2013-02-27 19:10:23 -08:00
ps3
ptp
pwm pwm: Changes for v3.9-rc1 2013-02-26 09:34:29 -08:00
rapidio
regulator
remoteproc remoteproc: convert to idr_alloc() 2013-02-27 19:10:18 -08:00
rpmsg rpmsg: convert to idr_alloc() 2013-02-27 19:10:18 -08:00
rtc rtc: stmp3xxx: add wdt-accessor function 2013-03-01 12:40:36 +01:00
s390 qdio: remove unused parameters 2013-02-28 09:37:12 +01:00
sbus Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
scsi SCSI for-linus on 20130301 2013-03-02 11:42:16 -08:00
sfi
sh
sn
spi arm-soc: soc-specific updates 2013-02-21 15:27:22 -08:00
ssb Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into mips-for-linux-next 2013-02-22 10:07:30 +01:00
staging Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-03-03 13:23:03 -08:00
target Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2013-03-02 11:43:27 -08:00
tc
thermal Fix mis-merge of intel_powerclamp.c resulting in compile error 2013-02-28 20:23:09 -08:00
tty Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-03-03 13:23:03 -08:00
uio uio: convert to idr_alloc() 2013-02-27 19:10:19 -08:00
usb USB patch revert for 3.9-rc1 2013-03-03 10:24:57 -08:00
uwb
vfio vfio: convert to idr_alloc() 2013-02-27 19:10:19 -08:00
vhost Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2013-02-26 11:42:23 -08:00
video backlight: add new lp8788 backlight driver 2013-02-27 19:10:09 -08:00
virt
virtio All trivial, thanks to the stuff which didn't quite make it time. 2013-02-26 14:49:12 -08:00
vlynq
vme
w1 arm-soc: i.MX DT changes 2013-02-28 19:59:34 -08:00
watchdog watchdog: sp805_wdt depends on ARM 2013-03-01 12:56:26 +01:00
xen Bug-fixes: 2013-03-03 14:22:53 -08:00
zorro new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
Kconfig Char/Misc driver patches for 3.9-rc1 2013-02-21 13:57:13 -08:00
Makefile Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2013-02-23 17:09:55 -08:00