In the Linux kernel, the following vulnerability has been resolved:
smb: client: Fix use-after-free in cifsfilldirent
There is a race condition in the readdir concurrency process, which may access the rsp buffer after it has been released, triggering the following KASAN warning.
================================================================== BUG: KASAN: slab-use-after-free in cifsfilldirent+0xb03/0xb60 [cifs] Read of size 4 at addr ffff8880099b819c by task a.out/342975
CPU: 2 UID: 0 PID: 342975 Comm: a.out Not tainted 6.15.0-rc6+ #240 PREEMPT(full) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.1-2.fc37 04/01/2014 Call Trace: <TASK> dumpstacklvl+0x53/0x70 printreport+0xce/0x640 kasanreport+0xb8/0xf0 cifsfilldirent+0xb03/0xb60 [cifs] cifsreaddir+0x12cb/0x3190 [cifs] iteratedir+0x1a1/0x520 _x64sysgetdents+0x134/0x220 dosyscall64+0x4b/0x110 entrySYSCALL64afterhwframe+0x76/0x7e RIP: 0033:0x7f996f64b9f9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0d f7 c3 0c 00 f7 d8 64 89 8 RSP: 002b:00007f996f53de78 EFLAGS: 00000207 ORIGRAX: 000000000000004e RAX: ffffffffffffffda RBX: 00007f996f53ecdc RCX: 00007f996f64b9f9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 00007f996f53dea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000207 R12: ffffffffffffff88 R13: 0000000000000000 R14: 00007ffc8cd9a500 R15: 00007f996f51e000 </TASK>
Allocated by task 408: kasansavestack+0x20/0x40 kasansavetrack+0x14/0x30 _kasanslaballoc+0x6e/0x70 kmemcacheallocnoprof+0x117/0x3d0 mempoolallocnoprof+0xf2/0x2c0 cifsbufget+0x36/0x80 [cifs] allocatebuffers+0x1d2/0x330 [cifs] cifsdemultiplexthread+0x22b/0x2690 [cifs] kthread+0x394/0x720 retfromfork+0x34/0x70 retfromforkasm+0x1a/0x30
Freed by task 342979: kasansavestack+0x20/0x40 kasansavetrack+0x14/0x30 kasansavefreeinfo+0x3b/0x60 _kasanslabfree+0x37/0x50 kmemcachefree+0x2b8/0x500 cifsbufrelease+0x3c/0x70 [cifs] cifsreaddir+0x1c97/0x3190 [cifs] iteratedir+0x1a1/0x520 _x64sysgetdents64+0x134/0x220 dosyscall64+0x4b/0x110 entrySYSCALL64after_hwframe+0x76/0x7e
The buggy address belongs to the object at ffff8880099b8000 which belongs to the cache cifs_request of size 16588 The buggy address is located 412 bytes inside of freed 16588-byte region [ffff8880099b8000, ffff8880099bc0cc)
The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x99b8 head: order:3 mapcount:0 entiremapcount:0 nrpagesmapped:0 pincount:0 anon flags: 0x80000000000040(head|node=0|zone=1) pagetype: f5(slab) raw: 0080000000000040 ffff888001e03400 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000010001 00000000f5000000 0000000000000000 head: 0080000000000040 ffff888001e03400 0000000000000000 dead000000000001 head: 0000000000000000 0000000000010001 00000000f5000000 0000000000000000 head: 0080000000000003 ffffea0000266e01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected
Memory state around the buggy address: ffff8880099b8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880099b8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880099b8180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880099b8200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880099b8280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================
POC is available in the link [1].
The problem triggering process is as follows:
---truncated---
[
{
"digest": {
"line_hashes": [
"76173573880541942212181312891225440083",
"177724639873156833473002600680258570779",
"298140791220893195692382185028360296235",
"138312155790968872509158245619539692652",
"121563165408311174120812107118911299823",
"137220312341123926917124726791992257875",
"90142693707404654485720359280294456932",
"304876301389561123135361842309019363643"
],
"threshold": 0.9
},
"target": {
"file": "fs/cifs/readdir.c"
},
"deprecated": false,
"id": "CVE-2025-38051-354fbb4f",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1b197931fbc821bc7e9e91bf619400db563e3338",
"signature_type": "Line"
},
{
"digest": {
"length": 3292.0,
"function_hash": "123940127810802541054668015344295798196"
},
"target": {
"file": "fs/cifs/readdir.c",
"function": "find_cifs_entry"
},
"deprecated": false,
"id": "CVE-2025-38051-4c4c4480",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1b197931fbc821bc7e9e91bf619400db563e3338",
"signature_type": "Function"
},
{
"digest": {
"length": 3286.0,
"function_hash": "38587046427828547983157738335237024320"
},
"target": {
"file": "fs/smb/client/readdir.c",
"function": "find_cifs_entry"
},
"deprecated": false,
"id": "CVE-2025-38051-56843163",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a7a8fe56e932a36f43e031b398aef92341bf5ea0",
"signature_type": "Function"
},
{
"digest": {
"line_hashes": [
"76173573880541942212181312891225440083",
"177724639873156833473002600680258570779",
"298140791220893195692382185028360296235",
"138312155790968872509158245619539692652",
"121563165408311174120812107118911299823",
"137220312341123926917124726791992257875",
"90142693707404654485720359280294456932",
"304876301389561123135361842309019363643"
],
"threshold": 0.9
},
"target": {
"file": "fs/smb/client/readdir.c"
},
"deprecated": false,
"id": "CVE-2025-38051-7e910ded",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9c9aafbacc183598f064902365e107b5e856531f",
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"76173573880541942212181312891225440083",
"177724639873156833473002600680258570779",
"298140791220893195692382185028360296235",
"138312155790968872509158245619539692652",
"121563165408311174120812107118911299823",
"137220312341123926917124726791992257875",
"90142693707404654485720359280294456932",
"304876301389561123135361842309019363643"
],
"threshold": 0.9
},
"target": {
"file": "fs/smb/client/readdir.c"
},
"deprecated": false,
"id": "CVE-2025-38051-7f17d4ff",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a7a8fe56e932a36f43e031b398aef92341bf5ea0",
"signature_type": "Line"
},
{
"digest": {
"length": 3286.0,
"function_hash": "38587046427828547983157738335237024320"
},
"target": {
"file": "fs/smb/client/readdir.c",
"function": "find_cifs_entry"
},
"deprecated": false,
"id": "CVE-2025-38051-a91834ed",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c8623231e0edfcccb7cc6add0288fa0f0594282f",
"signature_type": "Function"
},
{
"digest": {
"length": 3286.0,
"function_hash": "38587046427828547983157738335237024320"
},
"target": {
"file": "fs/smb/client/readdir.c",
"function": "find_cifs_entry"
},
"deprecated": false,
"id": "CVE-2025-38051-b41d0f9b",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9c9aafbacc183598f064902365e107b5e856531f",
"signature_type": "Function"
},
{
"digest": {
"line_hashes": [
"76173573880541942212181312891225440083",
"177724639873156833473002600680258570779",
"298140791220893195692382185028360296235",
"138312155790968872509158245619539692652",
"121563165408311174120812107118911299823",
"137220312341123926917124726791992257875",
"90142693707404654485720359280294456932",
"304876301389561123135361842309019363643"
],
"threshold": 0.9
},
"target": {
"file": "fs/smb/client/readdir.c"
},
"deprecated": false,
"id": "CVE-2025-38051-b4b6837e",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c8623231e0edfcccb7cc6add0288fa0f0594282f",
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"76173573880541942212181312891225440083",
"177724639873156833473002600680258570779",
"298140791220893195692382185028360296235",
"138312155790968872509158245619539692652",
"121563165408311174120812107118911299823",
"137220312341123926917124726791992257875",
"90142693707404654485720359280294456932",
"304876301389561123135361842309019363643"
],
"threshold": 0.9
},
"target": {
"file": "fs/smb/client/readdir.c"
},
"deprecated": false,
"id": "CVE-2025-38051-e062ee59",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9bea368648ac46f8593a780760362e40291d22a9",
"signature_type": "Line"
},
{
"digest": {
"length": 3286.0,
"function_hash": "38587046427828547983157738335237024320"
},
"target": {
"file": "fs/smb/client/readdir.c",
"function": "find_cifs_entry"
},
"deprecated": false,
"id": "CVE-2025-38051-fb3d7f43",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9bea368648ac46f8593a780760362e40291d22a9",
"signature_type": "Function"
}
]