================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3d86/0x54a0 kernel/locking/lockdep.c:4900 Read of size 8 at addr ffff888080e77120 by task syz-executor.3/7311 CPU: 0 PID: 7311 Comm: syz-executor.3 Not tainted 5.15.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:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x6c/0x30c mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 __lock_acquire+0x3d86/0x54a0 kernel/locking/lockdep.c:4900 lock_acquire kernel/locking/lockdep.c:5640 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5605 lock_sock_nested+0x36/0xf0 net/core/sock.c:3285 lock_sock include/net/sock.h:1645 [inline] nr_accept+0x36f/0x640 net/netrom/af_netrom.c:805 do_accept+0x382/0x510 net/socket.c:1773 __sys_accept4_file+0x7e/0xe0 net/socket.c:1816 __sys_accept4+0xb0/0x100 net/socket.c:1846 __do_sys_accept net/socket.c:1864 [inline] __se_sys_accept net/socket.c:1861 [inline] __x64_sys_accept+0x71/0xb0 net/socket.c:1861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fd169cd3ae9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd167207188 EFLAGS: 00000246 ORIG_RAX: 000000000000002b RAX: ffffffffffffffda RBX: 00007fd169de70e0 RCX: 00007fd169cd3ae9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007fd169d2df25 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffd483950f R14: 00007fd167207300 R15: 0000000000022000 Allocated by task 7301: 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_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:595 [inline] sk_prot_alloc+0x110/0x290 net/core/sock.c:1920 sk_alloc+0x30/0xa60 net/core/sock.c:1973 nr_create+0xb2/0x5f0 net/netrom/af_netrom.c:433 __sock_create+0x353/0x790 net/socket.c:1464 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] __x64_sys_socket+0x6f/0xb0 net/socket.c:1564 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 7297: 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] kfree+0xf6/0x560 mm/slub.c:4561 sk_prot_free net/core/sock.c:1956 [inline] __sk_destruct+0x6a8/0x900 net/core/sock.c:2042 sk_destruct+0xbd/0xe0 net/core/sock.c:2057 __sk_free+0xef/0x3d0 net/core/sock.c:2068 sk_free+0x78/0xa0 net/core/sock.c:2079 sock_put include/net/sock.h:1878 [inline] nr_release+0x392/0x450 net/netrom/af_netrom.c:554 __sock_release+0xcd/0x280 net/socket.c:649 sock_close+0x18/0x20 net/socket.c:1314 __fput+0x286/0x9f0 fs/file_table.c:280 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_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae 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 keypair_free_kref drivers/net/wireguard/noise.c:128 [inline] kref_put include/linux/kref.h:65 [inline] wg_noise_keypair_put+0x133/0x370 drivers/net/wireguard/noise.c:139 add_new_keypair drivers/net/wireguard/noise.c:237 [inline] wg_noise_handshake_begin_session+0x65f/0xe20 drivers/net/wireguard/noise.c:812 wg_receive_handshake_packet+0x39e/0x980 drivers/net/wireguard/receive.c:183 wg_packet_handshake_receive_worker+0x45/0x90 drivers/net/wireguard/receive.c:220 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff888080e77000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 288 bytes inside of 2048-byte region [ffff888080e77000, ffff888080e77800) The buggy address belongs to the page: page:ffffea0002039c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x80e70 head:ffffea0002039c00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010c42000 raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 6492, ts 184028074078, free_ts 0 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:2191 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] __kmalloc+0x2fb/0x340 mm/slub.c:4419 kmalloc include/linux/slab.h:595 [inline] kzalloc include/linux/slab.h:724 [inline] __register_sysctl_table+0x112/0x1090 fs/proc/proc_sysctl.c:1318 __addrconf_sysctl_register+0x1db/0x3d0 net/ipv6/addrconf.c:7031 addrconf_sysctl_register net/ipv6/addrconf.c:7078 [inline] addrconf_sysctl_register+0x139/0x1d0 net/ipv6/addrconf.c:7067 ipv6_add_dev+0x96d/0x1170 net/ipv6/addrconf.c:455 addrconf_notify+0x60e/0x1bb0 net/ipv6/addrconf.c:3510 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2002 call_netdevice_notifiers_extack net/core/dev.c:2014 [inline] call_netdevice_notifiers net/core/dev.c:2028 [inline] register_netdevice+0x1073/0x1500 net/core/dev.c:10361 veth_newlink+0x593/0xb00 drivers/net/veth.c:1726 page_owner free stack trace missing Memory state around the buggy address: ffff888080e77000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888080e77080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888080e77100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888080e77180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888080e77200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================