CVE-2022-49082 Information
Description
In the Linux kernel the following vulnerability has been resolved:
scsi: mpt3sas: Fix use after free in _scsih_expander_node_remove()
The function mpt3sas_transport_port_remove() called in _scsih_expander_node_remove() frees the port field of the sas_expander structure leading to the following use-after-free splat from KASAN when the ioc_info() call following that function is executed (e.g. when doing rmmod of the driver module):
[ 3479.371167] ==================================================================
[ 3479.378496] BUG: KASAN: use-after-free in _scsih_expander_node_remove+0x710/0x750 [mpt3sas]
[ 3479.386936] Read of size 1 at addr ffff8881c037691c by task rmmod/1531
[ 3479.393524]
[ 3479.395035] CPU: 18 PID: 1531 Comm: rmmod Not tainted 5.17.0-rc8+ 1436
[ 3479.401712] Hardware name: Supermicro Super Server/H12SSL-NT BIOS 2.1 06/02/2021
[ 3479.409263] Call Trace:
[ 3479.411743]
Fix this by introducing the local variable port_id to store the port ID value before executing mpt3sas_transport_port_remove(). This local variable is then used in the call to ioc_info() instead of dereferencing the freed port structure.
Reference
https://git.kernel.org/stable/c/17d66b1c92bcb41e72271ec60069d3684aaa1c9c https://git.kernel.org/stable/c/1bb8a7fc64d63ec818e367e1b37676ea2ef2d20c https://git.kernel.org/stable/c/25c1353dca74ad7cf3fd7ce258fe7c957a147d5e https://git.kernel.org/stable/c/87d663d40801dffc99a5ad3b0188ad3e2b4d1557
Share on: