aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
authorBorislav Petkov <[email protected]>2020-09-11 10:55:55 +0000
committerBorislav Petkov <[email protected]>2020-09-15 07:41:28 +0000
commitcd8100f1f3be406a4e0e122e7307ac0fca6d57cc (patch)
tree192fa03cb02048671878914ffd257d56e2b0bc72 /fs/proc/array.c
parentLinux 5.9-rc5 (diff)
downloadkernel-cd8100f1f3be406a4e0e122e7307ac0fca6d57cc.tar.gz
kernel-cd8100f1f3be406a4e0e122e7307ac0fca6d57cc.zip
EDAC/ghes: Clear scanned data on unload
Commit b972fdba8665 ("EDAC/ghes: Fix NULL pointer dereference in ghes_edac_register()") didn't clear all the information from the scanned system and, more specifically, left ghes_hw.num_dimms to its previous value. On a second load (CONFIG_DEBUG_TEST_DRIVER_REMOVE=y), the driver would use the leftover num_dimms value which is not 0 and thus the 0 check in enumerate_dimms() will get bypassed and it would go directly to the pointer deref: d = &hw->dimms[hw->num_dimms]; which is, of course, NULL: #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#1] PREEMPT SMP CPU: 7 PID: 1 Comm: swapper/0 Not tainted 5.9.0-rc4+ #7 Hardware name: GIGABYTE MZ01-CE1-00/MZ01-CE1-00, BIOS F02 08/29/2018 RIP: 0010:enumerate_dimms.cold+0x7b/0x375 Reset the whole ghes_hw on driver unregister so that no stale values are used on a second system scan. Fixes: b972fdba8665 ("EDAC/ghes: Fix NULL pointer dereference in ghes_edac_register()") Cc: Shiju Jose <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'fs/proc/array.c')
0 files changed, 0 insertions, 0 deletions