[syzbot] [kernel?] KASAN: slab-use-after-free Read in futex_unqueue

6 views
Skip to first unread message

syzbot

unread,
Feb 10, 2026, 4:43:34 PM (2 days ago) Feb 10
to andre...@igalia.com, da...@stgolabs.net, dvh...@infradead.org, linux-...@vger.kernel.org, mi...@redhat.com, pet...@infradead.org, syzkall...@googlegroups.com, tg...@kernel.org
Hello,

syzbot found the following issue on:

HEAD commit: 72c395024dac Merge tag 'docs-7.0' of git://git.kernel.org/..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=137d9b22580000
kernel config: https://syzkaller.appspot.com/x/.config?x=bf83be18dae53c93
dashboard link: https://syzkaller.appspot.com/bug?extid=6c1861115b4253e45969
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=169f8ae6580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17f657fa580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7b82c9e65868/disk-72c39502.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e5c12e1be777/vmlinux-72c39502.xz
kernel image: https://storage.googleapis.com/syzbot-assets/7a7dcee7ed8d/bzImage-72c39502.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+6c1861...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-use-after-free in __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
BUG: KASAN: slab-use-after-free in _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154
Read of size 1 at addr ffff888033ce23e0 by task syz.0.19/6039

CPU: 1 UID: 0 PID: 6039 Comm: syz.0.19 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/24/2026
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x156/0x4c9 mm/kasan/report.c:482
kasan_report+0xdf/0x1a0 mm/kasan/report.c:595
__kasan_check_byte+0x36/0x50 mm/kasan/common.c:574
kasan_check_byte include/linux/kasan.h:402 [inline]
lock_acquire kernel/locking/lockdep.c:5842 [inline]
lock_acquire+0xf5/0x330 kernel/locking/lockdep.c:5825
__raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
_raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:351 [inline]
futex_unqueue+0xa5/0x2c0 kernel/futex/core.c:938
__futex_wait+0x1cc/0x300 kernel/futex/waitwake.c:690
futex_wait+0xed/0x380 kernel/futex/waitwake.c:715
do_futex+0x1ef/0x350 kernel/futex/syscalls.c:130
__do_sys_futex kernel/futex/syscalls.c:207 [inline]
__se_sys_futex kernel/futex/syscalls.c:188 [inline]
__x64_sys_futex+0x34f/0x4d0 kernel/futex/syscalls.c:188
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xc9/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f6f87b9bf79
Code: Unable to access opcode bytes at 0x7f6f87b9bf4f.
RSP: 002b:00007f6f889c40e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: ffffffffffffffda RBX: 00007f6f87e15fa8 RCX: 00007f6f87b9bf79
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f6f87e15fa8
RBP: 00007f6f87e15fa0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f6f87e16038 R14: 00007ffe2ba93260 R15: 00007ffe2ba93348
</TASK>

Allocated by task 6038:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415
kasan_kmalloc include/linux/kasan.h:263 [inline]
__do_kmalloc_node mm/slub.c:5657 [inline]
__kvmalloc_node_noprof+0x34d/0xac0 mm/slub.c:7144
futex_hash_allocate+0x40b/0x1090 kernel/futex/core.c:1812
futex_hash_allocate_default+0x2ca/0x5b0 kernel/futex/core.c:1921
copy_process+0x4eb5/0x79b0 kernel/fork.c:2344
kernel_clone+0xfc/0x930 kernel/fork.c:2654
__do_sys_clone3+0x214/0x290 kernel/fork.c:2956
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xc9/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 6038:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:253 [inline]
__kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2540 [inline]
slab_free mm/slub.c:6674 [inline]
kfree+0x1c7/0x690 mm/slub.c:6886
futex_hash_free+0x98/0xc0 kernel/futex/core.c:1739
__mmput+0x30c/0x410 kernel/fork.c:1185
mmput+0x67/0x80 kernel/fork.c:1197
exit_mm kernel/exit.c:581 [inline]
do_exit+0x78a/0x2a30 kernel/exit.c:959
do_group_exit+0xd5/0x2a0 kernel/exit.c:1112
__do_sys_exit_group kernel/exit.c:1123 [inline]
__se_sys_exit_group kernel/exit.c:1121 [inline]
__x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1121
x64_sys_call+0x14fd/0x1510 arch/x86/include/generated/asm/syscalls_64.h:232
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xc9/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff888033ce2000
which belongs to the cache kmalloc-cg-4k of size 4096
The buggy address is located 992 bytes inside of
freed 4096-byte region [ffff888033ce2000, ffff888033ce3000)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x33ce0
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff888076582001
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88813fe30500 dead000000000122 0000000000000000
raw: 0000000000000000 0000000080040004 00000000f5000000 ffff888076582001
head: 00fff00000000040 ffff88813fe30500 dead000000000122 0000000000000000
head: 0000000000000000 0000000080040004 00000000f5000000 ffff888076582001
head: 00fff00000000003 ffffea0000cf3801 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5887, tgid 5887 (udevd), ts 101745764711, free_ts 101704527247
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1e1/0x250 mm/page_alloc.c:1884
prep_new_page mm/page_alloc.c:1892 [inline]
get_page_from_freelist+0xe3d/0x2e10 mm/page_alloc.c:3945
__alloc_frozen_pages_noprof+0x26c/0x2410 mm/page_alloc.c:5240
alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486
alloc_slab_page mm/slub.c:3075 [inline]
allocate_slab mm/slub.c:3248 [inline]
new_slab+0x2c4/0x440 mm/slub.c:3302
___slab_alloc+0xda3/0x1ca0 mm/slub.c:4656
__slab_alloc.isra.0+0x63/0x110 mm/slub.c:4779
__slab_alloc_node mm/slub.c:4855 [inline]
slab_alloc_node mm/slub.c:5251 [inline]
__do_kmalloc_node mm/slub.c:5656 [inline]
__kvmalloc_node_noprof+0x749/0xac0 mm/slub.c:7144
seq_buf_alloc fs/seq_file.c:38 [inline]
seq_read_iter+0x819/0x1270 fs/seq_file.c:210
kernfs_fop_read_iter+0x46c/0x610 fs/kernfs/file.c:297
new_sync_read fs/read_write.c:493 [inline]
vfs_read+0x825/0xb30 fs/read_write.c:574
ksys_read+0x12a/0x250 fs/read_write.c:717
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xc9/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 5933 tgid 5933 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1433 [inline]
__free_frozen_pages+0x822/0x1130 mm/page_alloc.c:2973
discard_slab mm/slub.c:3346 [inline]
__put_partials+0x127/0x160 mm/slub.c:3886
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x47/0xe0 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350
kasan_slab_alloc include/linux/kasan.h:253 [inline]
slab_post_alloc_hook mm/slub.c:4953 [inline]
slab_alloc_node mm/slub.c:5263 [inline]
__kmalloc_cache_noprof+0x2e1/0x810 mm/slub.c:5775
kmalloc_noprof include/linux/slab.h:957 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
nsim_fib4_rt_create drivers/net/netdevsim/fib.c:280 [inline]
nsim_fib4_rt_insert drivers/net/netdevsim/fib.c:426 [inline]
nsim_fib4_event drivers/net/netdevsim/fib.c:464 [inline]
nsim_fib_event drivers/net/netdevsim/fib.c:884 [inline]
nsim_fib_event_work+0xfeb/0x63b0 drivers/net/netdevsim/fib.c:1493
process_one_work+0x9c2/0x1840 kernel/workqueue.c:3257
process_scheduled_works kernel/workqueue.c:3340 [inline]
worker_thread+0x5da/0xe40 kernel/workqueue.c:3421
kthread+0x370/0x450 kernel/kthread.c:467
ret_from_fork+0x754/0xaf0 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246

Memory state around the buggy address:
ffff888033ce2280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888033ce2300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888033ce2380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888033ce2400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888033ce2480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

Hillf Danton

unread,
Feb 10, 2026, 5:52:12 PM (2 days ago) Feb 10
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
> Date: Tue, 10 Feb 2026 13:43:32 -0800 [thread overview]
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 72c395024dac Merge tag 'docs-7.0' of git://git.kernel.org/..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=137d9b22580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=bf83be18dae53c93
> dashboard link: https://syzkaller.appspot.com/bug?extid=6c1861115b4253e45969
> compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=169f8ae6580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17f657fa580000

#syz test

--- x/kernel/futex/core.c
+++ y/kernel/futex/core.c
@@ -1735,8 +1735,7 @@ void futex_hash_free(struct mm_struct *m
free_percpu(mm->futex_ref);
kvfree(mm->futex_phash_new);
fph = rcu_dereference_raw(mm->futex_phash);
- if (fph)
- kvfree(fph);
+ kvfree_rcu(fph, rcu);
}

static bool futex_pivot_pending(struct mm_struct *mm)
--

syzbot

unread,
Feb 10, 2026, 6:15:04 PM (2 days ago) Feb 10
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
kernel BUG in __mmput

------------[ cut here ]------------
kernel BUG at kernel/fork.c:1168!
Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
CPU: 0 UID: 0 PID: 6657 Comm: syz.0.84 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/24/2026
RIP: 0010:__mmput kernel/fork.c:1168 [inline]
RIP: 0010:__mmput+0x36a/0x410 kernel/fork.c:1166
Code: e8 ab 9c 41 00 48 89 df e8 43 ba b3 00 e9 c4 fd ff ff e8 99 9c 41 00 48 89 df e8 e1 b1 ab 00 e9 65 fd ff ff e8 87 9c 41 00 90 <0f> 0b e8 7f 9c 41 00 48 89 df e8 c7 cc ff ff eb b3 48 89 ef e8 bd
RSP: 0000:ffffc90003107b50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff88802a7124c0 RCX: ffffffff81c4f02d
RDX: ffff8880784e1e40 RSI: ffffffff81c4f339 RDI: ffff8880784e1e40
RBP: 00000000ffffffff R08: 0000000000000005 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000000 R12: 0000000000000200
R13: ffff88802a712790 R14: ffff88801cf9f400 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8881245bf000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055557ac0c4e8 CR3: 0000000028ca2000 CR4: 00000000003526f0
Call Trace:
<TASK>
mmput+0x67/0x80 kernel/fork.c:1197
exit_mm kernel/exit.c:581 [inline]
do_exit+0x78a/0x2a30 kernel/exit.c:959
do_group_exit+0xd5/0x2a0 kernel/exit.c:1112
get_signal+0x1ec7/0x21e0 kernel/signal.c:3034
arch_do_signal_or_restart+0x91/0x770 arch/x86/kernel/signal.c:337
__exit_to_user_mode_loop kernel/entry/common.c:64 [inline]
exit_to_user_mode_loop+0x86/0x4a0 kernel/entry/common.c:98
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:325 [inline]
do_syscall_64+0x668/0xf80 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f362119bf79
Code: Unable to access opcode bytes at 0x7f362119bf4f.
RSP: 002b:00007f36220860e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00007f3621415fa8 RCX: 00007f362119bf79
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f3621415fa8
RBP: 00007f3621415fa0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f3621416038 R14: 00007ffc4753fb50 R15: 00007ffc4753fc38
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__mmput kernel/fork.c:1168 [inline]
RIP: 0010:__mmput+0x36a/0x410 kernel/fork.c:1166
Code: e8 ab 9c 41 00 48 89 df e8 43 ba b3 00 e9 c4 fd ff ff e8 99 9c 41 00 48 89 df e8 e1 b1 ab 00 e9 65 fd ff ff e8 87 9c 41 00 90 <0f> 0b e8 7f 9c 41 00 48 89 df e8 c7 cc ff ff eb b3 48 89 ef e8 bd
RSP: 0000:ffffc90003107b50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff88802a7124c0 RCX: ffffffff81c4f02d
RDX: ffff8880784e1e40 RSI: ffffffff81c4f339 RDI: ffff8880784e1e40
RBP: 00000000ffffffff R08: 0000000000000005 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000000 R12: 0000000000000200
R13: ffff88802a712790 R14: ffff88801cf9f400 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8881245bf000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055557ac0c4e8 CR3: 0000000075a0c000 CR4: 00000000003526f0


Tested on:

commit: dc855b77 Merge tag 'irq-drivers-2026-02-09' of git://g..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11aab402580000
kernel config: https://syzkaller.appspot.com/x/.config?x=86c6013ce1247095
dashboard link: https://syzkaller.appspot.com/bug?extid=6c1861115b4253e45969
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
patch: https://syzkaller.appspot.com/x/patch.diff?x=111d0e5a580000

Hillf Danton

unread,
Feb 10, 2026, 7:38:35 PM (2 days ago) Feb 10
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
> Date: Tue, 10 Feb 2026 13:43:32 -0800 [thread overview]
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 72c395024dac Merge tag 'docs-7.0' of git://git.kernel.org/..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=137d9b22580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=bf83be18dae53c93
> dashboard link: https://syzkaller.appspot.com/bug?extid=6c1861115b4253e45969
> compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=169f8ae6580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17f657fa580000

#syz test

--- x/kernel/futex/core.c
+++ y/kernel/futex/core.c
@@ -1735,8 +1735,7 @@ void futex_hash_free(struct mm_struct *m
free_percpu(mm->futex_ref);
kvfree(mm->futex_phash_new);
fph = rcu_dereference_raw(mm->futex_phash);
- if (fph)
- kvfree(fph);
+ kvfree_rcu(fph, rcu);
}

static bool futex_pivot_pending(struct mm_struct *mm)
--- x/kernel/fork.c
+++ y/kernel/fork.c
@@ -1192,6 +1192,7 @@ static inline void __mmput(struct mm_str
void mmput(struct mm_struct *mm)
{
might_sleep();
+ VM_BUG_ON(!atomic_read(&mm->mm_users));

if (atomic_dec_and_test(&mm->mm_users))
__mmput(mm);
--

syzbot

unread,
Feb 10, 2026, 7:55:03 PM (2 days ago) Feb 10
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
kernel BUG in mmput

------------[ cut here ]------------
kernel BUG at kernel/fork.c:1195!
Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
CPU: 1 UID: 0 PID: 6521 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/24/2026
RIP: 0010:mmput kernel/fork.c:1195 [inline]
RIP: 0010:mmput+0xd0/0xe0 kernel/fork.c:1192
Code: 5b 5d 41 5c e9 01 65 b6 09 e8 9c 9b 41 00 48 89 df e8 24 fb ff ff e8 8f 9b 41 00 5b 5d 41 5c c3 cc cc cc cc e8 81 9b 41 00 90 <0f> 0b 48 89 ef e8 c6 06 ac 00 eb 84 0f 1f 40 00 90 90 90 90 90 90
RSP: 0018:ffffc90003467b78 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888033d6d5c0 RCX: ffffffff81c4f461
RDX: ffff888026543c80 RSI: ffffffff81c4f4bf RDI: ffff888026543c80
RBP: ffff888033d6d684 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff888033d6d890 R14: ffff88802b22c140 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8881246bf000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f31e5ce6286 CR3: 00000000580b6000 CR4: 00000000003526f0
Call Trace:
<TASK>
exit_mm kernel/exit.c:581 [inline]
do_exit+0x78a/0x2a30 kernel/exit.c:959
do_group_exit+0xd5/0x2a0 kernel/exit.c:1112
get_signal+0x1ec7/0x21e0 kernel/signal.c:3034
arch_do_signal_or_restart+0x91/0x770 arch/x86/kernel/signal.c:337
__exit_to_user_mode_loop kernel/entry/common.c:64 [inline]
exit_to_user_mode_loop+0x86/0x4a0 kernel/entry/common.c:98
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:325 [inline]
do_syscall_64+0x668/0xf80 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f532639bf79
Code: Unable to access opcode bytes at 0x7f532639bf4f.
RSP: 002b:00007f53271780e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: 0000000000000001 RBX: 00007f5326615fa8 RCX: 00007f532639bf79
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f5326615fac
RBP: 00007f5326615fa0 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5326616038 R14: 00007ffe73e55530 R15: 00007ffe73e55618
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:mmput kernel/fork.c:1195 [inline]
RIP: 0010:mmput+0xd0/0xe0 kernel/fork.c:1192
Code: 5b 5d 41 5c e9 01 65 b6 09 e8 9c 9b 41 00 48 89 df e8 24 fb ff ff e8 8f 9b 41 00 5b 5d 41 5c c3 cc cc cc cc e8 81 9b 41 00 90 <0f> 0b 48 89 ef e8 c6 06 ac 00 eb 84 0f 1f 40 00 90 90 90 90 90 90
RSP: 0018:ffffc90003467b78 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888033d6d5c0 RCX: ffffffff81c4f461
RDX: ffff888026543c80 RSI: ffffffff81c4f4bf RDI: ffff888026543c80
RBP: ffff888033d6d684 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff888033d6d890 R14: ffff88802b22c140 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8881246bf000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f31e5ce6286 CR3: 000000000e396000 CR4: 00000000003526f0


Tested on:

commit: dc855b77 Merge tag 'irq-drivers-2026-02-09' of git://g..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12ad57fa580000
kernel config: https://syzkaller.appspot.com/x/.config?x=86c6013ce1247095
dashboard link: https://syzkaller.appspot.com/bug?extid=6c1861115b4253e45969
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
patch: https://syzkaller.appspot.com/x/patch.diff?x=16c2365a580000

syzbot

unread,
Feb 10, 2026, 10:31:44 PM (2 days ago) Feb 10
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: [PATCH] futex: Fix use-after-free in futex_unqueue() on private hash teardown
Author: suun...@gmail.com

futex_hash_free() frees the private hash table with kvfree() in the
__mmput() path. However, a task sharing the same mm via CLONE_VM may
still be in futex_unqueue() which relies on RCU read-side protection
(guard(rcu)) when acquiring the hash bucket spinlock.

Since kvfree() does not respect RCU grace periods, the hash bucket
memory can be reclaimed while futex_unqueue() is still referencing it,
leading to a use-after-free on the embedded spinlock.

Use kvfree_rcu() instead, which defers freeing until after an RCU grace
period, matching the protection already assumed by futex_unqueue().

The futex_private_hash structure already has an rcu_head field used by
the pivot path (__futex_pivot_hash), so no structural changes are needed.

Fixes: 80367ad01d93 ("futex: Add basic infrastructure for local task local hash")
Reported-by: syzbot+6c1861...@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=6c1861115b4253e45969
Signed-off-by: SeungJu Cheon <suun...@gmail.com>
---
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

kernel/futex/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/futex/core.c b/kernel/futex/core.c
index cf7e610eac42..b625455a7e9f 100644
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -1736,7 +1736,7 @@ void futex_hash_free(struct mm_struct *mm)
kvfree(mm->futex_phash_new);
fph = rcu_dereference_raw(mm->futex_phash);
if (fph)
- kvfree(fph);
+ kvfree_rcu(fph, rcu);
}

static bool futex_pivot_pending(struct mm_struct *mm)
--
2.52.0

syzbot

unread,
Feb 10, 2026, 10:49:05 PM (2 days ago) Feb 10
to linux-...@vger.kernel.org, suun...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
kernel BUG in __mmput

------------[ cut here ]------------
kernel BUG at kernel/fork.c:1168!
Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
CPU: 1 UID: 0 PID: 7127 Comm: syz.0.226 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/24/2026
RIP: 0010:__mmput kernel/fork.c:1168 [inline]
RIP: 0010:__mmput+0x36a/0x410 kernel/fork.c:1166
Code: e8 7b a2 41 00 48 89 df e8 33 c0 b3 00 e9 c4 fd ff ff e8 69 a2 41 00 48 89 df e8 d1 b7 ab 00 e9 65 fd ff ff e8 57 a2 41 00 90 <0f> 0b e8 4f a2 41 00 48 89 df e8 c7 cc ff ff eb b3 48 89 ef e8 ad
RSP: 0018:ffffc90004927b50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888077276e40 RCX: ffffffff81c4fe7d
RDX: ffff888026225ac0 RSI: ffffffff81c50189 RDI: ffff888026225ac0
RBP: 00000000ffffffff R08: 0000000000000005 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000000 R12: 0000000000000200
R13: ffff888077277110 R14: ffff88802a50ba00 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8881246bd000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000007ff CR3: 00000000749f2000 CR4: 00000000003526f0
Call Trace:
<TASK>
mmput+0x67/0x80 kernel/fork.c:1197
exit_mm kernel/exit.c:581 [inline]
do_exit+0x78a/0x2a30 kernel/exit.c:959
do_group_exit+0xd5/0x2a0 kernel/exit.c:1112
get_signal+0x1ec7/0x21e0 kernel/signal.c:3034
arch_do_signal_or_restart+0x91/0x770 arch/x86/kernel/signal.c:337
__exit_to_user_mode_loop kernel/entry/common.c:64 [inline]
exit_to_user_mode_loop+0x86/0x4a0 kernel/entry/common.c:98
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:325 [inline]
do_syscall_64+0x668/0xf80 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fd9de19bf79
Code: Unable to access opcode bytes at 0x7fd9de19bf4f.
RSP: 002b:00007fd9def750e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00007fd9de415fa8 RCX: 00007fd9de19bf79
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fd9de415fa8
RBP: 00007fd9de415fa0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd9de416038 R14: 00007ffc457ef100 R15: 00007ffc457ef1e8
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__mmput kernel/fork.c:1168 [inline]
RIP: 0010:__mmput+0x36a/0x410 kernel/fork.c:1166
Code: e8 7b a2 41 00 48 89 df e8 33 c0 b3 00 e9 c4 fd ff ff e8 69 a2 41 00 48 89 df e8 d1 b7 ab 00 e9 65 fd ff ff e8 57 a2 41 00 90 <0f> 0b e8 4f a2 41 00 48 89 df e8 c7 cc ff ff eb b3 48 89 ef e8 ad
RSP: 0018:ffffc90004927b50 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff888077276e40 RCX: ffffffff81c4fe7d
RDX: ffff888026225ac0 RSI: ffffffff81c50189 RDI: ffff888026225ac0
RBP: 00000000ffffffff R08: 0000000000000005 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000000 R12: 0000000000000200
R13: ffff888077277110 R14: ffff88802a50ba00 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8881246bd000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000007ff CR3: 00000000324f4000 CR4: 00000000003526f0


Tested on:

commit: ca8f421e Merge tag 'x86_sev_for_v7.0_rc1' of git://git..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1109b402580000
kernel config: https://syzkaller.appspot.com/x/.config?x=aaa1d655bee4457b
dashboard link: https://syzkaller.appspot.com/bug?extid=6c1861115b4253e45969
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
patch: https://syzkaller.appspot.com/x/patch.diff?x=174f0e5a580000

Hillf Danton

unread,
Feb 11, 2026, 1:31:34 AM (yesterday) Feb 11
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
> Date: Tue, 10 Feb 2026 13:43:32 -0800 [thread overview]
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 72c395024dac Merge tag 'docs-7.0' of git://git.kernel.org/..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=137d9b22580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=bf83be18dae53c93
> dashboard link: https://syzkaller.appspot.com/bug?extid=6c1861115b4253e45969
> compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=169f8ae6580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17f657fa580000

#syz test

--- x/kernel/futex/core.c
+++ y/kernel/futex/core.c
@@ -1735,8 +1735,7 @@ void futex_hash_free(struct mm_struct *m
free_percpu(mm->futex_ref);
kvfree(mm->futex_phash_new);
fph = rcu_dereference_raw(mm->futex_phash);
- if (fph)
- kvfree(fph);
+ kvfree_rcu(fph, rcu);
}

static bool futex_pivot_pending(struct mm_struct *mm)
--- x/kernel/fork.c
+++ y/kernel/fork.c
@@ -1165,8 +1165,6 @@ EXPORT_SYMBOL_IF_KUNIT(mm_alloc);

static inline void __mmput(struct mm_struct *mm)
{
- VM_BUG_ON(atomic_read(&mm->mm_users));
-
uprobe_clear_state(mm);
exit_aio(mm);
ksm_exit(mm);
--

syzbot

unread,
Feb 11, 2026, 1:55:06 AM (yesterday) Feb 11
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+6c1861...@syzkaller.appspotmail.com
Tested-by: syzbot+6c1861...@syzkaller.appspotmail.com

Tested on:

commit: 192c0159 Merge tag 'powerpc-7.0-1' of git://git.kernel..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17e56ae6580000
kernel config: https://syzkaller.appspot.com/x/.config?x=aaa1d655bee4457b
dashboard link: https://syzkaller.appspot.com/bug?extid=6c1861115b4253e45969
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
patch: https://syzkaller.appspot.com/x/patch.diff?x=15048e5a580000

Note: testing is done by a robot and is best-effort only.

Thomas Gleixner

unread,
Feb 11, 2026, 3:14:38 AM (yesterday) Feb 11
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Tue, Feb 10 2026 at 19:31, syzbot wrote:
> Subject: [PATCH] futex: Fix use-after-free in futex_unqueue() on private hash teardown
> Author: suun...@gmail.com
>
> futex_hash_free() frees the private hash table with kvfree() in the
> __mmput() path. However, a task sharing the same mm via CLONE_VM may
> still be in futex_unqueue() which relies on RCU read-side protection
> (guard(rcu)) when acquiring the hash bucket spinlock.
>
> Since kvfree() does not respect RCU grace periods, the hash bucket
> memory can be reclaimed while futex_unqueue() is still referencing it,
> leading to a use-after-free on the embedded spinlock.
>
> Use kvfree_rcu() instead, which defers freeing until after an RCU grace
> period, matching the protection already assumed by futex_unqueue().
>
> The futex_private_hash structure already has an rcu_head field used by
> the pivot path (__futex_pivot_hash), so no structural changes are needed.

This does not fix anything as I explained already before:

https://lore.kernel.org/lkml/87o6lwa0fl.ffs@tglx/
https://lore.kernel.org/all/87qzqsa1br.ffs@tglx/

The futex code has absolutely nothing to do with this and is entirely
correct.

Thanks,

tglx

Hillf Danton

unread,
Feb 11, 2026, 4:22:43 AM (24 hours ago) Feb 11
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
> Date: Tue, 10 Feb 2026 13:43:32 -0800 [thread overview]
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 72c395024dac Merge tag 'docs-7.0' of git://git.kernel.org/..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=137d9b22580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=bf83be18dae53c93
> dashboard link: https://syzkaller.appspot.com/bug?extid=6c1861115b4253e45969
> compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=169f8ae6580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17f657fa580000

#syz test

--- x/fs/proc/task_mmu.c
+++ y/fs/proc/task_mmu.c
@@ -780,7 +780,7 @@ static int do_procmap_query(struct mm_st
} else {
if (karg.build_id_size < build_id_sz) {
err = -ENAMETOOLONG;
- goto out;
+ goto out_file;
}
karg.build_id_size = build_id_sz;
}
@@ -808,6 +808,7 @@ static int do_procmap_query(struct mm_st
out:
query_vma_teardown(&lock_ctx);
mmput(mm);
+out_file:
if (vm_file)
fput(vm_file);
kfree(name_buf);
--

syzbot

unread,
Feb 11, 2026, 4:46:06 AM (24 hours ago) Feb 11
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+6c1861...@syzkaller.appspotmail.com
Tested-by: syzbot+6c1861...@syzkaller.appspotmail.com

Tested on:

commit: 192c0159 Merge tag 'powerpc-7.0-1' of git://git.kernel..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1202ccaa580000
kernel config: https://syzkaller.appspot.com/x/.config?x=aaa1d655bee4457b
dashboard link: https://syzkaller.appspot.com/bug?extid=6c1861115b4253e45969
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
patch: https://syzkaller.appspot.com/x/patch.diff?x=131a0b3a580000
Reply all
Reply to author
Forward
0 new messages