]> git.baikalelectronics.ru Git - kernel.git/commit
firmware: dmi: Fix unlikely out-of-bounds read in save_mem_devices
authorJean Delvare <jdelvare@suse.de>
Mon, 14 Oct 2019 19:41:24 +0000 (21:41 +0200)
committerJean Delvare <jdelvare@suse.de>
Mon, 14 Oct 2019 19:41:24 +0000 (21:41 +0200)
commitcdc6e2d0b89646f15971b6c669bb58a7c616643e
treebc604f0869cd029884a34fca379c5a70da2ab1c8
parentc43e7830cb96a1272544b1f399271ba986393b03
firmware: dmi: Fix unlikely out-of-bounds read in save_mem_devices

Before reading the Extended Size field, we should ensure it fits in
the DMI record. There is already a record length check but it does
not cover that field.

It would take a seriously corrupted DMI table to hit that bug, so no
need to worry, but we should still fix it.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Fixes: 2bb1537f8d6b ("firmware, DMI: Add function to look up a handle and return DIMM size")
Cc: Tony Luck <tony.luck@intel.com>
Cc: Borislav Petkov <bp@suse.de>
drivers/firmware/dmi_scan.c