linux/drivers/firmware/efi
Laszlo Ersek 87f1822d8e efi: Fix out-of-bounds read in variable_matches()
commit 630ba0cc7a upstream.

The variable_matches() function can currently read "var_name[len]", for
example when:

 - var_name[0] == 'a',
 - len == 1
 - match_name points to the NUL-terminated string "ab".

This function is supposed to accept "var_name" inputs that are not
NUL-terminated (hence the "len" parameter"). Document the function, and
access "var_name[*match]" only if "*match" is smaller than "len".

Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Cc: Peter Jones <pjones@redhat.com>
Cc: Matthew Garrett <mjg59@coreos.com>
Cc: Jason Andryuk <jandryuk@gmail.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Link: http://thread.gmane.org/gmane.comp.freedesktop.xorg.drivers.intel/86906
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2016-06-15 21:29:26 +01:00
..
arm-stub.c efi/arm64: ignore dtb= when UEFI SecureBoot is enabled 2014-04-30 19:57:06 +01:00
cper.c Move cper.c from drivers/acpi/apei to drivers/firmware/efi 2013-10-31 11:27:04 -07:00
efi-pstore.c efi-pstore: Fix an overflow on 32-bit builds 2014-06-27 07:30:32 +01:00
efi-stub-helper.c efi/libstub: Fix boundary checking in efi_high_alloc() 2015-03-18 14:42:04 +00:00
efi.c sysfs: Create mountpoints with sysfs_create_mount_point 2015-08-20 18:24:03 +01:00
efivars.c efi: Make our variable validation list include the guid 2016-03-24 10:01:19 +00:00
fdt.c efi/arm64: efistub: remove local copy of linux_banner 2014-07-07 07:26:02 +01:00
Kconfig efi: add helper function to get UEFI params from FDT 2014-04-30 19:49:46 +01:00
Makefile efi/reboot: Add generic wrapper around EfiResetSystem() 2015-05-12 09:36:34 +01:00
reboot.c x86/reboot: Add EFI reboot quirk for ACPI Hardware Reduced flag 2015-05-12 09:36:34 +01:00
runtime-map.c efi: Fix error handling in add_sysfs_runtime_map_entry() 2015-05-20 13:26:05 +01:00
vars.c efi: Fix out-of-bounds read in variable_matches() 2016-06-15 21:29:26 +01:00