2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-22 04:03:58 +08:00
linux-next/drivers/firmware/google
Julius Werner 40fbb23881 firmware: google: memconsole: Prevent overrun attack on coreboot console
The recent coreboot memory console update (firmware: google: memconsole:
Adapt to new coreboot ring buffer format) introduced a small security
issue in the driver: The new driver implementation parses the memory
console structure again on every access. This is intentional so that
additional lines added concurrently by runtime firmware can be read out.

However, if an attacker can write to the structure, they could increase
the size value to a point where the driver would read potentially
sensitive memory areas from outside the original console buffer during
the next access. This can be done through /dev/mem, since the console
buffer usually resides in firmware-reserved memory that is not covered
by STRICT_DEVMEM.

This patch resolves that problem by reading the buffer's size value only
once during boot (where we can still trust the structure). Other parts
of the structure can still be modified at runtime, but the driver's
bounds checks make sure that it will never read outside the buffer.

Fixes: a5061d028 ("firmware: google: memconsole: Adapt to new coreboot ring buffer format")
Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 15:35:19 +02:00
..
coreboot_table-acpi.c firmware: google memconsole: Add coreboot support 2017-04-08 18:05:36 +02:00
coreboot_table-of.c firmware: google memconsole: Add ARM/ARM64 support 2017-04-08 18:05:36 +02:00
coreboot_table.c firmware: google memconsole: Add coreboot support 2017-04-08 18:05:36 +02:00
coreboot_table.h firmware: google memconsole: Add coreboot support 2017-04-08 18:05:36 +02:00
gsmi.c firmware-gsmi: Delete an unnecessary check before the function call "dma_pool_destroy" 2016-09-09 16:08:45 +01:00
Kconfig firmware: Google VPD sysfs driver 2017-04-18 18:05:23 +02:00
Makefile firmware: Google VPD sysfs driver 2017-04-18 18:05:23 +02:00
memconsole-coreboot.c firmware: google: memconsole: Prevent overrun attack on coreboot console 2017-05-25 15:35:19 +02:00
memconsole-x86-legacy.c firmware: google: memconsole: Make memconsole interface more flexible 2017-05-18 16:59:06 +02:00
memconsole.c firmware: google: memconsole: Make memconsole interface more flexible 2017-05-18 16:59:06 +02:00
memconsole.h firmware: google: memconsole: Make memconsole interface more flexible 2017-05-18 16:59:06 +02:00
vpd_decode.c firmware: Google VPD: import lib_vpd source files 2017-04-18 18:04:45 +02:00
vpd_decode.h firmware: Google VPD: import lib_vpd source files 2017-04-18 18:04:45 +02:00
vpd.c firmware: Google VPD: Fix memory allocation error handling 2017-05-18 17:01:46 +02:00