==================================================================
BUG: KASAN: use-after-free in list_empty include/linux/list.h:282 [inline]
BUG: KASAN: use-after-free in waitqueue_active include/linux/wait.h:128 [inline]
BUG: KASAN: use-after-free in wq_has_sleeper include/linux/wait.h:162 [inline]
BUG: KASAN: use-after-free in skwq_has_sleeper include/net/sock.h:2141 [inline]
BUG: KASAN: use-after-free in sock_def_write_space+0x609/0x630 net/core/sock.c:2906
Read of size 8 at addr ffff88806158f500 by task kworker/u4:2/26
CPU: 0 PID: 26 Comm: kworker/u4:2 Not tainted 5.10.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: bat_events batadv_nc_worker
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x107/0x163 lib/dump_stack.c:118
print_address_description.constprop.0.cold+0xae/0x4c8 mm/kasan/report.c:385
__kasan_report mm/kasan/report.c:545 [inline]
kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562
list_empty include/linux/list.h:282 [inline]
waitqueue_active include/linux/wait.h:128 [inline]
wq_has_sleeper include/linux/wait.h:162 [inline]
skwq_has_sleeper include/net/sock.h:2141 [inline]
sock_def_write_space+0x609/0x630 net/core/sock.c:2906
sock_wfree+0x1cc/0x240 net/core/sock.c:2033
skb_release_head_state+0x9f/0x250 net/core/skbuff.c:651
skb_release_all net/core/skbuff.c:662 [inline]
_kfree_skb_defer net/core/skbuff.c:870 [inline]
napi_consume_skb+0x134/0x390 net/core/skbuff.c:912
free_old_xmit_skbs+0xe4/0x270 drivers/net/virtio_net.c:1394
virtnet_poll_tx+0x1e9/0x370 drivers/net/virtio_net.c:1521
napi_poll net/core/dev.c:6763 [inline]
net_rx_action+0x4dc/0x1100 net/core/dev.c:6833
__do_softirq+0x2a0/0x9f6 kernel/softirq.c:298
asm_call_irq_on_stack+0xf/0x20
__run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline]
run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline]
do_softirq_own_stack+0xaa/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+0x132/0x200 kernel/softirq.c:435
common_interrupt+0xa3/0x200 arch/x86/kernel/irq.c:239
asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:622
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/irqflags.h:85 [inline]
RIP: 0010:lock_acquire kernel/locking/lockdep.c:5439 [inline]
RIP: 0010:lock_acquire+0x2cd/0x8c0 kernel/locking/lockdep.c:5401
Code: 48 c7 c7 40 5e 4b 89 48 83 c4 20 e8 dd 86 8e 07 b8 ff ff ff ff 65 0f c1 05 f0 c4 ab 7e 83 f8 01 0f 85 09 04 00 00 ff 34 24 9d 37 fe ff ff 65 ff 05 57 b4 ab 7e 48 8b 05 90 92 82 0b e8 6b 7b
RSP: 0018:ffffc90000e1fba0 EFLAGS: 00000246
RAX: 0000000000000001 RBX: 1ffff920001c3f76 RCX: 00000000839aabcc
RDX: 1ffff110021ec469 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff8ebad667
R10: fffffbfff1d75acc R11: 0000000000000000 R12: 0000000000000002
R13: ffffffff8b337160 R14: 0000000000000000 R15: 0000000000000000
rcu_lock_acquire include/linux/rcupdate.h:248 [inline]
rcu_read_lock include/linux/rcupdate.h:641 [inline]
batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:407 [inline]
batadv_nc_worker+0x12d/0xe50 net/batman-adv/network-coding.c:718
process_one_work+0x933/0x15a0 kernel/workqueue.c:2272
worker_thread+0x64c/0x1120 kernel/workqueue.c:2418
kthread+0x3af/0x4a0 kernel/kthread.c:292
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296
Allocated by task 17311:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
kasan_set_track mm/kasan/common.c:56 [inline]
__kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461
slab_post_alloc_hook mm/slab.h:526 [inline]
slab_alloc_node mm/slub.c:2891 [inline]
slab_alloc mm/slub.c:2899 [inline]
kmem_cache_alloc+0x117/0x460 mm/slub.c:2904
sock_alloc_inode+0x18/0x1c0 net/socket.c:253
alloc_inode+0x61/0x230 fs/inode.c:234
new_inode_pseudo+0x14/0xe0 fs/inode.c:930
sock_alloc+0x3c/0x260 net/socket.c:573
__sock_create+0xb9/0x780 net/socket.c:1391
sock_create net/socket.c:1478 [inline]
__sys_socket+0xef/0x200 net/socket.c:1520
__do_sys_socket net/socket.c:1529 [inline]
__se_sys_socket net/socket.c:1527 [inline]
__x64_sys_socket+0x6f/0xb0 net/socket.c:1527
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Freed by task 26:
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+0x102/0x140 mm/kasan/common.c:422
slab_free_hook mm/slub.c:1544 [inline]
slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1577
slab_free mm/slub.c:3142 [inline]
kmem_cache_free+0x82/0x350 mm/slub.c:3158
i_callback+0x3f/0x70 fs/inode.c:223
rcu_do_batch kernel/rcu/tree.c:2476 [inline]
rcu_core+0x5df/0xe80 kernel/rcu/tree.c:2711
__do_softirq+0x2a0/0x9f6 kernel/softirq.c:298
Last call_rcu():
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
kasan_record_aux_stack+0xc0/0xf0 mm/kasan/generic.c:346
__call_rcu kernel/rcu/tree.c:2953 [inline]
call_rcu+0xbb/0x700 kernel/rcu/tree.c:3027
destroy_inode+0x129/0x1b0 fs/inode.c:289
iput_final fs/inode.c:1654 [inline]
iput.part.0+0x3fe/0x820 fs/inode.c:1680
iput+0x58/0x70 fs/inode.c:1670
dentry_unlink_inode+0x2b1/0x3d0 fs/dcache.c:374
__dentry_kill+0x3c0/0x640 fs/dcache.c:579
dentry_kill fs/dcache.c:705 [inline]
dput+0x725/0xbc0 fs/dcache.c:878
__fput+0x3ab/0x920 fs/file_table.c:294
task_work_run+0xdd/0x190 kernel/task_work.c:151
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_user_mode_loop kernel/entry/common.c:164 [inline]
exit_to_user_mode_prepare+0x17e/0x1a0 kernel/entry/common.c:191
syscall_exit_to_user_mode+0x38/0x260 kernel/entry/common.c:266
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Second to last call_rcu():
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
kasan_record_aux_stack+0xc0/0xf0 mm/kasan/generic.c:346
__call_rcu kernel/rcu/tree.c:2953 [inline]
call_rcu+0xbb/0x700 kernel/rcu/tree.c:3027
destroy_inode+0x129/0x1b0 fs/inode.c:289
iput_final fs/inode.c:1654 [inline]
iput.part.0+0x3fe/0x820 fs/inode.c:1680
iput+0x58/0x70 fs/inode.c:1670
dentry_unlink_inode+0x2b1/0x3d0 fs/dcache.c:374
__dentry_kill+0x3c0/0x640 fs/dcache.c:579
dentry_kill fs/dcache.c:705 [inline]
dput+0x725/0xbc0 fs/dcache.c:878
__fput+0x3ab/0x920 fs/file_table.c:294
task_work_run+0xdd/0x190 kernel/task_work.c:151
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_user_mode_loop kernel/entry/common.c:164 [inline]
exit_to_user_mode_prepare+0x17e/0x1a0 kernel/entry/common.c:191
syscall_exit_to_user_mode+0x38/0x260 kernel/entry/common.c:266
entry_SYSCALL_64_after_hwframe+0x44/0xa9
The buggy address belongs to the object at ffff88806158f480
which belongs to the cache sock_inode_cache of size 1216
The buggy address is located 128 bytes inside of
1216-byte region [ffff88806158f480, ffff88806158f940)
The buggy address belongs to the page:
page:000000009b5c6cec refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6158c
head:000000009b5c6cec order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head)
raw: 00fff00000010200 ffffea0000771b00 0000000600000006 ffff88814085aa00
raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88806158f400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88806158f480: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88806158f500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88806158f580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88806158f600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================