==================================================================
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 ffff88808b3de860 by task systemd-udevd/3921
CPU: 0 PID: 3921 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:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:169 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x4b/0x80 kernel/locking/spinlock.c:199
Code: c0 98 3c b6 89 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 75 31 48 83 3d 76 96 bd 01 00 74 25 fb 66 0f 1f 44 00 00 01 00 00 00 e8 fb 12 57 f9 65 8b 05 44 58 09 78 85 c0 74 02 5d
RSP: 0018:ffffc90003a67380 EFLAGS: 00000282
RAX: 1ffffffff136c793 RBX: ffff8880a22d8500 RCX: 1ffffffff1565171
RDX: dffffc0000000000 RSI: 0000000000000002 RDI: 0000000000000000
RBP: ffff8880ae635e40 R08: 0000000000000001 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880ae635e40
R13: ffff888058ff6380 R14: 0000000000000000 R15: 0000000000000001
finish_lock_switch kernel/sched/core.c:3517 [inline]
finish_task_switch+0x147/0x750 kernel/sched/core.c:3617
context_switch kernel/sched/core.c:3781 [inline]
__schedule+0xeb1/0x2230 kernel/sched/core.c:4527
preempt_schedule_irq+0xbf/0x1b0 kernel/sched/core.c:4785
irqentry_exit_cond_resched kernel/entry/common.c:333 [inline]
irqentry_exit_cond_resched kernel/entry/common.c:325 [inline]
irqentry_exit+0x65/0x90 kernel/entry/common.c:363
asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:581
RIP: 0010:tomoyo_domain_quota_is_ok+0x421/0x550 security/tomoyo/util.c:1041
Code: e8 34 83 0d fe 48 8d 7d 1a 48 89 f8 48 89 fa 48 c1 e8 03 83 e2 07 42 0f b6 04 30 38 d0 7f ad 84 c0 74 a9 e8 51 e5 4d fe eb a2 0a 83 0d fe 48 8d 7d 1a 48 89 f8 48 c1 e8 03 42 0f b6 14 30 48
RSP: 0018:ffffc90003a675b0 EFLAGS: 00000293
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff8366eee9
RDX: 0000000000000000 RSI: ffff8880a22d8500 RDI: 0000000000000001
RBP: ffff888099d74400 R08: 0000000000000001 R09: ffffffff8cb2b747
R10: 0000000000000008 R11: 0000000000000001 R12: 0000000000000000
R13: 0000000000000262 R14: dffffc0000000000 R15: 0000000000000000
tomoyo_supervisor+0x2d4/0xeb0 security/tomoyo/common.c:2089
tomoyo_audit_path_log security/tomoyo/file.c:168 [inline]
tomoyo_path_permission security/tomoyo/file.c:587 [inline]
tomoyo_path_permission+0x25c/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:0x7fa8b68a79b1
Code: f7 d8 bf ff ff ff ff 64 89 02 eb cb 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 80 3f 00 74 1b be 00 08 09 00 b8 02 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 1f 89 c7 e9 00 ff ff ff 48 8b 05 b1 54 2e 00
RSP: 002b:00007ffe4cb19ec8 EFLAGS: 00000202 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 000055f079c697f0 RCX: 00007fa8b68a79b1
RDX: 00000000000000fd RSI: 0000000000090800 RDI: 000055f079c39000
RBP: 00007fa8b7a5c710 R08: 000055f079c397a0 R09: 0000000000001010
R10: 00007fa8b6b8db58 R11: 0000000000000202 R12: 0000000000000000
R13: 000055f079c39000 R14: 00000000000000fd R15: 000055f079c39000
Allocated by task 9229:
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 9229:
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 ffff88808b3de800
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 96 bytes inside of
1024-byte region [ffff88808b3de800, ffff88808b3dec00)
The buggy address belongs to the page:
page:00000000c042df3e refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8b3de
flags: 0xfffe0000000200(slab)
raw: 00fffe0000000200 ffffea0002548588 ffffea000236ae88 ffff8880aa040700
raw: 0000000000000000 ffff88808b3de000 0000000100000002 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88808b3de700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88808b3de780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88808b3de800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88808b3de880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88808b3de900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================