==================================================================
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 ffff88808f50e060 by task syz-executor.4/6909
CPU: 0 PID: 6909 Comm: syz-executor.4 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+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:__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 f8 6b fc 89 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 75 31 48 83 3d 06 50 c8 01 00 74 25 fb 66 0f 1f 44 00 00 01 00 00 00 e8 2b d9 1c f9 65 8b 05 74 e2 cd 77 85 c0 74 02 5d
RSP: 0018:ffffc900057f7b50 EFLAGS: 00000286
RAX: 1ffffffff13f8d7f RBX: ffff888062ab8580 RCX: 1ffffffff16b7a71
RDX: dffffc0000000000 RSI: 0000000000000002 RDI: 0000000000000000
RBP: ffff8880ae435e40 R08: 0000000000000001 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880ae435e40
R13: ffff8880a8c06080 R14: ffff88809343ea40 R15: 0000000000000000
finish_lock_switch kernel/sched/core.c:3517 [inline]
finish_task_switch+0x150/0x790 kernel/sched/core.c:3617
context_switch kernel/sched/core.c:3781 [inline]
__schedule+0xed1/0x2280 kernel/sched/core.c:4527
schedule+0xd0/0x2a0 kernel/sched/core.c:4602
freezable_schedule include/linux/freezer.h:172 [inline]
do_nanosleep+0x222/0x650 kernel/time/hrtimer.c:1883
hrtimer_nanosleep+0x1f9/0x430 kernel/time/hrtimer.c:1936
__do_sys_nanosleep kernel/time/hrtimer.c:1970 [inline]
__se_sys_nanosleep kernel/time/hrtimer.c:1957 [inline]
__x64_sys_nanosleep+0x1dc/0x260 kernel/time/hrtimer.c:1957
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45c641
Code: 75 14 b8 23 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 64 cd fb ff c3 48 83 ec 08 e8 ea 46 00 00 48 89 04 24 b8 23 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 33 47 00 00 48 89 d0 48 83 c4 08 48 3d 01
RSP: 002b:00007ffe028a2bf0 EFLAGS: 00000293 ORIG_RAX: 0000000000000023
RAX: ffffffffffffffda RBX: 00000000000f6ae2 RCX: 000000000045c641
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007ffe028a2c00
RBP: 00000000000006db R08: 0000000000000000 R09: 0000000002941940
R10: 0000000000000000 R11: 0000000000000293 R12: 000000000000000f
R13: 00007ffe028a2c50 R14: 00000000000f69f5 R15: 00007ffe028a2c60
Allocated by task 7708:
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 7708:
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 ffff88808f50e000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 96 bytes inside of
4096-byte region [ffff88808f50e000, ffff88808f50f000)
The buggy address belongs to the page:
page:00000000d7609c4c refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8f50e
head:00000000d7609c4c order:1 compound_mapcount:0
flags: 0xfffe0000010200(slab|head)
raw: 00fffe0000010200 ffffea0001376a88 ffffea0002452e08 ffff8880aa040900
raw: 0000000000000000 ffff88808f50e000 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88808f50df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88808f50df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88808f50e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88808f50e080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88808f50e100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================