================================================================== 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:127 [inline] BUG: KASAN: use-after-free in wq_has_sleeper include/linux/wait.h:161 [inline] BUG: KASAN: use-after-free in skwq_has_sleeper include/net/sock.h:2147 [inline] BUG: KASAN: use-after-free in sock_def_write_space+0x609/0x630 net/core/sock.c:2947 Read of size 8 at addr ffff888000e715c0 by task syz-fuzzer/8397 CPU: 3 PID: 8397 Comm: syz-fuzzer Not tainted 5.8.0-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18f/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x436 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 list_empty include/linux/list.h:282 [inline] waitqueue_active include/linux/wait.h:127 [inline] wq_has_sleeper include/linux/wait.h:161 [inline] skwq_has_sleeper include/net/sock.h:2147 [inline] sock_def_write_space+0x609/0x630 net/core/sock.c:2947 sock_wfree+0x1cc/0x240 net/core/sock.c:2060 skb_release_head_state+0x9f/0x250 net/core/skbuff.c:651 skb_release_all net/core/skbuff.c:662 [inline] __kfree_skb net/core/skbuff.c:678 [inline] consume_skb net/core/skbuff.c:837 [inline] consume_skb+0x89/0x160 net/core/skbuff.c:831 __dev_kfree_skb_any+0x9c/0xc0 net/core/dev.c:3101 dev_consume_skb_any include/linux/netdevice.h:3740 [inline] napi_consume_skb+0x24f/0x370 net/core/skbuff.c:901 free_old_xmit_skbs+0xd5/0x230 drivers/net/virtio_net.c:1389 start_xmit+0x123/0x15f0 drivers/net/virtio_net.c:1585 __netdev_start_xmit include/linux/netdevice.h:4613 [inline] netdev_start_xmit include/linux/netdevice.h:4627 [inline] xmit_one net/core/dev.c:3556 [inline] dev_hard_start_xmit+0x193/0x950 net/core/dev.c:3572 sch_direct_xmit+0x2e1/0xbd0 net/sched/sch_generic.c:313 qdisc_restart net/sched/sch_generic.c:376 [inline] __qdisc_run+0x4b9/0x1620 net/sched/sch_generic.c:384 qdisc_run include/net/pkt_sched.h:134 [inline] qdisc_run include/net/pkt_sched.h:126 [inline] __dev_xmit_skb net/core/dev.c:3747 [inline] __dev_queue_xmit+0x1456/0x2d60 net/core/dev.c:4100 neigh_hh_output include/net/neighbour.h:498 [inline] neigh_output include/net/neighbour.h:507 [inline] ip_finish_output2+0x1523/0x21f0 net/ipv4/ip_output.c:228 __ip_finish_output net/ipv4/ip_output.c:306 [inline] __ip_finish_output+0x779/0xcb0 net/ipv4/ip_output.c:288 ip_finish_output+0x34/0x1f0 net/ipv4/ip_output.c:316 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip_output+0x196/0x310 net/ipv4/ip_output.c:430 dst_output include/net/dst.h:443 [inline] ip_local_out net/ipv4/ip_output.c:125 [inline] __ip_queue_xmit+0x8e9/0x19c0 net/ipv4/ip_output.c:530 __tcp_transmit_skb+0x1884/0x3690 net/ipv4/tcp_output.c:1240 tcp_transmit_skb net/ipv4/tcp_output.c:1256 [inline] tcp_write_xmit+0xebf/0x5c70 net/ipv4/tcp_output.c:2519 __tcp_push_pending_frames+0xaa/0x330 net/ipv4/tcp_output.c:2697 tcp_push+0x446/0x6c0 net/ipv4/tcp.c:733 tcp_sendmsg_locked+0x2473/0x2d00 net/ipv4/tcp.c:1411 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1441 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:814 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:672 sock_write_iter+0x28c/0x3c0 net/socket.c:999 call_write_iter include/linux/fs.h:1868 [inline] new_sync_write+0x422/0x650 fs/read_write.c:503 vfs_write+0x59d/0x6b0 fs/read_write.c:578 ksys_write+0x1ee/0x250 fs/read_write.c:631 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x4b02a0 Code: 8b 7c 24 10 48 8b 74 24 18 48 8b 54 24 20 49 c7 c2 00 00 00 00 49 c7 c0 00 00 00 00 49 c7 c1 00 00 00 00 48 8b 44 24 08 0f 05 <48> 3d 01 f0 ff ff 76 20 48 c7 44 24 28 ff ff ff ff 48 c7 44 24 30 RSP: 002b:000000c0009fd3f0 EFLAGS: 00000206 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000c000030f00 RCX: 00000000004b02a0 RDX: 00000000000000f0 RSI: 000000c00000a200 RDI: 0000000000000003 RBP: 000000c0009fd440 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 000000000000011e R13: 000000c0004ac000 R14: 000000000000007f R15: ffffffffffffc282 Allocated by task 20641: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:494 slab_post_alloc_hook mm/slab.h:586 [inline] slab_alloc mm/slab.c:3320 [inline] kmem_cache_alloc+0x12c/0x3b0 mm/slab.c:3484 sock_alloc_inode+0x18/0x1c0 net/socket.c:253 alloc_inode+0x61/0x230 fs/inode.c:232 new_inode_pseudo+0x14/0xe0 fs/inode.c:928 sock_alloc+0x3c/0x260 net/socket.c:573 __sock_create+0xb9/0x740 net/socket.c:1392 sock_create net/socket.c:1479 [inline] __sys_socket+0xef/0x200 net/socket.c:1521 __do_sys_socket net/socket.c:1530 [inline] __se_sys_socket net/socket.c:1528 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1528 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 8397: save_stack+0x1b/0x40 mm/kasan/common.c:48 set_track mm/kasan/common.c:56 [inline] kasan_set_free_info mm/kasan/common.c:316 [inline] __kasan_slab_free+0xf5/0x140 mm/kasan/common.c:455 __cache_free mm/slab.c:3426 [inline] kmem_cache_free+0x7f/0x310 mm/slab.c:3694 i_callback+0x3f/0x70 fs/inode.c:221 rcu_do_batch kernel/rcu/tree.c:2427 [inline] rcu_core+0x5c7/0x1190 kernel/rcu/tree.c:2655 __do_softirq+0x2de/0xa24 kernel/softirq.c:298 The buggy address belongs to the object at ffff888000e71540 which belongs to the cache sock_inode_cache(49:syz2) of size 1216 The buggy address is located 128 bytes inside of 1216-byte region [ffff888000e71540, ffff888000e71a00) The buggy address belongs to the page: page:ffffea0000039c40 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888000e71ffd flags: 0x7ffe0000000200(slab) raw: 007ffe0000000200 ffffea000001c108 ffffea00006e8988 ffff88806173d8c0 raw: ffff888000e71ffd ffff888000e71000 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888000e71480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888000e71500: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff888000e71580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888000e71600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888000e71680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================