================================================================== BUG: KASAN: use-after-free in instrument_atomic_write include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in atomic_fetch_sub_release include/asm-generic/atomic-instrumented.h:220 [inline] BUG: KASAN: use-after-free in refcount_sub_and_test include/linux/refcount.h:266 [inline] BUG: KASAN: use-after-free in refcount_dec_and_test include/linux/refcount.h:294 [inline] BUG: KASAN: use-after-free in xp_put_pool+0x2c/0x1e0 net/xdp/xsk_buff_pool.c:262 Write of size 4 at addr ffff88804070c060 by task systemd-udevd/3921 CPU: 1 PID: 3921 Comm: systemd-udevd Not tainted 5.9.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x198/0x1fd lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 check_memory_region_inline mm/kasan/generic.c:186 [inline] check_memory_region+0x13d/0x180 mm/kasan/generic.c:192 instrument_atomic_write include/linux/instrumented.h:71 [inline] atomic_fetch_sub_release include/asm-generic/atomic-instrumented.h:220 [inline] refcount_sub_and_test include/linux/refcount.h:266 [inline] refcount_dec_and_test include/linux/refcount.h:294 [inline] xp_put_pool+0x2c/0x1e0 net/xdp/xsk_buff_pool.c:262 xsk_destruct+0x7d/0xa0 net/xdp/xsk.c:1138 __sk_destruct+0x4b/0x860 net/core/sock.c:1764 rcu_do_batch kernel/rcu/tree.c:2428 [inline] rcu_core+0x5ca/0x1130 kernel/rcu/tree.c:2656 __do_softirq+0x1f8/0xb23 kernel/softirq.c:298 asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:706 __run_on_irqstack arch/x86/include/asm/irq_stack.h:22 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:48 [inline] do_softirq_own_stack+0x9d/0xd0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu kernel/softirq.c:423 [inline] irq_exit_rcu+0x235/0x280 kernel/softirq.c:435 sysvec_apic_timer_interrupt+0x51/0xf0 arch/x86/kernel/apic/apic.c:1091 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:581 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:770 [inline] RIP: 0010:lock_acquire+0x27b/0xaf0 kernel/locking/lockdep.c:5032 Code: ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 0f 85 1d 07 00 00 48 83 3d 98 51 a0 08 00 0f 84 73 05 00 00 4c 89 ff 57 9d <0f> 1f 44 00 00 48 b8 00 00 00 00 00 fc ff df 48 03 44 24 08 48 c7 RSP: 0018:ffffc9000116f850 EFLAGS: 00000286 RAX: 1ffffffff13f8d7d RBX: ffff8880a45340c0 RCX: 0000000000000001 RDX: dffffc0000000000 RSI: e668264dc84383e6 RDI: 0000000000000286 RBP: ffffffff8a068400 R08: 0000000000000000 R09: ffffffff8d0fd9e7 R10: fffffbfff1a1fb3c R11: 0000000000000000 R12: 0000000000000002 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000286 rcu_lock_acquire include/linux/rcupdate.h:241 [inline] rcu_read_lock include/linux/rcupdate.h:634 [inline] __d_lookup+0x88/0x6f0 fs/dcache.c:2386 lookup_fast+0x2d0/0x6c0 fs/namei.c:1502 walk_component+0xc6/0x6a0 fs/namei.c:1856 lookup_last fs/namei.c:2309 [inline] path_lookupat+0x1ba/0x830 fs/namei.c:2333 filename_lookup+0x19f/0x560 fs/namei.c:2366 user_path_at include/linux/namei.h:59 [inline] vfs_statx+0x14e/0x390 fs/stat.c:202 vfs_lstat include/linux/fs.h:3178 [inline] __do_sys_newlstat+0x91/0x110 fs/stat.c:374 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7ffb45305335 Code: 69 db 2b 00 64 c7 00 16 00 00 00 b8 ff ff ff ff c3 0f 1f 40 00 83 ff 01 48 89 f0 77 30 48 89 c7 48 89 d6 b8 06 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 03 f3 c3 90 48 8b 15 31 db 2b 00 f7 d8 64 89 RSP: 002b:00007ffd42e304c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000006 RAX: ffffffffffffffda RBX: 000056159279e130 RCX: 00007ffb45305335 RDX: 00007ffd42e30500 RSI: 00007ffd42e30500 RDI: 000056159279d130 RBP: 00007ffd42e305c0 R08: 00007ffb455c4178 R09: 0000000000001010 R10: 00007ffb455c3b58 R11: 0000000000000246 R12: 000056159279d130 R13: 000056159279d15e R14: 00005615927b86a7 R15: 00005615927b86ae Allocated by task 1523: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461 kmalloc_node include/linux/slab.h:577 [inline] kvmalloc_node+0x61/0xf0 mm/util.c:574 kvmalloc include/linux/mm.h:757 [inline] kvzalloc include/linux/mm.h:765 [inline] xp_create_and_assign_umem+0x58/0x8d0 net/xdp/xsk_buff_pool.c:54 xsk_bind+0x9a0/0xed0 net/xdp/xsk.c:709 __sys_bind+0x1e9/0x250 net/socket.c:1656 __do_sys_bind net/socket.c:1667 [inline] __se_sys_bind net/socket.c:1665 [inline] __x64_sys_bind+0x6f/0xb0 net/socket.c:1665 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 1523: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xd8/0x120 mm/kasan/common.c:422 __cache_free mm/slab.c:3418 [inline] kfree+0x10e/0x2b0 mm/slab.c:3756 kvfree+0x42/0x50 mm/util.c:603 xp_destroy net/xdp/xsk_buff_pool.c:44 [inline] xp_destroy+0x45/0x60 net/xdp/xsk_buff_pool.c:38 xsk_bind+0xbdd/0xed0 net/xdp/xsk.c:719 __sys_bind+0x1e9/0x250 net/socket.c:1656 __do_sys_bind net/socket.c:1667 [inline] __se_sys_bind net/socket.c:1665 [inline] __x64_sys_bind+0x6f/0xb0 net/socket.c:1665 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88804070c000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 96 bytes inside of 4096-byte region [ffff88804070c000, ffff88804070d000) The buggy address belongs to the page: page:00000000942111f2 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4070c head:00000000942111f2 order:1 compound_mapcount:0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea00013dc308 ffffea00014e0208 ffff8880aa040900 raw: 0000000000000000 ffff88804070c000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88804070bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804070bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88804070c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804070c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804070c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================