aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-strlcpy-src.c
diff options
context:
space:
mode:
authorRuss Weight <[email protected]>2022-08-29 10:45:57 -0700
committerGreg Kroah-Hartman <[email protected]>2022-09-01 17:46:54 +0200
commit8b40c38e37492b5bdf8e95b46b5cca9517a9957a (patch)
treed930d33cb3332530bbaf6aa1549d4661c55c250e /lib/test_fortify/write_overflow-strlcpy-src.c
parent9b03e79300100bcd36e77c8ce94ee7f47cd2f528 (diff)
firmware_loader: Fix use-after-free during unregister
In the following code within firmware_upload_unregister(), the call to device_unregister() could result in the dev_release function freeing the fw_upload_priv structure before it is dereferenced for the call to module_put(). This bug was found by the kernel test robot using CONFIG_KASAN while running the firmware selftests. device_unregister(&fw_sysfs->dev); module_put(fw_upload_priv->module); The problem is fixed by copying fw_upload_priv->module to a local variable for use when calling device_unregister(). Fixes: 97730bbb242c ("firmware_loader: Add firmware-upload support") Cc: stable <[email protected]> Reported-by: kernel test robot <[email protected]> Reviewed-by: Matthew Gerlach <[email protected]> Signed-off-by: Russ Weight <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strlcpy-src.c')
0 files changed, 0 insertions, 0 deletions