==================================================================
BUG: KASAN: use-after-free in list_empty include/linux/list.h:284 [inline]
BUG: KASAN: use-after-free in waitqueue_active include/linux/wait.h:129 [inline]
BUG: KASAN: use-after-free in wq_has_sleeper include/linux/wait.h:163 [inline]
BUG: KASAN: use-after-free in skwq_has_sleeper include/net/sock.h:2263 [inline]
BUG: KASAN: use-after-free in sock_def_write_space+0x62e/0x640 net/core/sock.c:3153
Read of size 8 at addr ffff8880229fc880 by task swapper/3/0
CPU: 3 PID: 0 Comm: swapper/3 Not tainted 5.16.0-rc7-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:247
__kasan_report mm/kasan/report.c:433 [inline]
kasan_report.cold+0x83/0xdf mm/kasan/report.c:450
list_empty include/linux/list.h:284 [inline]
waitqueue_active include/linux/wait.h:129 [inline]
wq_has_sleeper include/linux/wait.h:163 [inline]
skwq_has_sleeper include/net/sock.h:2263 [inline]
sock_def_write_space+0x62e/0x640 net/core/sock.c:3153
sock_wfree+0x1cc/0x240 net/core/sock.c:2285
skb_release_head_state+0x9f/0x250 net/core/skbuff.c:729
skb_release_all net/core/skbuff.c:740 [inline]
__kfree_skb net/core/skbuff.c:756 [inline]
consume_skb net/core/skbuff.c:912 [inline]
consume_skb+0x89/0x160 net/core/skbuff.c:906
__dev_kfree_skb_any+0x6b/0x80 net/core/dev.c:3121
dev_kfree_skb_any include/linux/netdevice.h:3993 [inline]
e1000_unmap_and_free_tx_resource+0x141/0x200 drivers/net/ethernet/intel/e1000/e1000_main.c:1969
e1000_clean_tx_irq drivers/net/ethernet/intel/e1000/e1000_main.c:3859 [inline]
e1000_clean+0x4a8/0x1c30 drivers/net/ethernet/intel/e1000/e1000_main.c:3800
__napi_poll+0xaf/0x440 net/core/dev.c:7023
napi_poll net/core/dev.c:7090 [inline]
net_rx_action+0x801/0xb40 net/core/dev.c:7177
__do_softirq+0x29b/0x9c2 kernel/softirq.c:558
invoke_softirq kernel/softirq.c:432 [inline]
__irq_exit_rcu+0x123/0x180 kernel/softirq.c:637
irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
common_interrupt+0xa9/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:629
RIP: 0010:default_idle+0xb/0x10 arch/x86/kernel/process.c:734
Code: ff ff e8 18 8e 77 f8 e9 24 fe ff ff e8 7e 2c fd ff cc cc cc cc cc cc cc cc cc cc cc cc cc cc eb 07 0f 00 2d 57 7c 5f 00 fb f4 0f 1f 40 00 41 54 be 08 00 00 00 53 65 48 8b 1c 25 40 70 02 00
RSP: 0018:ffffc9000045fdf8 EFLAGS: 00000202
RAX: 00000000002b62d3 RBX: ffff8880114c5700 RCX: ffffffff8943f3c1
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000003 R08: 0000000000000001 R09: ffff88802cd3aa53
R10: ffffed10059a754a R11: 0000000000000000 R12: ffffed1002298ae0
R13: 0000000000000003 R14: ffffffff8d915710 R15: 0000000000000000
default_idle_call+0x87/0xd0 kernel/sched/idle.c:112
cpuidle_idle_call kernel/sched/idle.c:194 [inline]
do_idle+0x401/0x590 kernel/sched/idle.c:306
cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:403
start_secondary+0x265/0x340 arch/x86/kernel/smpboot.c:272
secondary_startup_64_no_verify+0xb0/0xbb
Allocated by task 7091:
kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
__kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:467
kasan_slab_alloc include/linux/kasan.h:259 [inline]
slab_post_alloc_hook mm/slab.h:519 [inline]
slab_alloc_node mm/slub.c:3234 [inline]
slab_alloc mm/slub.c:3242 [inline]
kmem_cache_alloc+0x142/0x3a0 mm/slub.c:3247
sock_alloc_inode+0x18/0x1c0 net/socket.c:303
alloc_inode+0x61/0x230 fs/inode.c:235
new_inode_pseudo+0x14/0xe0 fs/inode.c:944
sock_alloc+0x3c/0x260 net/socket.c:626
__sock_create+0xb9/0x790 net/socket.c:1428
sock_create net/socket.c:1515 [inline]
__sys_socket+0xef/0x200 net/socket.c:1557
__do_sys_socket net/socket.c:1566 [inline]
__se_sys_socket net/socket.c:1564 [inline]
__ia32_sys_socket+0x6f/0xb0 net/socket.c:1564
do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline]
__do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178
do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203
entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
Freed by task 0:
kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38
kasan_set_track+0x21/0x30 mm/kasan/common.c:46
kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370
____kasan_slab_free mm/kasan/common.c:366 [inline]
____kasan_slab_free mm/kasan/common.c:328 [inline]
__kasan_slab_free+0xff/0x130 mm/kasan/common.c:374
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:1723 [inline]
slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1749
slab_free mm/slub.c:3513 [inline]
kmem_cache_free+0xbd/0x5d0 mm/slub.c:3530
i_callback+0x3f/0x70 fs/inode.c:224
rcu_do_batch kernel/rcu/tree.c:2506 [inline]
rcu_core+0x7ab/0x14a0 kernel/rcu/tree.c:2741
__do_softirq+0x29b/0x9c2 kernel/softirq.c:558
Last potentially related work creation:
kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38
__kasan_record_aux_stack+0xf5/0x120 mm/kasan/generic.c:348
__call_rcu kernel/rcu/tree.c:2985 [inline]
call_rcu+0xb1/0x740 kernel/rcu/tree.c:3065
destroy_inode+0x129/0x1b0 fs/inode.c:290
iput_final fs/inode.c:1670 [inline]
iput.part.0+0x562/0x820 fs/inode.c:1696
iput+0x58/0x70 fs/inode.c:1686
dentry_unlink_inode+0x2b1/0x460 fs/dcache.c:376
__dentry_kill+0x3c0/0x640 fs/dcache.c:582
dentry_kill fs/dcache.c:708 [inline]
dput+0x73d/0xbd0 fs/dcache.c:888
__fput+0x3ab/0x9f0 fs/file_table.c:293
task_work_run+0xdd/0x1a0 kernel/task_work.c:164
get_signal+0x1bef/0x2220 kernel/signal.c:2624
arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868
handle_signal_work kernel/entry/common.c:148 [inline]
exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207
__syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300
__do_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181
do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203
entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
Second to last potentially related work creation:
kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38
__kasan_record_aux_stack+0xf5/0x120 mm/kasan/generic.c:348
__call_rcu kernel/rcu/tree.c:2985 [inline]
call_rcu+0xb1/0x740 kernel/rcu/tree.c:3065
destroy_inode+0x129/0x1b0 fs/inode.c:290
iput_final fs/inode.c:1670 [inline]
iput.part.0+0x562/0x820 fs/inode.c:1696
iput+0x58/0x70 fs/inode.c:1686
dentry_unlink_inode+0x2b1/0x460 fs/dcache.c:376
__dentry_kill+0x3c0/0x640 fs/dcache.c:582
dentry_kill fs/dcache.c:708 [inline]
dput+0x73d/0xbd0 fs/dcache.c:888
__fput+0x3ab/0x9f0 fs/file_table.c:293
task_work_run+0xdd/0x1a0 kernel/task_work.c:164
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop kernel/entry/common.c:175 [inline]
exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:207
__syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300
__do_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181
do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203
entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
The buggy address belongs to the object at ffff8880229fc800
which belongs to the cache sock_inode_cache of size 1408
The buggy address is located 128 bytes inside of
1408-byte region [ffff8880229fc800, ffff8880229fcd80)
The buggy address belongs to the page:
page:ffffea00008a7e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880229fce00 pfn:0x229f8
head:ffffea00008a7e00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff888017caf401
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea00008c7200 dead000000000003 ffff888010df2dc0
raw: ffff8880229fce00 0000000080150013 00000001ffffffff ffff888017caf401
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 3707, ts 513846852817, free_ts 333282244752
prep_new_page mm/page_alloc.c:2418 [inline]
get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4149
__alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369
alloc_pages+0x1a7/0x300 mm/mempolicy.c:2190
alloc_slab_page mm/slub.c:1793 [inline]
allocate_slab mm/slub.c:1930 [inline]
new_slab+0x32d/0x4a0 mm/slub.c:1993
___slab_alloc+0x918/0xfe0 mm/slub.c:3022
__slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3109
slab_alloc_node mm/slub.c:3200 [inline]
slab_alloc mm/slub.c:3242 [inline]
kmem_cache_alloc+0x35c/0x3a0 mm/slub.c:3247
sock_alloc_inode+0x18/0x1c0 net/socket.c:303
alloc_inode+0x61/0x230 fs/inode.c:235
new_inode_pseudo+0x14/0xe0 fs/inode.c:944
sock_alloc+0x3c/0x260 net/socket.c:626
__sock_create+0xb9/0x790 net/socket.c:1428
sock_create net/socket.c:1515 [inline]
__sys_socket+0xef/0x200 net/socket.c:1557
__do_compat_sys_socketcall+0x5dd/0x660 net/compat.c:449
do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline]
__do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178
do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1338 [inline]
free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1389
free_unref_page_prepare mm/page_alloc.c:3309 [inline]
free_unref_page+0x19/0x690 mm/page_alloc.c:3388
__put_single_page mm/swap.c:99 [inline]
__put_page+0x13d/0x470 mm/swap.c:130
folio_put include/linux/mm.h:1237 [inline]
put_page include/linux/mm.h:1255 [inline]
unmap_and_move mm/migrate.c:1237 [inline]
migrate_pages+0x2737/0x3810 mm/migrate.c:1481
compact_zone+0x1abb/0x3830 mm/compaction.c:2399
kcompactd_do_work+0x2c9/0x730 mm/compaction.c:2839
kcompactd+0x86b/0xf30 mm/compaction.c:2941
kthread+0x405/0x4f0 kernel/kthread.c:327
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Memory state around the buggy address:
ffff8880229fc780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880229fc800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880229fc880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880229fc900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880229fc980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess), 2 bytes skipped:
0: e8 18 8e 77 f8 callq 0xf8778e1d
5: e9 24 fe ff ff jmpq 0xfffffe2e
a: e8 7e 2c fd ff callq 0xfffd2c8d
f: cc int3
10: cc int3
11: cc int3
12: cc int3
13: cc int3
14: cc int3
15: cc int3
16: cc int3
17: cc int3
18: cc int3
19: cc int3
1a: cc int3
1b: cc int3
1c: cc int3
1d: eb 07 jmp 0x26
1f: 0f 00 2d 57 7c 5f 00 verw 0x5f7c57(%rip) # 0x5f7c7d
26: fb sti
27: f4 hlt
* 28: c3 retq <-- trapping instruction
29: 0f 1f 40 00 nopl 0x0(%rax)
2d: 41 54 push %r12
2f: be 08 00 00 00 mov $0x8,%esi
34: 53 push %rbx
35: 65 48 8b 1c 25 40 70 mov %gs:0x27040,%rbx
3c: 02 00