In the Linux kernel, the following vulnerability has been resolved:
scsi: iscsi_tcp: Fix UAF during logout when accessing the shost ipaddress
Bug report and analysis from Ding Hui.
During iSCSI session logout, if another task accesses the shost ipaddress attr, we can get a KASAN UAF report like this:
[ 276.942144] BUG: KASAN: use-after-free in rawspinlockbh+0x78/0xe0 [ 276.942535] Write of size 4 at addr ffff8881053b45b8 by task cat/4088 [ 276.943511] CPU: 2 PID: 4088 Comm: cat Tainted: G E 6.1.0-rc8+ #3 [ 276.943997] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020 [ 276.944470] Call Trace: [ 276.944943] <TASK> [ 276.945397] dumpstacklvl+0x34/0x48 [ 276.945887] printaddressdescription.constprop.0+0x86/0x1e7 [ 276.946421] printreport+0x36/0x4f [ 276.947358] kasanreport+0xad/0x130 [ 276.948234] kasancheckrange+0x35/0x1c0 [ 276.948674] rawspinlockbh+0x78/0xe0 [ 276.949989] iscsiswtcphostgetparam+0xad/0x2e0 [iscsitcp] [ 276.951765] showhostparamISCSIHOSTPARAMIPADDRESS+0xe9/0x130 [scsitransportiscsi] [ 276.952185] devattrshow+0x3f/0x80 [ 276.953005] sysfskfseqshow+0x1fb/0x3e0 [ 276.953401] seqreaditer+0x402/0x1020 [ 276.954260] vfsread+0x532/0x7b0 [ 276.955113] ksysread+0xed/0x1c0 [ 276.955952] dosyscall64+0x38/0x90 [ 276.956347] entrySYSCALL64afterhwframe+0x63/0xcd [ 276.956769] RIP: 0033:0x7f5d3a679222 [ 276.957161] Code: c0 e9 b2 fe ff ff 50 48 8d 3d 32 c0 0b 00 e8 a5 fe 01 00 0f 1f 44 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 0f 05 <48> 3d 00 f0 ff ff 77 56 c3 0f 1f 44 00 00 48 83 ec 28 48 89 54 24 [ 276.958009] RSP: 002b:00007ffc864d16a8 EFLAGS: 00000246 ORIGRAX: 0000000000000000 [ 276.958431] RAX: ffffffffffffffda RBX: 0000000000020000 RCX: 00007f5d3a679222 [ 276.958857] RDX: 0000000000020000 RSI: 00007f5d3a4fe000 RDI: 0000000000000003 [ 276.959281] RBP: 00007f5d3a4fe000 R08: 00000000ffffffff R09: 0000000000000000 [ 276.959682] R10: 0000000000000022 R11: 0000000000000246 R12: 0000000000020000 [ 276.960126] R13: 0000000000000003 R14: 0000000000000000 R15: 0000557a26dada58 [ 276.960536] </TASK> [ 276.961357] Allocated by task 2209: [ 276.961756] kasansavestack+0x1e/0x40 [ 276.962170] kasansettrack+0x21/0x30 [ 276.962557] kasankmalloc+0x7e/0x90 [ 276.962923] _kmalloc+0x5b/0x140 [ 276.963308] iscsiallocsession+0x28/0x840 [scsitransportiscsi] [ 276.963712] iscsisessionsetup+0xda/0xba0 [libiscsi] [ 276.964078] iscsiswtcpsessioncreate+0x1fd/0x330 [iscsitcp] [ 276.964431] iscsiifcreatesession.isra.0+0x50/0x260 [scsitransportiscsi] [ 276.964793] iscsiifrecvmsg+0xc5a/0x2660 [scsitransportiscsi] [ 276.965153] iscsiifrx+0x198/0x4b0 [scsitransportiscsi] [ 276.965546] netlinkunicast+0x4d5/0x7b0 [ 276.965905] netlinksendmsg+0x78d/0xc30 [ 276.966236] socksendmsg+0xe5/0x120 [ 276.966576] syssendmsg+0x5fe/0x860 [ 276.966923] syssendmsg+0xe0/0x170 [ 276.967300] _syssendmsg+0xc8/0x170 [ 276.967666] dosyscall64+0x38/0x90 [ 276.968028] entrySYSCALL64afterhwframe+0x63/0xcd [ 276.968773] Freed by task 2209: [ 276.969111] kasansavestack+0x1e/0x40 [ 276.969449] kasansettrack+0x21/0x30 [ 276.969789] kasansavefreeinfo+0x2a/0x50 [ 276.970146] _kasanslabfree+0x106/0x190 [ 276.970470] _kmemcachefree+0x133/0x270 [ 276.970816] devicerelease+0x98/0x210 [ 276.971145] kobjectcleanup+0x101/0x360 [ 276.971462] iscsisessionteardown+0x3fb/0x530 [libiscsi] [ 276.971775] iscsiswtcpsessiondestroy+0xd8/0x130 [iscsitcp] [ 276.972143] iscsiifrecvmsg+0x1bf1/0x2660 [scsitransportiscsi] [ 276.972485] iscsiifrx+0x198/0x4b0 [scsitransportiscsi] [ 276.972808] netlinkunicast+0x4d5/0x7b0 [ 276.973201] netlinksendmsg+0x78d/0xc30 [ 276.973544] socksendmsg+0xe5/0x120 [ 276.973864] _syssendmsg+0x5fe/0x860 [ 276.974248] _sys ---truncated---
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8859687f5b242c0b057461df0a9ff51d5500783b",
"target": {
"function": "iscsi_session_teardown",
"file": "drivers/scsi/libiscsi.c"
},
"deprecated": false,
"id": "CVE-2023-52975-1d7b9777",
"signature_version": "v1",
"digest": {
"length": 691.0,
"function_hash": "233916018977700867081669564011531382391"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6f1d64b13097e85abda0f91b5638000afc5f9a06",
"target": {
"file": "include/scsi/libiscsi.h"
},
"deprecated": false,
"id": "CVE-2023-52975-32dea8bb",
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"61428677810500351147416553652648258544",
"187116934529243643711525177274648904201",
"263356738398818660491418018021814061679",
"287705528029532518311991414659946355643"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8859687f5b242c0b057461df0a9ff51d5500783b",
"target": {
"function": "iscsi_sw_tcp_session_destroy",
"file": "drivers/scsi/iscsi_tcp.c"
},
"deprecated": false,
"id": "CVE-2023-52975-4dd05d98",
"signature_version": "v1",
"digest": {
"length": 255.0,
"function_hash": "231889070797406511102698440321371535427"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8859687f5b242c0b057461df0a9ff51d5500783b",
"target": {
"file": "drivers/scsi/libiscsi.c"
},
"deprecated": false,
"id": "CVE-2023-52975-5864c6cd",
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"336484060912990137188017592761092455804",
"64736860344858760134478790677891728261",
"39036239864791600843477767798945511229",
"137347785510068729057429468106568684522",
"174046270186656523953680854501016735082",
"199853417513983016639602577934095233946",
"49895125357360349267536042085809677360",
"143146060374617045217051015811657001331",
"266853389880729951889023623939570802704",
"138797431451924962207753124579953235044",
"190390581311597592980362189475257896871",
"5044331412646084508351258511366672118",
"5961652563830557746686424511596176062",
"81417849223095140328562001543306170435",
"63605285197453145205650028287359104190"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@17b738590b97fb3fc287289971d1519ff9b875a1",
"target": {
"file": "drivers/scsi/iscsi_tcp.c"
},
"deprecated": false,
"id": "CVE-2023-52975-5ffa3cfc",
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"166913461109258220339175393642249933630",
"264387763004880501970721368380248751313",
"119558673214621515967705184158998336404",
"83301872977518367718893116313616336318",
"194103389932400052649986908492592296066",
"173674359335133569751145396231000227824"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6f1d64b13097e85abda0f91b5638000afc5f9a06",
"target": {
"function": "iscsi_sw_tcp_session_destroy",
"file": "drivers/scsi/iscsi_tcp.c"
},
"deprecated": false,
"id": "CVE-2023-52975-728257b8",
"signature_version": "v1",
"digest": {
"length": 255.0,
"function_hash": "231889070797406511102698440321371535427"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@17b738590b97fb3fc287289971d1519ff9b875a1",
"target": {
"function": "iscsi_session_teardown",
"file": "drivers/scsi/libiscsi.c"
},
"deprecated": false,
"id": "CVE-2023-52975-7e0c44c8",
"signature_version": "v1",
"digest": {
"length": 691.0,
"function_hash": "233916018977700867081669564011531382391"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8859687f5b242c0b057461df0a9ff51d5500783b",
"target": {
"file": "drivers/scsi/iscsi_tcp.c"
},
"deprecated": false,
"id": "CVE-2023-52975-8d94ef04",
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"166913461109258220339175393642249933630",
"264387763004880501970721368380248751313",
"119558673214621515967705184158998336404",
"83301872977518367718893116313616336318",
"194103389932400052649986908492592296066",
"173674359335133569751145396231000227824"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8859687f5b242c0b057461df0a9ff51d5500783b",
"target": {
"file": "include/scsi/libiscsi.h"
},
"deprecated": false,
"id": "CVE-2023-52975-a3ef7d81",
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"61428677810500351147416553652648258544",
"187116934529243643711525177274648904201",
"263356738398818660491418018021814061679",
"287705528029532518311991414659946355643"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6f1d64b13097e85abda0f91b5638000afc5f9a06",
"target": {
"function": "iscsi_session_teardown",
"file": "drivers/scsi/libiscsi.c"
},
"deprecated": false,
"id": "CVE-2023-52975-ac0c2c6c",
"signature_version": "v1",
"digest": {
"length": 691.0,
"function_hash": "233916018977700867081669564011531382391"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6f1d64b13097e85abda0f91b5638000afc5f9a06",
"target": {
"file": "drivers/scsi/iscsi_tcp.c"
},
"deprecated": false,
"id": "CVE-2023-52975-cbdffca7",
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"166913461109258220339175393642249933630",
"264387763004880501970721368380248751313",
"119558673214621515967705184158998336404",
"83301872977518367718893116313616336318",
"194103389932400052649986908492592296066",
"173674359335133569751145396231000227824"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@17b738590b97fb3fc287289971d1519ff9b875a1",
"target": {
"function": "iscsi_sw_tcp_session_destroy",
"file": "drivers/scsi/iscsi_tcp.c"
},
"deprecated": false,
"id": "CVE-2023-52975-dc098cfa",
"signature_version": "v1",
"digest": {
"length": 255.0,
"function_hash": "231889070797406511102698440321371535427"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6f1d64b13097e85abda0f91b5638000afc5f9a06",
"target": {
"file": "drivers/scsi/libiscsi.c"
},
"deprecated": false,
"id": "CVE-2023-52975-e8e8f1f0",
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"336484060912990137188017592761092455804",
"64736860344858760134478790677891728261",
"39036239864791600843477767798945511229",
"137347785510068729057429468106568684522",
"174046270186656523953680854501016735082",
"199853417513983016639602577934095233946",
"49895125357360349267536042085809677360",
"143146060374617045217051015811657001331",
"266853389880729951889023623939570802704",
"138797431451924962207753124579953235044",
"190390581311597592980362189475257896871",
"5044331412646084508351258511366672118",
"5961652563830557746686424511596176062",
"81417849223095140328562001543306170435",
"63605285197453145205650028287359104190"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@17b738590b97fb3fc287289971d1519ff9b875a1",
"target": {
"file": "drivers/scsi/libiscsi.c"
},
"deprecated": false,
"id": "CVE-2023-52975-f1d5e57c",
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"336484060912990137188017592761092455804",
"64736860344858760134478790677891728261",
"39036239864791600843477767798945511229",
"137347785510068729057429468106568684522",
"174046270186656523953680854501016735082",
"199853417513983016639602577934095233946",
"49895125357360349267536042085809677360",
"143146060374617045217051015811657001331",
"266853389880729951889023623939570802704",
"138797431451924962207753124579953235044",
"190390581311597592980362189475257896871",
"5044331412646084508351258511366672118",
"5961652563830557746686424511596176062",
"81417849223095140328562001543306170435",
"63605285197453145205650028287359104190"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@17b738590b97fb3fc287289971d1519ff9b875a1",
"target": {
"file": "include/scsi/libiscsi.h"
},
"deprecated": false,
"id": "CVE-2023-52975-fc19f466",
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"61428677810500351147416553652648258544",
"187116934529243643711525177274648904201",
"263356738398818660491418018021814061679",
"287705528029532518311991414659946355643"
]
},
"signature_type": "Line"
}
]