================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3ee7/0x56d0 kernel/locking/lockdep.c:4923 Read of size 8 at addr ffff88804d245130 by task syz-executor.0/22208 CPU: 1 PID: 22208 Comm: syz-executor.0 Not tainted 6.0.0-rc6-syzkaller-00030-g06f7db949993 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x6e9 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 __lock_acquire+0x3ee7/0x56d0 kernel/locking/lockdep.c:4923 lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 lock_sock_nested+0x36/0xf0 net/core/sock.c:3393 lock_sock include/net/sock.h:1712 [inline] nr_accept+0x373/0x640 net/netrom/af_netrom.c:805 do_accept+0x37c/0x510 net/socket.c:1856 __sys_accept4_file net/socket.c:1897 [inline] __sys_accept4+0x96/0x120 net/socket.c:1927 __do_sys_accept4 net/socket.c:1938 [inline] __se_sys_accept4 net/socket.c:1935 [inline] __x64_sys_accept4+0x93/0xf0 net/socket.c:1935 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+0x63/0xcd RIP: 0033:0x7f921668a649 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f92177a6168 EFLAGS: 00000246 ORIG_RAX: 0000000000000120 RAX: ffffffffffffffda RBX: 00007f921679bf80 RCX: 00007f921668a649 RDX: 0000000020000a00 RSI: 0000000020000980 RDI: 0000000000000004 RBP: 00007f92166e5560 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcc860acdf R14: 00007f92177a6300 R15: 0000000000022000 Allocated by task 22208: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:525 kasan_kmalloc include/linux/kasan.h:234 [inline] __do_kmalloc mm/slab.c:3686 [inline] __kmalloc+0x1f9/0x4a0 mm/slab.c:3695 kmalloc include/linux/slab.h:605 [inline] sk_prot_alloc+0x143/0x290 net/core/sock.c:1976 sk_alloc+0x36/0x770 net/core/sock.c:2029 nr_create+0xb2/0x5f0 net/netrom/af_netrom.c:433 __sock_create+0x355/0x790 net/socket.c:1515 sock_create net/socket.c:1566 [inline] __sys_socket_create net/socket.c:1603 [inline] __sys_socket_create net/socket.c:1588 [inline] __sys_socket+0x12f/0x240 net/socket.c:1636 __do_sys_socket net/socket.c:1649 [inline] __se_sys_socket net/socket.c:1647 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1647 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+0x63/0xcd Freed by task 21: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free+0x13d/0x1a0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] __cache_free mm/slab.c:3418 [inline] kfree+0x173/0x390 mm/slab.c:3786 sk_prot_free net/core/sock.c:2012 [inline] __sk_destruct+0x5e0/0x710 net/core/sock.c:2098 sk_destruct net/core/sock.c:2113 [inline] __sk_free+0x175/0x460 net/core/sock.c:2124 sk_free+0x78/0xa0 net/core/sock.c:2135 sock_put include/net/sock.h:1962 [inline] nr_heartbeat_expiry+0x1d3/0x450 net/netrom/nr_timer.c:148 call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x674/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1d3/0x9c6 kernel/softirq.c:571 The buggy address belongs to the object at ffff88804d245000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 304 bytes inside of 2048-byte region [ffff88804d245000, ffff88804d245800) The buggy address belongs to the physical page: page:ffffea0001349140 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4d245 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00013b9c48 ffffea0001349188 ffff888011840800 raw: 0000000000000000 ffff88804d245000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x3d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE), pid 21840, tgid 21834 (syz-executor.3), ts 1974049050563, free_ts 1974023110167 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5515 __alloc_pages_node include/linux/gfp.h:243 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x360 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3018 [inline] ____cache_alloc mm/slab.c:3001 [inline] slab_alloc_node mm/slab.c:3220 [inline] kmem_cache_alloc_node_trace+0x50a/0x570 mm/slab.c:3601 __do_kmalloc_node mm/slab.c:3623 [inline] __kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3638 kmalloc_reserve net/core/skbuff.c:362 [inline] pskb_expand_head+0x203/0x1110 net/core/skbuff.c:1729 netlink_trim+0x1ea/0x240 net/netlink/af_netlink.c:1301 netlink_broadcast+0x5f/0xd90 net/netlink/af_netlink.c:1497 nlmsg_multicast include/net/netlink.h:1033 [inline] nlmsg_notify+0x8f/0x280 net/netlink/af_netlink.c:2544 rtnl_notify net/core/rtnetlink.c:767 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:3928 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3943 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3931 [inline] rtmsg_ifinfo+0xf0/0x120 net/core/rtnetlink.c:3949 register_netdevice+0x12f1/0x1680 net/core/dev.c:10117 register_netdev+0x2d/0x50 net/core/dev.c:10196 ip6_tnl_init_net+0x479/0x890 net/ipv6/ip6_tunnel.c:2289 ops_init+0xaf/0x470 net/core/net_namespace.c:135 setup_net+0x5d1/0xc50 net/core/net_namespace.c:326 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page_list+0x16f/0xb90 mm/page_alloc.c:3522 release_pages+0xbd3/0x1400 mm/swap.c:1012 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:58 tlb_flush_mmu_free mm/mmu_gather.c:255 [inline] tlb_flush_mmu mm/mmu_gather.c:262 [inline] tlb_finish_mmu+0x147/0x7e0 mm/mmu_gather.c:353 exit_mmap+0x1d2/0x490 mm/mmap.c:3118 __mmput+0x122/0x4b0 kernel/fork.c:1187 mmput+0x56/0x60 kernel/fork.c:1208 exit_mm kernel/exit.c:510 [inline] do_exit+0x9e2/0x29b0 kernel/exit.c:782 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 get_signal+0x238c/0x2610 kernel/signal.c:2857 arch_do_signal_or_restart+0x82/0x2300 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop kernel/entry/common.c:166 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88804d245000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804d245080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88804d245100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804d245180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804d245200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================