================================================================== 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 ffff888094666060 by task systemd-udevd/25908 CPU: 1 PID: 25908 Comm: systemd-udevd Not tainted 5.9.0-rc3-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+0x1f7/0xa91 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:__sanitizer_cov_trace_pc+0x30/0x60 kernel/kcov.c:197 Code: fe 01 00 65 8b 05 20 8a 8d 7e a9 00 01 ff 00 48 8b 34 24 74 0f f6 c4 01 74 35 8b 82 44 14 00 00 85 c0 74 2b 8b 82 20 14 00 00 <83> f8 02 75 20 48 8b 8a 28 14 00 00 8b 92 24 14 00 00 48 8b 01 48 RSP: 0018:ffffc9000755f6f0 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffff8880a7235a98 RCX: ffffffff8365c792 RDX: ffff88805696e380 RSI: ffffffff8366e5a5 RDI: ffffc9000755f838 RBP: ffffc9000755f838 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000001 R12: ffff88809aa84180 R13: ffffc9000755f838 R14: 0000000000000000 R15: ffff88809aa841a0 tomoyo_path_matches_pattern+0x15/0x280 security/tomoyo/util.c:918 tomoyo_compare_name_union security/tomoyo/file.c:87 [inline] tomoyo_compare_name_union security/tomoyo/file.c:82 [inline] tomoyo_check_path_acl security/tomoyo/file.c:260 [inline] tomoyo_check_path_acl+0x164/0x1f0 security/tomoyo/file.c:252 tomoyo_check_acl+0x138/0x410 security/tomoyo/domain.c:175 tomoyo_path_permission security/tomoyo/file.c:586 [inline] tomoyo_path_permission+0x1f5/0x360 security/tomoyo/file.c:573 tomoyo_check_open_permission+0x33e/0x380 security/tomoyo/file.c:777 tomoyo_file_open security/tomoyo/tomoyo.c:313 [inline] tomoyo_file_open+0xa3/0xd0 security/tomoyo/tomoyo.c:308 security_file_open+0x52/0x4f0 security/security.c:1574 do_dentry_open+0x358/0x11b0 fs/open.c:804 do_open fs/namei.c:3251 [inline] path_openat+0x1b9a/0x2730 fs/namei.c:3368 do_filp_open+0x17e/0x3c0 fs/namei.c:3395 do_sys_openat2+0x16d/0x420 fs/open.c:1168 do_sys_open fs/open.c:1184 [inline] __do_sys_open fs/open.c:1192 [inline] __se_sys_open fs/open.c:1188 [inline] __x64_sys_open+0x119/0x1c0 fs/open.c:1188 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f9b8ea0f840 Code: 73 01 c3 48 8b 0d 68 77 20 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 89 bb 20 00 00 75 10 b8 02 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 1e f6 ff ff 48 89 04 24 RSP: 002b:00007ffd1c3bce38 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00005585e8000d20 RCX: 00007f9b8ea0f840 RDX: 00005585e7aaafe3 RSI: 00000000000a0800 RDI: 00005585e7ff0370 RBP: 00007ffd1c3bcfb0 R08: 00005585e7aaa670 R09: 0000000000000010 R10: 00005585e7aaad0c R11: 0000000000000246 R12: 00007ffd1c3bcf00 R13: 00005585e7ff0580 R14: 0000000000000003 R15: 000000000000000e Allocated by task 25902: 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:755 [inline] kvzalloc include/linux/mm.h:763 [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 25902: 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 Last call_rcu(): kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_record_aux_stack+0x82/0xb0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2894 [inline] call_rcu+0x15e/0x7b0 kernel/rcu/tree.c:2968 qdisc_put+0xcd/0xe0 net/sched/sch_generic.c:987 notify_and_destroy net/sched/sch_api.c:1005 [inline] qdisc_graft+0xcb1/0x1240 net/sched/sch_api.c:1077 tc_modify_qdisc+0xb4b/0x1990 net/sched/sch_api.c:1673 rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5563 netlink_rcv_skb+0x15a/0x430 net/netlink/af_netlink.c:2470 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:671 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2353 ___sys_sendmsg+0xf3/0x170 net/socket.c:2407 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2440 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 ffff888094666000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 96 bytes inside of 1024-byte region [ffff888094666000, ffff888094666400) The buggy address belongs to the page: page:00000000619e7f99 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x94666 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea000239cbc8 ffffea00023b8748 ffff8880aa040700 raw: 0000000000000000 ffff888094666000 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888094665f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888094665f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888094666000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888094666080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888094666100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================