==================================================================
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:2161 [inline]
BUG: KASAN: use-after-free in sock_def_write_space+0x609/0x630 net/core/sock.c:2925
Read of size 8 at addr ffff888031fa8b00 by task kworker/u4:6/10497
CPU: 1 PID: 10497 Comm: kworker/u4:6 Not tainted 5.10.0-rc7-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:2161 [inline]
sock_def_write_space+0x609/0x630 net/core/sock.c:2925
sock_wfree+0x1cc/0x240 net/core/sock.c:2052
skb_release_head_state+0x9f/0x250 net/core/skbuff.c:656
skb_release_all net/core/skbuff.c:667 [inline]
_kfree_skb_defer net/core/skbuff.c:875 [inline]
napi_consume_skb+0x200/0x480 net/core/skbuff.c:919
free_old_xmit_skbs+0xe4/0x270 drivers/net/virtio_net.c:1394
virtnet_poll_cleantx drivers/net/virtio_net.c:1437 [inline]
virtnet_poll+0x325/0xd90 drivers/net/virtio_net.c:1454
napi_poll net/core/dev.c:6787 [inline]
net_rx_action+0x461/0xe10 net/core/dev.c:6870
__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:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:169 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:199
Code: 0f 1f 44 00 00 55 48 8b 74 24 08 48 89 fd 48 83 c7 18 e8 fe 53 6a f8 48 89 ef e8 86 08 6b f8 e8 11 f2 89 f8 fb bf 01 00 00 00 96 74 5f f8 65 8b 05 cf 1c 16 77 85 c0 74 02 5d c3 e8 3b 72 14
RSP: 0018:ffffc90001b57a08 EFLAGS: 00000202
RAX: 00000000000b0af7 RBX: ffff88801f6db480 RCX: ffffffff8155ab07
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000001
RBP: ffff8880b9f349c0 R08: 0000000000000001 R09: ffffffff8ebb872f
R10: fffffbfff1d770e5 R11: 0000000000000000 R12: ffff8880b9f349c0
R13: ffff88802529cec0 R14: 0000000000000000 R15: 0000000000000001
finish_lock_switch kernel/sched/core.c:3518 [inline]
finish_task_switch+0x150/0x7a0 kernel/sched/core.c:3618
context_switch kernel/sched/core.c:3782 [inline]
__schedule+0x89b/0x2130 kernel/sched/core.c:4528
preempt_schedule_notrace+0x5b/0xd0 kernel/sched/core.c:4760
preempt_schedule_notrace_thunk+0x16/0x31 arch/x86/entry/thunk_64.S:41
rcu_read_unlock_sched_notrace include/linux/rcupdate.h:779 [inline]
trace_lock_release include/trace/events/lock.h:58 [inline]
lock_release+0x533/0x710 kernel/locking/lockdep.c:5448
rcu_lock_release include/linux/rcupdate.h:253 [inline]
rcu_read_unlock include/linux/rcupdate.h:695 [inline]
batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:408 [inline]
batadv_nc_worker+0x7a3/0xe50 net/batman-adv/network-coding.c:715
process_one_work+0x933/0x15a0 kernel/workqueue.c:2272
worker_thread+0x64c/0x1120 kernel/workqueue.c:2418
kthread+0x3b1/0x4a0 kernel/kthread.c:292
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296
Allocated by task 10729:
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:515 [inline]
slab_alloc_node mm/slub.c:2891 [inline]
slab_alloc mm/slub.c:2899 [inline]
kmem_cache_alloc+0x1c6/0x440 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:1369
sock_create net/socket.c:1456 [inline]
__sys_socket+0xef/0x200 net/socket.c:1498
__do_sys_socket net/socket.c:1507 [inline]
__se_sys_socket net/socket.c:1505 [inline]
__x64_sys_socket+0x6f/0xb0 net/socket.c:1505
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Freed by task 10:
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 ffff888031fa8a80
which belongs to the cache sock_inode_cache of size 1216
The buggy address is located 128 bytes inside of
1216-byte region [ffff888031fa8a80, ffff888031fa8f40)
The buggy address belongs to the page:
page:000000005fd4024a refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x31fa8
head:000000005fd4024a order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff8881406f3b40
raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff888031fa8a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888031fa8a80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888031fa8b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888031fa8b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888031fa8c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================