================================================================== BUG: KASAN: use-after-free in __lock_acquire+0xf7/0x7c60 kernel/locking/lockdep.c:4882 Read of size 8 at addr ffff88807835e8b8 by task syz.0.18/4354 CPU: 1 PID: 4354 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: 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:0x7f2f2ea7cb69 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:00007f2f2dcec038 EFLAGS: 00000246 ORIG_RAX: 000000000000010e RAX: ffffffffffffffda RBX: 00007f2f2eca3fa0 RCX: 00007f2f2ea7cb69 RDX: 0000000000000000 RSI: 0000200000000280 RDI: 0000000000000040 RBP: 00007f2f2eaffdf1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000200000000180 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f2f2eca3fa0 R15: 00007ffc9ac0b338 Allocated by task 4352: 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 4355: 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 ffff88807835e800 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 184 bytes inside of 256-byte region [ffff88807835e800, ffff88807835e900) The buggy address belongs to the page: page:ffffea0001e0d780 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7835e head:ffffea0001e0d780 order:1 compound_mapcount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888016841b40 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 4285, ts 94211456672, free_ts 94085964028 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] __kmalloc_track_caller+0x1cb/0x330 mm/slub.c:4925 kmemdup+0x22/0x50 mm/util.c:128 ip6t_register_table+0x28c/0x7e0 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+0x5f8/0x1090 net/ipv6/netfilter/ip6_tables.c:1670 nf_getsockopt+0x25e/0x280 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x442/0x2000 net/ipv6/ipv6_sockglue.c:1492 tcp_getsockopt+0x1e3/0x2390 net/ipv4/tcp.c:4313 __sys_getsockopt+0x1b0/0x230 net/socket.c:2247 __do_sys_getsockopt net/socket.c:2262 [inline] __se_sys_getsockopt net/socket.c:2259 [inline] __x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2259 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] __kmalloc_node+0x15a/0x3b0 mm/slub.c:4451 kmalloc_node include/linux/slab.h:627 [inline] kvmalloc_node+0x84/0x130 mm/util.c:619 kvmalloc include/linux/mm.h:805 [inline] seq_buf_alloc fs/seq_file.c:38 [inline] seq_read_iter+0x1f6/0xd50 fs/seq_file.c:210 call_read_iter include/linux/fs.h:2166 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0x725/0xcf0 fs/read_write.c:485 ksys_read+0x14d/0x250 fs/read_write.c:623 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 Memory state around the buggy address: ffff88807835e780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807835e800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807835e880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807835e900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807835e980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================