In the Linux kernel, the following vulnerability has been resolved:
cifs: Fix warning and UAF when destroy the MR list
If the MR allocate failed, the MR recovery work not initialized and list not cleared. Then will be warning and UAF when release the MR:
WARNING: CPU: 4 PID: 824 at kernel/workqueue.c:3066 __flush_work.isra.0+0xf7/0x110 CPU: 4 PID: 824 Comm: mount.cifs Not tainted 6.1.0-rc5+ #82 RIP: 0010:__flush_work.isra.0+0xf7/0x110 Call Trace: <TASK> __cancelworktimer+0x2ba/0x2e0 smbddestroy+0x4e1/0x990 smbdgetconnection+0x1cbd/0x2110 smbdgetconnection+0x21/0x40 cifsgettcpsession+0x8ef/0xda0 mountgetconns+0x60/0x750 cifsmount+0x103/0xd00 cifssmb3domount+0x1dd/0xcb0 smb3gettree+0x1d5/0x300 vfsgettree+0x41/0xf0 pathmount+0x9b3/0xdd0 __x64sysmount+0x190/0x1d0 dosyscall64+0x35/0x80 entrySYSCALL64afterhwframe+0x46/0xb0
BUG: KASAN: use-after-free in smbddestroy+0x4fc/0x990 Read of size 8 at addr ffff88810b156a08 by task mount.cifs/824 CPU: 4 PID: 824 Comm: mount.cifs Tainted: G W 6.1.0-rc5+ #82 Call Trace: dumpstacklvl+0x34/0x44 printreport+0x171/0x472 kasanreport+0xad/0x130 smbddestroy+0x4fc/0x990 smbdgetconnection+0x1cbd/0x2110 smbdgetconnection+0x21/0x40 cifsgettcpsession+0x8ef/0xda0 mountgetconns+0x60/0x750 cifsmount+0x103/0xd00 cifssmb3domount+0x1dd/0xcb0 smb3gettree+0x1d5/0x300 vfsgettree+0x41/0xf0 path_mount+0x9b3/0xdd0 __x64sysmount+0x190/0x1d0 dosyscall64+0x35/0x80 entrySYSCALL64afterhwframe+0x46/0xb0
Allocated by task 824: kasansavestack+0x1e/0x40 kasansettrack+0x21/0x30 __kasankmalloc+0x7a/0x90 smbdgetconnection+0x1b6f/0x2110 smbdgetconnection+0x21/0x40 cifsgettcpsession+0x8ef/0xda0 mountgetconns+0x60/0x750 cifsmount+0x103/0xd00 cifssmb3domount+0x1dd/0xcb0 smb3gettree+0x1d5/0x300 vfsgettree+0x41/0xf0 pathmount+0x9b3/0xdd0 __x64sysmount+0x190/0x1d0 dosyscall64+0x35/0x80 entrySYSCALL64afterhwframe+0x46/0xb0
Freed by task 824: kasansavestack+0x1e/0x40 kasansettrack+0x21/0x30 kasansavefree_info+0x2a/0x40 ____kasanslabfree+0x143/0x1b0 __kmemcachefree+0xc8/0x330 smbdgetconnection+0x1c6a/0x2110 smbdget_connection+0x21/0x40 cifsgettcpsession+0x8ef/0xda0 mountgetconns+0x60/0x750 cifsmount+0x103/0xd00 cifssmb3domount+0x1dd/0xcb0 smb3gettree+0x1d5/0x300 vfsgettree+0x41/0xf0 pathmount+0x9b3/0xdd0 __x64sysmount+0x190/0x1d0 dosyscall64+0x35/0x80 entrySYSCALL64afterhwframe+0x46/0xb0
Let's initialize the MR recovery work before MR allocate to prevent the warning, remove the MRs from the list to prevent the UAF.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53427.json",
"cna_assigner": "Linux"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-53427.json"
[
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"12992114275085103090766343515079344498",
"71969070840716323201791757167946112844",
"27779269927484987132012529551450029387",
"153070952493643791670892167728252041459",
"178375683417307740434185912477566212486",
"241493261060431841068672913522446473362",
"163467805710756836797889923938194662480",
"197105440745220204975340492357354719407",
"77104178080740943155896568872277952490",
"67955914308508297504757798277165231978",
"237652614488474803344354507607709196889",
"100586240128324273611481645123652934513"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@41832c62a75dad530dc5a2856c92ae5459d497e5",
"signature_type": "Line",
"id": "CVE-2023-53427-48ed79d1",
"target": {
"file": "fs/cifs/smbdirect.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "186063977260814784996087131018548612563",
"length": 1304.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cfd85a0922c4696d768965e686ad805a58d9d834",
"signature_type": "Function",
"id": "CVE-2023-53427-504e76be",
"target": {
"file": "fs/cifs/smbdirect.c",
"function": "allocate_mr_list"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "186063977260814784996087131018548612563",
"length": 1304.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7cbd5bdb5bd4404a5da4309521134b42c65846c0",
"signature_type": "Function",
"id": "CVE-2023-53427-7e8045fa",
"target": {
"file": "fs/cifs/smbdirect.c",
"function": "allocate_mr_list"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "288814916941446998181912330297422195325",
"length": 1311.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3524d6da0fe88aee79f06be6572955d16ad76b39",
"signature_type": "Function",
"id": "CVE-2023-53427-9572aedc",
"target": {
"file": "fs/cifs/smbdirect.c",
"function": "allocate_mr_list"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"12992114275085103090766343515079344498",
"71969070840716323201791757167946112844",
"27779269927484987132012529551450029387",
"153070952493643791670892167728252041459",
"178375683417307740434185912477566212486",
"241493261060431841068672913522446473362",
"163467805710756836797889923938194662480",
"197105440745220204975340492357354719407",
"77104178080740943155896568872277952490",
"67955914308508297504757798277165231978",
"237652614488474803344354507607709196889",
"100586240128324273611481645123652934513"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@275a3d2b9408fc4895e342f772cab9a89960546e",
"signature_type": "Line",
"id": "CVE-2023-53427-af81b32f",
"target": {
"file": "fs/cifs/smbdirect.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"12992114275085103090766343515079344498",
"71969070840716323201791757167946112844",
"27779269927484987132012529551450029387",
"153070952493643791670892167728252041459",
"178375683417307740434185912477566212486",
"241493261060431841068672913522446473362",
"163467805710756836797889923938194662480",
"197105440745220204975340492357354719407",
"77104178080740943155896568872277952490",
"67955914308508297504757798277165231978",
"237652614488474803344354507607709196889",
"100586240128324273611481645123652934513"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7cbd5bdb5bd4404a5da4309521134b42c65846c0",
"signature_type": "Line",
"id": "CVE-2023-53427-b211e981",
"target": {
"file": "fs/cifs/smbdirect.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"12992114275085103090766343515079344498",
"71969070840716323201791757167946112844",
"27779269927484987132012529551450029387",
"153070952493643791670892167728252041459",
"178375683417307740434185912477566212486",
"241493261060431841068672913522446473362",
"163467805710756836797889923938194662480",
"197105440745220204975340492357354719407",
"77104178080740943155896568872277952490",
"67955914308508297504757798277165231978",
"237652614488474803344354507607709196889",
"100586240128324273611481645123652934513"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3e161c2791f8e661eed24a2c624087084d910215",
"signature_type": "Line",
"id": "CVE-2023-53427-b5048b1f",
"target": {
"file": "fs/cifs/smbdirect.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "186063977260814784996087131018548612563",
"length": 1304.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@41832c62a75dad530dc5a2856c92ae5459d497e5",
"signature_type": "Function",
"id": "CVE-2023-53427-c40dba59",
"target": {
"file": "fs/cifs/smbdirect.c",
"function": "allocate_mr_list"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"12992114275085103090766343515079344498",
"71969070840716323201791757167946112844",
"27779269927484987132012529551450029387",
"153070952493643791670892167728252041459",
"178375683417307740434185912477566212486",
"241493261060431841068672913522446473362",
"163467805710756836797889923938194662480",
"197105440745220204975340492357354719407",
"77104178080740943155896568872277952490",
"67955914308508297504757798277165231978",
"237652614488474803344354507607709196889",
"100586240128324273611481645123652934513"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cfd85a0922c4696d768965e686ad805a58d9d834",
"signature_type": "Line",
"id": "CVE-2023-53427-ce515738",
"target": {
"file": "fs/cifs/smbdirect.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"12992114275085103090766343515079344498",
"71969070840716323201791757167946112844",
"27779269927484987132012529551450029387",
"153070952493643791670892167728252041459",
"178375683417307740434185912477566212486",
"241493261060431841068672913522446473362",
"163467805710756836797889923938194662480",
"197105440745220204975340492357354719407",
"77104178080740943155896568872277952490",
"67955914308508297504757798277165231978",
"237652614488474803344354507607709196889",
"100586240128324273611481645123652934513"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3524d6da0fe88aee79f06be6572955d16ad76b39",
"signature_type": "Line",
"id": "CVE-2023-53427-ebd849d4",
"target": {
"file": "fs/cifs/smbdirect.c"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "186063977260814784996087131018548612563",
"length": 1304.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3e161c2791f8e661eed24a2c624087084d910215",
"signature_type": "Function",
"id": "CVE-2023-53427-f20f0e0d",
"target": {
"file": "fs/cifs/smbdirect.c",
"function": "allocate_mr_list"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "288814916941446998181912330297422195325",
"length": 1311.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@275a3d2b9408fc4895e342f772cab9a89960546e",
"signature_type": "Function",
"id": "CVE-2023-53427-f3169ba7",
"target": {
"file": "fs/cifs/smbdirect.c",
"function": "allocate_mr_list"
}
}
]