==================================================================
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: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:2182 [inline]
BUG: KASAN: use-after-free in sock_def_write_space+0x609/0x630 net/core/sock.c:2927
Read of size 8 at addr ffff88806d992fc0 by task syz-executor.3/8497
CPU: 1 PID: 8497 Comm: syz-executor.3 Not tainted 5.12.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:79 [inline]
dump_stack+0x141/0x1d7 lib/dump_stack.c:120
print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:233
__kasan_report mm/kasan/report.c:419 [inline]
kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:436
list_empty include/linux/list.h:282 [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:2182 [inline]
sock_def_write_space+0x609/0x630 net/core/sock.c:2927
sock_wfree+0x1cc/0x240 net/core/sock.c:2066
skb_release_head_state+0x9f/0x250 net/core/skbuff.c:713
skb_release_all net/core/skbuff.c:724 [inline]
__kfree_skb net/core/skbuff.c:740 [inline]
consume_skb net/core/skbuff.c:896 [inline]
consume_skb+0x89/0x160 net/core/skbuff.c:890
__dev_kfree_skb_any+0x6b/0x80 net/core/dev.c:3194
dev_consume_skb_any include/linux/netdevice.h:3984 [inline]
napi_consume_skb+0x27b/0x340 net/core/skbuff.c:951
free_old_xmit_skbs+0xe4/0x270 drivers/net/virtio_net.c:1467
start_xmit+0x123/0x1690 drivers/net/virtio_net.c:1664
__netdev_start_xmit include/linux/netdevice.h:4944 [inline]
netdev_start_xmit include/linux/netdevice.h:4958 [inline]
xmit_one net/core/dev.c:3654 [inline]
dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3670
sch_direct_xmit+0x2e1/0xbd0 net/sched/sch_generic.c:313
qdisc_restart net/sched/sch_generic.c:376 [inline]
__qdisc_run+0x4ba/0x15f0 net/sched/sch_generic.c:384
qdisc_run include/net/pkt_sched.h:136 [inline]
qdisc_run include/net/pkt_sched.h:128 [inline]
__dev_xmit_skb net/core/dev.c:3856 [inline]
__dev_queue_xmit+0x142e/0x2e30 net/core/dev.c:4213
neigh_hh_output include/net/neighbour.h:499 [inline]
neigh_output include/net/neighbour.h:508 [inline]
ip_finish_output2+0xeec/0x21f0 net/ipv4/ip_output.c:230
__ip_finish_output net/ipv4/ip_output.c:308 [inline]
__ip_finish_output+0x396/0x640 net/ipv4/ip_output.c:290
ip_finish_output+0x35/0x200 net/ipv4/ip_output.c:318
NF_HOOK_COND include/linux/netfilter.h:290 [inline]
ip_output+0x196/0x310 net/ipv4/ip_output.c:432
dst_output include/net/dst.h:448 [inline]
ip_local_out net/ipv4/ip_output.c:126 [inline]
__ip_queue_xmit+0x905/0x1a20 net/ipv4/ip_output.c:533
__tcp_transmit_skb+0x1889/0x38f0 net/ipv4/tcp_output.c:1405
tcp_transmit_skb net/ipv4/tcp_output.c:1423 [inline]
tcp_write_xmit+0xdee/0x6040 net/ipv4/tcp_output.c:2689
__tcp_push_pending_frames+0xaa/0x390 net/ipv4/tcp_output.c:2873
tcp_push_pending_frames include/net/tcp.h:1873 [inline]
tcp_data_snd_check net/ipv4/tcp_input.c:5388 [inline]
tcp_rcv_established+0x935/0x2130 net/ipv4/tcp_input.c:5883
tcp_v4_do_rcv+0x5d4/0x880 net/ipv4/tcp_ipv4.c:1694
tcp_v4_rcv+0x32a0/0x3960 net/ipv4/tcp_ipv4.c:2079
ip_protocol_deliver_rcu+0x5c/0xa20 net/ipv4/ip_input.c:204
ip_local_deliver_finish+0x20a/0x370 net/ipv4/ip_input.c:231
NF_HOOK include/linux/netfilter.h:301 [inline]
NF_HOOK include/linux/netfilter.h:295 [inline]
ip_local_deliver+0x1b3/0x200 net/ipv4/ip_input.c:252
dst_input include/net/dst.h:458 [inline]
ip_sublist_rcv_finish+0x9a/0x2c0 net/ipv4/ip_input.c:551
ip_list_rcv_finish.constprop.0+0x51e/0x6e0 net/ipv4/ip_input.c:601
ip_sublist_rcv net/ipv4/ip_input.c:609 [inline]
ip_list_rcv+0x34e/0x490 net/ipv4/ip_input.c:644
__netif_receive_skb_list_ptype net/core/dev.c:5483 [inline]
__netif_receive_skb_list_core+0x549/0x8e0 net/core/dev.c:5531
__netif_receive_skb_list net/core/dev.c:5583 [inline]
netif_receive_skb_list_internal+0x777/0xd70 net/core/dev.c:5693
gro_normal_list net/core/dev.c:5847 [inline]
gro_normal_list net/core/dev.c:5843 [inline]
napi_complete_done+0x1f1/0x880 net/core/dev.c:6553
virtqueue_napi_complete+0x2c/0xc0 drivers/net/virtio_net.c:337
virtnet_poll+0xbbb/0x10b0 drivers/net/virtio_net.c:1533
__napi_poll+0xaf/0x440 net/core/dev.c:6973
napi_poll net/core/dev.c:7040 [inline]
net_rx_action+0x801/0xb40 net/core/dev.c:7127
__do_softirq+0x29b/0x9f6 kernel/softirq.c:559
invoke_softirq kernel/softirq.c:433 [inline]
__irq_exit_rcu+0x136/0x200 kernel/softirq.c:637
irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
common_interrupt+0xa4/0xd0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:623
RIP: 0010:copy_page_range+0x2461/0x3fd0 mm/memory.c:1153
Code: 35 cb ca ff 40 84 ed 48 8b 9c 24 b0 00 00 00 0f 84 fd fb ff ff e8 6f c4 ca ff 48 8d 9c 24 ec 01 00 00 e9 eb fb ff ff 45 31 e4 5a c4 ca ff 48 b8 00 00 00 00 00 fc ff df 48 03 84 24 38 01 00
RSP: 0018:ffffc9000179f808 EFLAGS: 00000246
RAX: dffffc0000000000 RBX: ffff888018d48e00 RCX: 0000000000000000
RDX: 1ffff110031a927b RSI: ffffffff81a9edfc RDI: ffff888018d493d8
RBP: 0000000000000004 R08: 0000000000000020 R09: 0000000000000000
R10: ffffffff81a9edef R11: 0000000000000000 R12: 0000000000000000
R13: dffffc0000000000 R14: 00007ffef7b45000 R15: 0000000000000000
dup_mmap kernel/fork.c:598 [inline]
dup_mm+0x9ed/0x1380 kernel/fork.c:1374
copy_mm kernel/fork.c:1426 [inline]
copy_process+0x5ef9/0x7120 kernel/fork.c:2116
kernel_clone+0xe7/0xab0 kernel/fork.c:2503
__do_sys_clone+0xc8/0x110 kernel/fork.c:2620
do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x464bcb
Code: ed 0f 85 60 01 00 00 64 4c 8b 0c 25 10 00 00 00 45 31 c0 4d 8d 91 d0 02 00 00 31 d2 31 f6 bf 11 00 20 01 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 89 00 00 00 41 89 c5 85 c0 0f 85 90 00 00
RSP: 002b:00007ffef7b42cb0 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000464bcb
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000002b6e400
R10: 0000000002b6e6d0 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000000 R15: 00007ffef7b42da0
Allocated by task 31154:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:428 [inline]
__kasan_slab_alloc+0x84/0xa0 mm/kasan/common.c:461
kasan_slab_alloc include/linux/kasan.h:236 [inline]
slab_post_alloc_hook mm/slab.h:524 [inline]
slab_alloc_node mm/slub.c:2912 [inline]
slab_alloc mm/slub.c:2920 [inline]
kmem_cache_alloc+0x152/0x3a0 mm/slub.c:2925
sock_alloc_inode+0x18/0x1c0 net/socket.c:253
alloc_inode+0x61/0x230 fs/inode.c:233
new_inode_pseudo+0x14/0xe0 fs/inode.c:934
sock_alloc+0x3c/0x260 net/socket.c:576
__sock_create+0xb9/0x780 net/socket.c:1372
sock_create net/socket.c:1459 [inline]
__sys_socket+0xef/0x200 net/socket.c:1501
__do_sys_socket net/socket.c:1510 [inline]
__se_sys_socket net/socket.c:1508 [inline]
__x64_sys_socket+0x6f/0xb0 net/socket.c:1508
do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
entry_SYSCALL_64_after_hwframe+0x44/0xae
Freed by task 31145:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
kasan_set_track+0x1c/0x30 mm/kasan/common.c:46
kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:357
____kasan_slab_free mm/kasan/common.c:360 [inline]
____kasan_slab_free mm/kasan/common.c:325 [inline]
__kasan_slab_free+0xfb/0x130 mm/kasan/common.c:368
kasan_slab_free include/linux/kasan.h:212 [inline]
slab_free_hook mm/slub.c:1581 [inline]
slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1606
slab_free mm/slub.c:3166 [inline]
kmem_cache_free+0x8a/0x740 mm/slub.c:3182
i_callback+0x3f/0x70 fs/inode.c:222
rcu_do_batch kernel/rcu/tree.c:2558 [inline]
rcu_core+0x7ab/0x13b0 kernel/rcu/tree.c:2793
__do_softirq+0x29b/0x9f6 kernel/softirq.c:559
Last potentially related work creation:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:345
__call_rcu kernel/rcu/tree.c:3038 [inline]
call_rcu+0xb1/0x750 kernel/rcu/tree.c:3113
destroy_inode+0x129/0x1b0 fs/inode.c:288
iput_final fs/inode.c:1660 [inline]
iput.part.0+0x57e/0x810 fs/inode.c:1686
iput+0x58/0x70 fs/inode.c:1676
dentry_unlink_inode+0x2b1/0x3d0 fs/dcache.c:376
__dentry_kill+0x3c0/0x640 fs/dcache.c:582
dentry_kill fs/dcache.c:708 [inline]
dput+0x72a/0xbc0 fs/dcache.c:888
__fput+0x3ae/0x920 fs/file_table.c:293
task_work_run+0xdd/0x1a0 kernel/task_work.c:164
get_signal+0x1ba2/0x2150 kernel/signal.c:2591
arch_do_signal_or_restart+0x2a8/0x1eb0 arch/x86/kernel/signal.c:789
handle_signal_work kernel/entry/common.c:147 [inline]
exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
exit_to_user_mode_prepare+0x171/0x280 kernel/entry/common.c:208
__syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301
do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:57
entry_SYSCALL_64_after_hwframe+0x44/0xae
Second to last potentially related work creation:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:345
__call_rcu kernel/rcu/tree.c:3038 [inline]
call_rcu+0xb1/0x750 kernel/rcu/tree.c:3113
destroy_inode+0x129/0x1b0 fs/inode.c:288
iput_final fs/inode.c:1660 [inline]
iput.part.0+0x57e/0x810 fs/inode.c:1686
iput+0x58/0x70 fs/inode.c:1676
__sock_release net/socket.c:611 [inline]
sock_release+0x15a/0x1b0 net/socket.c:627
rds_tcp_conn_path_shutdown+0x1eb/0x3f0 net/rds/tcp_connect.c:216
rds_conn_shutdown+0x248/0x930 net/rds/connection.c:386
process_one_work+0x98d/0x1600 kernel/workqueue.c:2275
worker_thread+0x64c/0x1120 kernel/workqueue.c:2421
kthread+0x3b1/0x4a0 kernel/kthread.c:313
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294
The buggy address belongs to the object at ffff88806d992f40
which belongs to the cache sock_inode_cache of size 1216
The buggy address is located 128 bytes inside of
1216-byte region [ffff88806d992f40, ffff88806d993400)
The buggy address belongs to the page:
page:ffffea0001b66400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6d990
head:ffffea0001b66400 order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff8881445f8280
raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Reclaimable, gfp_mask 0xd20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE), pid 8493, ts 200462679951, free_ts 184188091965
prep_new_page mm/page_alloc.c:2358 [inline]
get_page_from_freelist+0x1033/0x2b60 mm/page_alloc.c:3994
__alloc_pages+0x1b2/0x500 mm/page_alloc.c:5200
alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2272
alloc_slab_page mm/slub.c:1644 [inline]
allocate_slab+0x2c5/0x4c0 mm/slub.c:1784
new_slab mm/slub.c:1847 [inline]
new_slab_objects mm/slub.c:2593 [inline]
___slab_alloc+0x44c/0x7a0 mm/slub.c:2756
__slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2796
slab_alloc_node mm/slub.c:2878 [inline]
slab_alloc mm/slub.c:2920 [inline]
kmem_cache_alloc+0x34b/0x3a0 mm/slub.c:2925
sock_alloc_inode+0x18/0x1c0 net/socket.c:253
alloc_inode+0x61/0x230 fs/inode.c:233
new_inode_pseudo+0x14/0xe0 fs/inode.c:934
sock_alloc+0x3c/0x260 net/socket.c:576
__sock_create+0xb9/0x780 net/socket.c:1372
sock_create net/socket.c:1459 [inline]
__sys_socket+0xef/0x200 net/socket.c:1501
__do_sys_socket net/socket.c:1510 [inline]
__se_sys_socket net/socket.c:1508 [inline]
__x64_sys_socket+0x6f/0xb0 net/socket.c:1508
do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
entry_SYSCALL_64_after_hwframe+0x44/0xae
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1298 [inline]
__free_pages_ok+0x476/0xce0 mm/page_alloc.c:1572
release_pages+0x813/0x2120 mm/swap.c:948
tlb_batch_pages_flush mm/mmu_gather.c:49 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:242 [inline]
tlb_flush_mmu+0xe9/0x6b0 mm/mmu_gather.c:249
zap_pte_range mm/memory.c:1336 [inline]
zap_pmd_range mm/memory.c:1374 [inline]
zap_pud_range mm/memory.c:1403 [inline]
zap_p4d_range mm/memory.c:1424 [inline]
unmap_page_range+0x1a7f/0x2650 mm/memory.c:1445
unmap_single_vma+0x198/0x300 mm/memory.c:1490
unmap_vmas+0x16d/0x2f0 mm/memory.c:1522
exit_mmap+0x2a8/0x590 mm/mmap.c:3208
__mmput+0x122/0x470 kernel/fork.c:1096
mmput+0x58/0x60 kernel/fork.c:1117
exit_mm kernel/exit.c:502 [inline]
do_exit+0xb0a/0x2a60 kernel/exit.c:813
do_group_exit+0x125/0x310 kernel/exit.c:923
get_signal+0x47f/0x2150 kernel/signal.c:2818
arch_do_signal_or_restart+0x2a8/0x1eb0 arch/x86/kernel/signal.c:789
handle_signal_work kernel/entry/common.c:147 [inline]
exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
exit_to_user_mode_prepare+0x171/0x280 kernel/entry/common.c:208
__syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301
do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:57
Memory state around the buggy address:
ffff88806d992e80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
ffff88806d992f00: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
>ffff88806d992f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88806d993000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88806d993080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================