[v5.15] KASAN: use-after-free Read in remove_wait_queue

5 views
Skip to first unread message

syzbot

unread,
Aug 2, 2025, 8:30:38 PM8/2/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: c79648372d02 Linux 5.15.189
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=105e7f82580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f3b1215b3cf4119f
dashboard link: https://syzkaller.appspot.com/bug?extid=ccf20f8a60140d349005
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/fa511d2a8893/disk-c7964837.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f14b6c77bbb9/vmlinux-c7964837.xz
kernel image: https://storage.googleapis.com/syzbot-assets/388987ba15c6/bzImage-c7964837.xz

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

==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0xf7/0x7c60 kernel/locking/lockdep.c:4882
Read of size 8 at addr ffff88801b1bc4b8 by task syz.0.113/4718

CPU: 1 PID: 4718 Comm: syz.0.113 Not tainted 5.15.189-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
print_address_description+0x60/0x2d0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xdf/0x130 mm/kasan/report.c:451
__lock_acquire+0xf7/0x7c60 kernel/locking/lockdep.c:4882
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
remove_wait_queue+0x20/0x120 kernel/sched/wait.c:55
free_poll_entry fs/select.c:134 [inline]
poll_freewait+0x99/0x210 fs/select.c:143
do_select+0x1629/0x16f0 fs/select.c:611
core_sys_select+0x65c/0x860 fs/select.c:680
do_pselect fs/select.c:762 [inline]
__do_sys_pselect6 fs/select.c:803 [inline]
__se_sys_pselect6+0x2ed/0x3a0 fs/select.c:794
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f807d7b3b69
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f807b5fa038 EFLAGS: 00000246 ORIG_RAX: 000000000000010e
RAX: ffffffffffffffda RBX: 00007f807d9db080 RCX: 00007f807d7b3b69
RDX: 0000000000000000 RSI: 0000200000000280 RDI: 0000000000000040
RBP: 00007f807d836df1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000200000000180 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f807d9db080 R15: 00007ffcc77a2998
</TASK>

Allocated by task 4606:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc mm/kasan/common.c:513 [inline]
__kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522
kmalloc include/linux/slab.h:604 [inline]
kzalloc include/linux/slab.h:735 [inline]
__comedi_device_postconfig_async drivers/comedi/drivers.c:664 [inline]
__comedi_device_postconfig drivers/comedi/drivers.c:721 [inline]
comedi_device_postconfig+0x496/0xc50 drivers/comedi/drivers.c:756
comedi_device_attach+0x52f/0x650 drivers/comedi/drivers.c:998
do_devconfig_ioctl drivers/comedi/comedi_fops.c:851 [inline]
comedi_unlocked_ioctl+0x5ec/0xe90 drivers/comedi/comedi_fops.c:2131
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 4719:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0xea/0x170 mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kfree+0xef/0x2a0 mm/slub.c:4559
comedi_device_detach_cleanup drivers/comedi/drivers.c:172 [inline]
comedi_device_detach+0x35f/0x6e0 drivers/comedi/drivers.c:208
do_devconfig_ioctl drivers/comedi/comedi_fops.c:829 [inline]
comedi_unlocked_ioctl+0xbd0/0xe90 drivers/comedi/comedi_fops.c:2131
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

Last potentially related work creation:
kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
kvfree_call_rcu+0x10a/0x7c0 kernel/rcu/tree.c:3600
drop_sysctl_table+0x2fa/0x430 fs/proc/proc_sysctl.c:1685
drop_sysctl_table+0x2e9/0x430 fs/proc/proc_sysctl.c:1688
unregister_sysctl_table+0x87/0x130 fs/proc/proc_sysctl.c:1723
neigh_sysctl_unregister+0x74/0x90 net/core/neighbour.c:3737
devinet_sysctl_unregister net/ipv4/devinet.c:2656 [inline]
inetdev_destroy net/ipv4/devinet.c:326 [inline]
inetdev_event+0x74b/0x1360 net/ipv4/devinet.c:1612
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391
call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
call_netdevice_notifiers net/core/dev.c:2075 [inline]
unregister_netdevice_many+0xf57/0x18f0 net/core/dev.c:11134
unregister_netdevice_queue+0x31c/0x360 net/core/dev.c:11067
unregister_netdevice include/linux/netdevice.h:3020 [inline]
__tun_detach+0xd4a/0x1500 drivers/net/tun.c:686
tun_detach drivers/net/tun.c:702 [inline]
tun_chr_close+0x109/0x1b0 drivers/net/tun.c:3440
__fput+0x234/0x930 fs/file_table.c:311
task_work_run+0x125/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff88801b1bc400
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 184 bytes inside of
256-byte region [ffff88801b1bc400, ffff88801b1bc500)
The buggy address belongs to the page:
page:ffffea00006c6f00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1b1bc
head:ffffea00006c6f00 order:1 compound_mapcount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea00006d6580 0000000b0000000b ffff888016841b40
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 50, ts 2365036192, free_ts 0
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
__alloc_pages+0x1e1/0x470 mm/page_alloc.c:5474
alloc_slab_page mm/slub.c:1775 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xc0/0x4b0 mm/slub.c:1975
___slab_alloc+0x81e/0xdf0 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc_trace+0x1a5/0x2a0 mm/slub.c:3245
kmalloc include/linux/slab.h:604 [inline]
kzalloc include/linux/slab.h:735 [inline]
set_kthread_struct kernel/kthread.c:103 [inline]
kthread+0x10b/0x520 kernel/kthread.c:296
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
page_owner free stack trace missing

Memory state around the buggy address:
ffff88801b1bc380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88801b1bc400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88801b1bc480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88801b1bc500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88801b1bc580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
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 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

syzbot

unread,
Aug 2, 2025, 9:02:19 PM8/2/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3594f306da12 Linux 6.1.147
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10693834580000
kernel config: https://syzkaller.appspot.com/x/.config?x=30b8ca4950f83e04
dashboard link: https://syzkaller.appspot.com/bug?extid=800e15dbad458bb691ea
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/5b0395e2ec6c/disk-3594f306.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/c3ec331b7d5b/vmlinux-3594f306.xz
kernel image: https://storage.googleapis.com/syzbot-assets/bff42068e062/bzImage-3594f306.xz

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

==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0xf7/0x7c50 kernel/locking/lockdep.c:4919
Read of size 8 at addr ffff888018468eb8 by task syz.6.4291/22214

CPU: 0 PID: 22214 Comm: syz.6.4291 Not tainted 6.1.147-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0xa8/0x200 mm/kasan/report.c:418
kasan_report+0x10b/0x140 mm/kasan/report.c:522
__lock_acquire+0xf7/0x7c50 kernel/locking/lockdep.c:4919
lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
remove_wait_queue+0x20/0x120 kernel/sched/wait.c:54
free_poll_entry fs/select.c:132 [inline]
poll_freewait+0x99/0x210 fs/select.c:141
do_select+0x1761/0x1850 fs/select.c:609
core_sys_select+0x6ad/0x8b0 fs/select.c:678
do_pselect fs/select.c:760 [inline]
__do_sys_pselect6 fs/select.c:801 [inline]
__se_sys_pselect6+0x2ed/0x3a0 fs/select.c:792
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f4a94f8eb69
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f4a95d8a038 EFLAGS: 00000246 ORIG_RAX: 000000000000010e
RAX: ffffffffffffffda RBX: 00007f4a951b6080 RCX: 00007f4a94f8eb69
RDX: 0000000000000000 RSI: 0000200000000280 RDI: 0000000000000040
RBP: 00007f4a95011df1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000200000000180 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f4a951b6080 R15: 00007ffc69959678
</TASK>

Allocated by task 22077:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
__comedi_device_postconfig_async drivers/comedi/drivers.c:666 [inline]
__comedi_device_postconfig drivers/comedi/drivers.c:723 [inline]
comedi_device_postconfig+0x496/0xc50 drivers/comedi/drivers.c:758
comedi_device_attach+0x52f/0x650 drivers/comedi/drivers.c:1000
do_devconfig_ioctl drivers/comedi/comedi_fops.c:851 [inline]
comedi_unlocked_ioctl+0x5ec/0xf20 drivers/comedi/comedi_fops.c:2151
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 22215:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516
____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1750
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0xb6/0x1f0 mm/slub.c:3674
comedi_device_detach_cleanup drivers/comedi/drivers.c:171 [inline]
comedi_device_detach+0x35f/0x6e0 drivers/comedi/drivers.c:207
do_devconfig_ioctl drivers/comedi/comedi_fops.c:829 [inline]
comedi_unlocked_ioctl+0xb6b/0xf20 drivers/comedi/comedi_fops.c:2151
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

Last potentially related work creation:
kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
kvfree_call_rcu+0x108/0x870 kernel/rcu/tree.c:3405
drop_sysctl_table+0x2fa/0x430 fs/proc/proc_sysctl.c:1731
drop_sysctl_table+0x2e9/0x430 fs/proc/proc_sysctl.c:1734
unregister_sysctl_table+0x85/0x130 fs/proc/proc_sysctl.c:1769
neigh_sysctl_unregister+0x74/0x90 net/core/neighbour.c:3871
addrconf_sysctl_unregister net/ipv6/addrconf.c:7208 [inline]
addrconf_ifdown+0x1711/0x1a10 net/ipv6/addrconf.c:3952
addrconf_notify+0x405/0xf40 net/ipv6/addrconf.c:-1
notifier_call_chain kernel/notifier.c:87 [inline]
raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:455
call_netdevice_notifiers_extack net/core/dev.c:2039 [inline]
call_netdevice_notifiers net/core/dev.c:2053 [inline]
unregister_netdevice_many+0xfdc/0x1840 net/core/dev.c:10978
default_device_exit_batch+0x9c3/0xa50 net/core/dev.c:11491
ops_exit_list net/core/net_namespace.c:177 [inline]
cleanup_net+0x77b/0xb80 net/core/net_namespace.c:640
process_one_work+0x898/0x1160 kernel/workqueue.c:2292
worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Second to last potentially related work creation:
kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
kvfree_call_rcu+0x108/0x870 kernel/rcu/tree.c:3405
drop_sysctl_table+0x2fa/0x430 fs/proc/proc_sysctl.c:1731
drop_sysctl_table+0x2e9/0x430 fs/proc/proc_sysctl.c:1734
unregister_sysctl_table+0x85/0x130 fs/proc/proc_sysctl.c:1769
__devinet_sysctl_unregister net/ipv4/devinet.c:2636 [inline]
devinet_sysctl_unregister net/ipv4/devinet.c:2664 [inline]
inetdev_destroy net/ipv4/devinet.c:329 [inline]
inetdev_event+0x6db/0x1410 net/ipv4/devinet.c:1616
notifier_call_chain kernel/notifier.c:87 [inline]
raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:455
call_netdevice_notifiers_extack net/core/dev.c:2039 [inline]
call_netdevice_notifiers net/core/dev.c:2053 [inline]
unregister_netdevice_many+0xfdc/0x1840 net/core/dev.c:10978
ip_tunnel_delete_nets+0x318/0x360 net/ipv4/ip_tunnel.c:1171
ops_exit_list net/core/net_namespace.c:177 [inline]
cleanup_net+0x77b/0xb80 net/core/net_namespace.c:640
process_one_work+0x898/0x1160 kernel/workqueue.c:2292
worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff888018468e00
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 184 bytes inside of
256-byte region [ffff888018468e00, ffff888018468f00)

The buggy address belongs to the physical page:
page:ffffea0000611a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x18468
head:ffffea0000611a00 order:1 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea000063ac00 dead000000000002 ffff888017441b40
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 2459303555, free_ts 0
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328
__alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614
alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2115
alloc_slab_page+0x5d/0x160 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x87/0x2c0 mm/slub.c:1992
___slab_alloc+0xbc6/0x1220 mm/slub.c:3180
__slab_alloc mm/slub.c:3279 [inline]
slab_alloc_node mm/slub.c:3364 [inline]
__kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:935 [inline]
__kmalloc_node_track_caller+0x9e/0x230 mm/slab_common.c:956
__do_krealloc mm/slab_common.c:1336 [inline]
krealloc+0x6a/0x100 mm/slab_common.c:1369
add_sysfs_param+0xe8/0x930 kernel/params.c:651
kernel_add_sysfs_param+0xaf/0x11b kernel/params.c:812
param_sysfs_builtin+0x1f6/0x27c kernel/params.c:851
param_sysfs_init+0x66/0x6a kernel/params.c:972
do_one_initcall+0x214/0x7a0 init/main.c:1298
do_initcall_level+0x137/0x1e4 init/main.c:1371
page_owner free stack trace missing

Memory state around the buggy address:
ffff888018468d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888018468e00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888018468e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888018468f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888018468f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc

syzbot

unread,
Aug 2, 2025, 9:40:32 PM8/2/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: c79648372d02 Linux 5.15.189
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=140d2aa2580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f3b1215b3cf4119f
dashboard link: https://syzkaller.appspot.com/bug?extid=ccf20f8a60140d349005
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13057f82580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/fa511d2a8893/disk-c7964837.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f14b6c77bbb9/vmlinux-c7964837.xz
kernel image: https://storage.googleapis.com/syzbot-assets/388987ba15c6/bzImage-c7964837.xz

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

==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0xf7/0x7c60 kernel/locking/lockdep.c:4882
Read of size 8 at addr ffff8880240d58b8 by task syz.0.18/4323

CPU: 1 PID: 4323 Comm: syz.0.18 Not tainted 5.15.189-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
print_address_description+0x60/0x2d0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xdf/0x130 mm/kasan/report.c:451
__lock_acquire+0xf7/0x7c60 kernel/locking/lockdep.c:4882
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
remove_wait_queue+0x20/0x120 kernel/sched/wait.c:55
free_poll_entry fs/select.c:134 [inline]
poll_freewait+0x99/0x210 fs/select.c:143
do_select+0x1629/0x16f0 fs/select.c:611
core_sys_select+0x65c/0x860 fs/select.c:680
do_pselect fs/select.c:762 [inline]
__do_sys_pselect6 fs/select.c:803 [inline]
__se_sys_pselect6+0x2ed/0x3a0 fs/select.c:794
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fb204864b69
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb203ad4038 EFLAGS: 00000246 ORIG_RAX: 000000000000010e
RAX: ffffffffffffffda RBX: 00007fb204a8bfa0 RCX: 00007fb204864b69
RDX: 0000000000000000 RSI: 0000200000000280 RDI: 0000000000000040
RBP: 00007fb2048e7df1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000200000000180 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fb204a8bfa0 R15: 00007ffc9af64458
</TASK>

Allocated by task 4321:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc mm/kasan/common.c:513 [inline]
__kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522
kmalloc include/linux/slab.h:604 [inline]
kzalloc include/linux/slab.h:735 [inline]
__comedi_device_postconfig_async drivers/comedi/drivers.c:664 [inline]
__comedi_device_postconfig drivers/comedi/drivers.c:721 [inline]
comedi_device_postconfig+0x496/0xc50 drivers/comedi/drivers.c:756
comedi_device_attach+0x52f/0x650 drivers/comedi/drivers.c:998
do_devconfig_ioctl drivers/comedi/comedi_fops.c:851 [inline]
comedi_unlocked_ioctl+0x5ec/0xe90 drivers/comedi/comedi_fops.c:2131
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 4324:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0xea/0x170 mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kfree+0xef/0x2a0 mm/slub.c:4559
comedi_device_detach_cleanup drivers/comedi/drivers.c:172 [inline]
comedi_device_detach+0x35f/0x6e0 drivers/comedi/drivers.c:208
do_devconfig_ioctl drivers/comedi/comedi_fops.c:829 [inline]
comedi_unlocked_ioctl+0xbd0/0xe90 drivers/comedi/comedi_fops.c:2131
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff8880240d5800
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 184 bytes inside of
256-byte region [ffff8880240d5800, ffff8880240d5900)
The buggy address belongs to the page:
page:ffffea0000903500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x240d4
head:ffffea0000903500 order:1 compound_mapcount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888016841b40
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4300, ts 83405850184, free_ts 83404898052
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
__alloc_pages+0x1e1/0x470 mm/page_alloc.c:5474
alloc_slab_page mm/slub.c:1775 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xc0/0x4b0 mm/slub.c:1975
___slab_alloc+0x81e/0xdf0 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc_trace+0x1a5/0x2a0 mm/slub.c:3245
kmalloc include/linux/slab.h:604 [inline]
kzalloc include/linux/slab.h:735 [inline]
____ip_mc_inc_group+0x2ad/0xac0 net/ipv4/igmp.c:1452
__ip_mc_inc_group net/ipv4/igmp.c:1487 [inline]
ip_mc_inc_group net/ipv4/igmp.c:1493 [inline]
ip_mc_up+0x121/0x2f0 net/ipv4/igmp.c:1792
inetdev_event+0xe02/0x1360 net/ipv4/devinet.c:1587
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391
call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
call_netdevice_notifiers net/core/dev.c:2075 [inline]
__dev_notify_flags+0x178/0x2d0 net/core/dev.c:-1
dev_change_flags+0xe3/0x1a0 net/core/dev.c:8929
do_setlink+0xc01/0x3980 net/core/rtnetlink.c:2779
__rtnl_newlink net/core/rtnetlink.c:3450 [inline]
rtnl_newlink+0x1419/0x17d0 net/core/rtnetlink.c:3572
rtnetlink_rcv_msg+0x9b9/0xe60 net/core/rtnetlink.c:5650
netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2507
netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
netlink_unicast+0x774/0x920 net/netlink/af_netlink.c:1344
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
free_unref_page+0x94/0x280 mm/page_alloc.c:3396
qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3220 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc_trace+0x103/0x2a0 mm/slub.c:3245
kmalloc include/linux/slab.h:604 [inline]
netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:643 [inline]
netdevice_event+0x324/0x900 drivers/infiniband/core/roce_gid_mgmt.c:802
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391
call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
call_netdevice_notifiers+0x85/0xc0 net/core/dev.c:2075
ipvlan_device_event+0x388/0x9e0 drivers/net/ipvlan/ipvlan_main.c:793
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391
call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
call_netdevice_notifiers net/core/dev.c:2075 [inline]
dev_set_mac_address+0x2c4/0x3d0 net/core/dev.c:9114
dev_set_mac_address_user+0x2d/0x50 net/core/dev.c:9128
do_setlink+0x80d/0x3980 net/core/rtnetlink.c:2734
__rtnl_newlink net/core/rtnetlink.c:3450 [inline]
rtnl_newlink+0x1419/0x17d0 net/core/rtnetlink.c:3572

Memory state around the buggy address:
ffff8880240d5780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880240d5800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880240d5880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880240d5900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880240d5980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
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.

syzbot

unread,
Aug 2, 2025, 10:17:24 PM8/2/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 3594f306da12 Linux 6.1.147
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16cd7f82580000
kernel config: https://syzkaller.appspot.com/x/.config?x=30b8ca4950f83e04
dashboard link: https://syzkaller.appspot.com/bug?extid=800e15dbad458bb691ea
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12832aa2580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/5b0395e2ec6c/disk-3594f306.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/c3ec331b7d5b/vmlinux-3594f306.xz
kernel image: https://storage.googleapis.com/syzbot-assets/bff42068e062/bzImage-3594f306.xz

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

==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0xf7/0x7c50 kernel/locking/lockdep.c:4919
Read of size 8 at addr ffff88807ee182b8 by task syz.0.18/4433

CPU: 0 PID: 4433 Comm: syz.0.18 Not tainted 6.1.147-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0xa8/0x200 mm/kasan/report.c:418
kasan_report+0x10b/0x140 mm/kasan/report.c:522
__lock_acquire+0xf7/0x7c50 kernel/locking/lockdep.c:4919
lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
remove_wait_queue+0x20/0x120 kernel/sched/wait.c:54
free_poll_entry fs/select.c:132 [inline]
poll_freewait+0x99/0x210 fs/select.c:141
do_select+0x1761/0x1850 fs/select.c:609
core_sys_select+0x6ad/0x8b0 fs/select.c:678
do_pselect fs/select.c:760 [inline]
__do_sys_pselect6 fs/select.c:801 [inline]
__se_sys_pselect6+0x2ed/0x3a0 fs/select.c:792
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f050b38eb69
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f050c187038 EFLAGS: 00000246 ORIG_RAX: 000000000000010e
RAX: ffffffffffffffda RBX: 00007f050b5b5fa0 RCX: 00007f050b38eb69
RDX: 0000000000000000 RSI: 0000200000000280 RDI: 0000000000000040
RBP: 00007f050b411df1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000200000000180 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f050b5b5fa0 R15: 00007ffd083d2448
</TASK>

Allocated by task 4431:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
__comedi_device_postconfig_async drivers/comedi/drivers.c:666 [inline]
__comedi_device_postconfig drivers/comedi/drivers.c:723 [inline]
comedi_device_postconfig+0x496/0xc50 drivers/comedi/drivers.c:758
comedi_device_attach+0x52f/0x650 drivers/comedi/drivers.c:1000
do_devconfig_ioctl drivers/comedi/comedi_fops.c:851 [inline]
comedi_unlocked_ioctl+0x5ec/0xf20 drivers/comedi/comedi_fops.c:2151
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 4434:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516
____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1750
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0xb6/0x1f0 mm/slub.c:3674
comedi_device_detach_cleanup drivers/comedi/drivers.c:171 [inline]
comedi_device_detach+0x35f/0x6e0 drivers/comedi/drivers.c:207
do_devconfig_ioctl drivers/comedi/comedi_fops.c:829 [inline]
comedi_unlocked_ioctl+0xb6b/0xf20 drivers/comedi/comedi_fops.c:2151
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff88807ee18200
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 184 bytes inside of
256-byte region [ffff88807ee18200, ffff88807ee18300)

The buggy address belongs to the physical page:
page:ffffea0001fb8600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7ee18
head:ffffea0001fb8600 order:1 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888017441b40
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4367, tgid 4367 (syz-executor), ts 110081456388, free_ts 110064818622
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328
__alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614
alloc_slab_page+0x5d/0x160 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x87/0x2c0 mm/slub.c:1992
___slab_alloc+0xbc6/0x1220 mm/slub.c:3180
__slab_alloc mm/slub.c:3279 [inline]
slab_alloc_node mm/slub.c:3364 [inline]
__kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:935 [inline]
__kmalloc_node_track_caller+0x9e/0x230 mm/slab_common.c:956
kmemdup+0x27/0x60 mm/util.c:129
kmemdup include/linux/fortify-string.h:585 [inline]
ip6t_register_table+0x286/0x7b0 net/ipv6/netfilter/ip6_tables.c:1778
ip6table_mangle_table_init+0x3d/0x60 net/ipv6/netfilter/ip6table_mangle.c:84
xt_find_table_lock+0x220/0x360 net/netfilter/x_tables.c:1259
xt_request_find_table_lock+0x22/0x100 net/netfilter/x_tables.c:1284
get_info net/ipv6/netfilter/ip6_tables.c:981 [inline]
do_ip6t_get_ctl+0x5e5/0x1100 net/ipv6/netfilter/ip6_tables.c:1670
nf_getsockopt+0x25e/0x280 net/netfilter/nf_sockopt.c:116
ipv6_getsockopt+0x212/0x2c0 net/ipv6/ipv6_sockglue.c:1512
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1459 [inline]
free_pcp_prepare mm/page_alloc.c:1509 [inline]
free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384
free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737
slab_alloc_node mm/slub.c:3398 [inline]
__kmem_cache_alloc_node+0x140/0x260 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:935 [inline]
__kmalloc+0xa0/0x240 mm/slab_common.c:949
kmalloc include/linux/slab.h:568 [inline]
kzalloc include/linux/slab.h:699 [inline]
tomoyo_encode2 security/tomoyo/realpath.c:45 [inline]
tomoyo_encode+0x27e/0x540 security/tomoyo/realpath.c:80
tomoyo_mount_acl security/tomoyo/mount.c:97 [inline]
tomoyo_mount_permission+0x31a/0x940 security/tomoyo/mount.c:237
security_sb_mount+0x83/0xb0 security/security.c:993
path_mount+0xb8/0x1010 fs/namespace.c:3335
do_mount fs/namespace.c:3406 [inline]
__do_sys_mount fs/namespace.c:3614 [inline]
__se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3591
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

Memory state around the buggy address:
ffff88807ee18180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807ee18200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807ee18280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807ee18300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807ee18380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---

syzbot

unread,
Aug 24, 2025, 5:03:35 AM8/24/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: c79648372d02 Linux 5.15.189
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10cb3062580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f3b1215b3cf4119f
dashboard link: https://syzkaller.appspot.com/bug?extid=ccf20f8a60140d349005
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12b0ba34580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12e167bc580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/fa511d2a8893/disk-c7964837.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f14b6c77bbb9/vmlinux-c7964837.xz
kernel image: https://storage.googleapis.com/syzbot-assets/388987ba15c6/bzImage-c7964837.xz

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

==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0xf7/0x7c60 kernel/locking/lockdep.c:4882
Read of size 8 at addr ffff88802842f8b8 by task syz.0.17/4477

CPU: 0 PID: 4477 Comm: syz.0.17 Not tainted 5.15.189-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
print_address_description+0x60/0x2d0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xdf/0x130 mm/kasan/report.c:451
__lock_acquire+0xf7/0x7c60 kernel/locking/lockdep.c:4882
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
remove_wait_queue+0x20/0x120 kernel/sched/wait.c:55
free_poll_entry fs/select.c:134 [inline]
poll_freewait+0x99/0x210 fs/select.c:143
do_sys_poll+0xda0/0x1100 fs/select.c:1015
__do_sys_ppoll fs/select.c:1120 [inline]
__se_sys_ppoll+0x1fc/0x260 fs/select.c:1100
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f74527e4be9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f7451e54038 EFLAGS: 00000246 ORIG_RAX: 000000000000010f
RAX: ffffffffffffffda RBX: 00007f7452a0bfa0 RCX: 00007f74527e4be9
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000200000000100
RBP: 00007f7452867e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f7452a0c038 R14: 00007f7452a0bfa0 R15: 00007ffd81b415e8
</TASK>

Allocated by task 1:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc mm/kasan/common.c:513 [inline]
__kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522
kmalloc include/linux/slab.h:604 [inline]
kzalloc include/linux/slab.h:735 [inline]
__comedi_device_postconfig_async drivers/comedi/drivers.c:664 [inline]
__comedi_device_postconfig drivers/comedi/drivers.c:721 [inline]
comedi_device_postconfig+0x496/0xc50 drivers/comedi/drivers.c:756
comedi_auto_config+0x265/0x3a0 drivers/comedi/drivers.c:1069
comedi_test_init+0x8f/0x130 drivers/comedi/drivers/comedi_test.c:834
do_one_initcall+0x1ee/0x680 init/main.c:1302
do_initcall_level+0x137/0x1f0 init/main.c:1375
do_initcalls+0x4b/0x90 init/main.c:1391
kernel_init_freeable+0x3ce/0x560 init/main.c:1615
kernel_init+0x19/0x1b0 init/main.c:1506
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Freed by task 4480:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0xea/0x170 mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kfree+0xef/0x2a0 mm/slub.c:4559
comedi_device_detach_cleanup drivers/comedi/drivers.c:172 [inline]
comedi_device_detach+0x35f/0x6e0 drivers/comedi/drivers.c:208
do_devconfig_ioctl drivers/comedi/comedi_fops.c:829 [inline]
comedi_unlocked_ioctl+0xbd0/0xe90 drivers/comedi/comedi_fops.c:2131
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff88802842f800
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 184 bytes inside of
256-byte region [ffff88802842f800, ffff88802842f900)
The buggy address belongs to the page:
page:ffffea0000a10b80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2842e
head:ffffea0000a10b80 order:1 compound_mapcount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888016841b40
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, ts 9700787042, free_ts 0
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
__alloc_pages+0x1e1/0x470 mm/page_alloc.c:5474
alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2031
alloc_slab_page mm/slub.c:1775 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xc0/0x4b0 mm/slub.c:1975
___slab_alloc+0x81e/0xdf0 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc_trace+0x1a5/0x2a0 mm/slub.c:3245
kmalloc include/linux/slab.h:604 [inline]
kzalloc include/linux/slab.h:735 [inline]
bus_add_driver+0xda/0x5a0 drivers/base/bus.c:604
driver_register+0x32d/0x430 drivers/base/driver.c:240
__hid_register_driver+0x126/0x170 drivers/hid/hid-core.c:2578
cmedia_init+0x1c/0x80 drivers/hid/hid-cmedia.c:229
do_one_initcall+0x1ee/0x680 init/main.c:1302
do_initcall_level+0x137/0x1f0 init/main.c:1375
do_initcalls+0x4b/0x90 init/main.c:1391
kernel_init_freeable+0x3ce/0x560 init/main.c:1615
kernel_init+0x19/0x1b0 init/main.c:1506
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
page_owner free stack trace missing

Memory state around the buggy address:
ffff88802842f780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802842f800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88802842f880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88802842f900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802842f980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---

syzbot

unread,
Aug 24, 2025, 5:10:35 AM8/24/25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 0bc96de781b4 Linux 6.1.148
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1230cef0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=5c8a5866886424a8
dashboard link: https://syzkaller.appspot.com/bug?extid=800e15dbad458bb691ea
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17ab3062580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17092c42580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/04c58ffc4a8a/disk-0bc96de7.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/01cad248945e/vmlinux-0bc96de7.xz
kernel image: https://storage.googleapis.com/syzbot-assets/fc5395191c77/bzImage-0bc96de7.xz

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

==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0xf7/0x7c50 kernel/locking/lockdep.c:4919
Read of size 8 at addr ffff88814a9956b8 by task syz.0.17/4424

CPU: 0 PID: 4424 Comm: syz.0.17 Not tainted 6.1.148-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:420
kasan_report+0x10b/0x140 mm/kasan/report.c:524
__lock_acquire+0xf7/0x7c50 kernel/locking/lockdep.c:4919
lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
remove_wait_queue+0x20/0x120 kernel/sched/wait.c:54
free_poll_entry fs/select.c:132 [inline]
poll_freewait+0x99/0x210 fs/select.c:141
do_sys_poll+0xe8a/0x11f0 fs/select.c:1013
__do_sys_ppoll fs/select.c:1118 [inline]
__se_sys_ppoll+0x1fc/0x260 fs/select.c:1098
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fefffd8ebe9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff000bd5038 EFLAGS: 00000246 ORIG_RAX: 000000000000010f
RAX: ffffffffffffffda RBX: 00007feffffb5fa0 RCX: 00007fefffd8ebe9
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000200000000100
RBP: 00007fefffe11e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007feffffb6038 R14: 00007feffffb5fa0 R15: 00007ffd2a8a16c8
</TASK>

Allocated by task 1:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
__comedi_device_postconfig_async drivers/comedi/drivers.c:666 [inline]
__comedi_device_postconfig drivers/comedi/drivers.c:723 [inline]
comedi_device_postconfig+0x496/0xc50 drivers/comedi/drivers.c:758
comedi_auto_config+0x265/0x3a0 drivers/comedi/drivers.c:1071
comedi_test_init+0x8f/0x127 drivers/comedi/drivers/comedi_test.c:832
do_one_initcall+0x214/0x7a0 init/main.c:1298
do_initcall_level+0x137/0x1e4 init/main.c:1371
do_initcalls+0x4b/0x8a init/main.c:1387
kernel_init_freeable+0x3fa/0x5ac init/main.c:1626
kernel_init+0x19/0x1b0 init/main.c:1514
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Freed by task 4425:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516
____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1750
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0xb6/0x1f0 mm/slub.c:3674
comedi_device_detach_cleanup drivers/comedi/drivers.c:171 [inline]
comedi_device_detach+0x35f/0x6e0 drivers/comedi/drivers.c:207
do_devconfig_ioctl drivers/comedi/comedi_fops.c:829 [inline]
comedi_unlocked_ioctl+0xb6b/0xf20 drivers/comedi/comedi_fops.c:2151
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff88814a995600
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 184 bytes inside of
256-byte region [ffff88814a995600, ffff88814a995700)

The buggy address belongs to the physical page:
page:ffffea00052a6500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14a994
head:ffffea00052a6500 order:1 compound_mapcount:0 compound_pincount:0
flags: 0x57ff00000010200(slab|head|node=1|zone=2|lastcpupid=0x7ff)
raw: 057ff00000010200 0000000000000000 dead000000000122 ffff888017441b40
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 11625821495, free_ts 0
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328
__alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614
alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2115
alloc_slab_page+0x5d/0x160 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x87/0x2c0 mm/slub.c:1992
___slab_alloc+0xbc6/0x1220 mm/slub.c:3180
__slab_alloc mm/slub.c:3279 [inline]
slab_alloc_node mm/slub.c:3364 [inline]
__kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3437
kmalloc_trace+0x26/0xe0 mm/slab_common.c:1026
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
bus_add_driver+0xda/0x5a0 drivers/base/bus.c:604
driver_register+0x32d/0x430 drivers/base/driver.c:246
__hid_register_driver+0x126/0x170 drivers/hid/hid-core.c:2910
do_one_initcall+0x214/0x7a0 init/main.c:1298
do_initcall_level+0x137/0x1e4 init/main.c:1371
do_initcalls+0x4b/0x8a init/main.c:1387
kernel_init_freeable+0x3fa/0x5ac init/main.c:1626
page_owner free stack trace missing

Memory state around the buggy address:
ffff88814a995580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88814a995600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88814a995680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88814a995700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88814a995780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---

syzbot

unread,
Sep 29, 2025, 12:23:04 AM9/29/25
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit d85fac8729c9acfd72368faff1d576ec585e5c8f
Author: Ian Abbott <abb...@mev.co.uk>
Date: Tue Jul 22 15:53:16 2025 +0000

comedi: fix race between polling and detaching

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=16975ae2580000
start commit: c79648372d02 Linux 5.15.189
git tree: linux-5.15.y
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: comedi: fix race between polling and detaching

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages