================================================================== 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 ffff88806d204b00 by task syz-executor.4/8741 CPU: 0 PID: 8741 Comm: syz-executor.4 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] napi_consume_skb+0x1b5/0x340 net/core/skbuff.c:969 free_old_xmit_skbs+0xe4/0x270 drivers/net/virtio_net.c:1467 virtnet_poll_tx+0x1e9/0x370 drivers/net/virtio_net.c:1595 __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:__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 ee 57 41 f8 48 89 ef e8 86 d0 41 f8 e8 91 c1 61 f8 fb bf 01 00 00 00 c6 d8 35 f8 65 8b 05 df e1 e8 76 85 c0 74 02 5d c3 e8 9b 37 e7 RSP: 0018:ffffc900016efb08 EFLAGS: 00000206 RAX: 0000000000278605 RBX: 0000000000000001 RCX: 1ffffffff1b925a9 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000001 RBP: ffff8880b9c35240 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff817acf98 R11: 0000000000000001 R12: ffff8880b9c35240 R13: ffff88802114b880 R14: 0000000000000000 R15: ffff888065fe54c0 finish_lock_switch kernel/sched/core.c:4093 [inline] finish_task_switch.isra.0+0x15d/0x810 kernel/sched/core.c:4210 context_switch kernel/sched/core.c:4342 [inline] __schedule+0x91e/0x23e0 kernel/sched/core.c:5147 schedule+0xcf/0x270 kernel/sched/core.c:5226 freezable_schedule include/linux/freezer.h:172 [inline] do_nanosleep+0x268/0x6a0 kernel/time/hrtimer.c:1896 hrtimer_nanosleep+0x1f9/0x4a0 kernel/time/hrtimer.c:1949 common_nsleep+0xa2/0xc0 kernel/time/posix-timers.c:1227 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1267 [inline] __se_sys_clock_nanosleep kernel/time/posix-timers.c:1245 [inline] __x64_sys_clock_nanosleep+0x2f4/0x430 kernel/time/posix-timers.c:1245 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x48a7a1 Code: 24 0c 89 3c 24 48 89 4c 24 18 e8 aa e7 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 8b 74 24 0c 8b 3c 24 b8 e6 00 00 00 0f 05 <44> 89 c7 48 89 04 24 e8 e3 e7 ff ff 48 8b 04 24 eb 97 66 2e 0f 1f RSP: 002b:00007ffd489906d0 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: ffffffffffffffda RBX: 0000000000000223 RCX: 000000000048a7a1 RDX: 00007ffd48990710 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007ffd489907ac R08: 0000000000000000 R09: 00007ffd489a6080 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000032 R13: 000000000006261e R14: 000000000000000f R15: 00007ffd48990810 Allocated by task 17612: 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 17642: 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 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:174 [inline] exit_to_user_mode_prepare+0x272/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 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 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:174 [inline] exit_to_user_mode_prepare+0x272/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 The buggy address belongs to the object at ffff88806d204a80 which belongs to the cache sock_inode_cache of size 1216 The buggy address is located 128 bytes inside of 1216-byte region [ffff88806d204a80, ffff88806d204f40) The buggy address belongs to the page: page:ffffea0001b48100 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6d204 head:ffffea0001b48100 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001b46100 0000000300000003 ffff888016196a00 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 10562, ts 203173197786, free_ts 203088965928 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 inet_ctl_sock_create+0x88/0x1d0 net/ipv4/af_inet.c:1654 ops_init+0xaf/0x470 net/core/net_namespace.c:140 setup_net+0x40f/0xa30 net/core/net_namespace.c:333 copy_net_ns+0x31e/0x760 net/core/net_namespace.c:474 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 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x8e/0xa0 mm/kasan/common.c:438 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] kmem_cache_alloc_node+0x269/0x3e0 mm/slub.c:2948 __alloc_skb+0x20b/0x340 net/core/skbuff.c:413 alloc_skb include/linux/skbuff.h:1107 [inline] nlmsg_new include/net/netlink.h:953 [inline] rtmsg_ifinfo_build_skb+0x72/0x1a0 net/core/rtnetlink.c:3791 rtmsg_ifinfo_event net/core/rtnetlink.c:3827 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3818 [inline] rtmsg_ifinfo+0x83/0x120 net/core/rtnetlink.c:3836 netdev_state_change net/core/dev.c:1514 [inline] netdev_state_change+0x114/0x130 net/core/dev.c:1505 do_setlink+0x2dbe/0x3900 net/core/rtnetlink.c:2935 rtnl_group_changelink net/core/rtnetlink.c:3224 [inline] __rtnl_newlink+0xbe9/0x1710 net/core/rtnetlink.c:3378 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3488 rtnetlink_rcv_msg+0x44e/0xb70 net/core/rtnetlink.c:5550 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2502 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1927 Memory state around the buggy address: ffff88806d204a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88806d204a80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88806d204b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806d204b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806d204c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================