==================================================================
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 ffff88809abc0060 by task syz-executor.4/6872
CPU: 1 PID: 6872 Comm: syz-executor.4 Not tainted 5.9.0-rc1-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+0x18f/0x20d 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+0x5c7/0x1190 kernel/rcu/tree.c:2656
__do_softirq+0x2de/0xa24 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+0x1f3/0x230 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:check_kcov_mode kernel/kcov.c:163 [inline]
RIP: 0010:write_comp_data+0x13/0x80 kernel/kcov.c:218
Code: 48 8b 80 38 14 00 00 c3 0f 1f 44 00 00 66 2e 0f 1f 84 00 00 00 00 00 49 89 f2 65 8b 05 d6 9a 8d 7e 65 48 8b 34 25 c0 fe 01 00 00 01 ff 00 74 0f f6 c4 01 74 59 8b 86 44 14 00 00 85 c0 74 4f
RSP: 0018:ffffc9000557f300 EFLAGS: 00000246
RAX: 0000000080000000 RBX: 0000000000000001 RCX: ffffffff8180394c
RDX: 0000000000000001 RSI: ffff88806232a480 RDI: 0000000000000005
RBP: 000000000045b530 R08: 0000000000000000 R09: ffffffff8c5fc9e7
R10: 0000000000000000 R11: 0000000000000001 R12: ffffc9000557f400
R13: 0000000000000000 R14: ffff88806232a480 R15: 0000000000000060
rcu_read_unlock include/linux/rcupdate.h:684 [inline]
is_bpf_text_address+0x8c/0x160 kernel/bpf/core.c:706
kernel_text_address kernel/extable.c:151 [inline]
kernel_text_address+0xbd/0xf0 kernel/extable.c:120
__kernel_text_address+0x9/0x30 kernel/extable.c:105
unwind_get_return_address arch/x86/kernel/unwind_orc.c:317 [inline]
unwind_get_return_address+0x51/0x90 arch/x86/kernel/unwind_orc.c:312
arch_stack_walk+0x97/0xf0 arch/x86/kernel/stacktrace.c:26
stack_trace_save+0x8c/0xc0 kernel/stacktrace.c:123
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
slab_post_alloc_hook mm/slab.h:518 [inline]
slab_alloc mm/slab.c:3312 [inline]
__do_kmalloc mm/slab.c:3653 [inline]
__kmalloc+0x170/0x320 mm/slab.c:3664
kmalloc include/linux/slab.h:559 [inline]
kzalloc include/linux/slab.h:666 [inline]
tomoyo_encode2.part.0+0xe9/0x3a0 security/tomoyo/realpath.c:45
tomoyo_encode2 security/tomoyo/realpath.c:31 [inline]
tomoyo_encode+0x28/0x50 security/tomoyo/realpath.c:80
tomoyo_realpath_from_path+0x186/0x620 security/tomoyo/realpath.c:288
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_check_open_permission+0x272/0x380 security/tomoyo/file.c:771
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:0x45b530
Code: 31 c0 e9 45 ff ff ff 0f 1f 00 80 3f 00 0f 84 f7 00 00 00 55 53 b9 02 00 00 00 be 00 08 09 00 89 c8 48 81 ec 98 00 00 00 0f 05 <48> 3d 00 f0 ff ff 48 89 c3 0f 87 e9 00 00 00 85 db 0f 88 2f 01 00
RSP: 002b:00007ffd4d9875b0 EFLAGS: 00000202 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 000000000004d5be RCX: 000000000045b530
RDX: 000000000000000c RSI: 0000000000090800 RDI: 00007ffd4d988790
RBP: 00000000000002dc R08: 0000000000000000 R09: 000000000232b940
R10: 0000000000000000 R11: 0000000000000202 R12: 00007ffd4d988790
R13: 00007ffd4d988780 R14: 0000000000000000 R15: 00007ffd4d988790
Allocated by task 15435:
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:750 [inline]
kvzalloc include/linux/mm.h:758 [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 15435:
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+0x103/0x2c0 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 ffff88809abc0000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 96 bytes inside of
1024-byte region [ffff88809abc0000, ffff88809abc0400)
The buggy address belongs to the page:
page:00000000425472d9 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x9abc0
flags: 0xfffe0000000200(slab)
raw: 00fffe0000000200 ffffea0002976148 ffffea0002475ac8 ffff8880aa040700
raw: 0000000000000000 ffff88809abc0000 0000000100000002 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88809abbff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88809abbff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88809abc0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88809abc0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88809abc0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================