================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3ee7/0x56d0 kernel/locking/lockdep.c:4923 Read of size 8 at addr ffff88807e261130 by task syz-executor.5/720 CPU: 1 PID: 720 Comm: syz-executor.5 Not tainted 6.0.0-rc3-syzkaller-00041-g2880e1a175b9 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/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:0x7f214c089279 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:00007f214d129168 EFLAGS: 00000246 ORIG_RAX: 0000000000000120 RAX: ffffffffffffffda RBX: 00007f214c19bf80 RCX: 00007f214c089279 RDX: 0000000020000240 RSI: 0000000020000180 RDI: 0000000000000004 RBP: 00007f214c0e32e9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc35c1efcf R14: 00007f214d129300 R15: 0000000000022000 Allocated by task 720: 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 739: 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 ffff88807e261000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 304 bytes inside of 2048-byte region [ffff88807e261000, ffff88807e261800) The buggy address belongs to the physical page: page:ffffea0001f89840 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e261 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001f911c8 ffffea0001eded88 ffff888011840800 raw: 0000000000000000 ffff88807e261000 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 0x3420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 32504, tgid 32498 (syz-executor.2), ts 1822921080401, free_ts 1807997262194 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] __do_cache_alloc mm/slab.c:3246 [inline] slab_alloc mm/slab.c:3287 [inline] __do_kmalloc mm/slab.c:3684 [inline] __kmalloc_track_caller+0x39e/0x4a0 mm/slab.c:3701 kmemdup+0x23/0x50 mm/util.c:129 kmemdup include/linux/fortify-string.h:456 [inline] ipv6_sysctl_net_init+0x2c/0x2a0 net/ipv6/sysctl_net_ipv6.c:262 ops_init+0xaf/0x470 net/core/net_namespace.c:135 setup_net+0x5d1/0xc50 net/core/net_namespace.c:326 copy_net_ns+0x318/0x760 net/core/net_namespace.c:472 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:227 ksys_unshare+0x445/0x920 kernel/fork.c:3183 __do_sys_unshare kernel/fork.c:3254 [inline] __se_sys_unshare kernel/fork.c:3252 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3252 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 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+0x19/0x4d0 mm/page_alloc.c:3476 slab_destroy mm/slab.c:1615 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1635 cache_flusharray mm/slab.c:3389 [inline] ___cache_free+0x2a8/0x3d0 mm/slab.c:3452 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x4f/0x1b0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:447 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc mm/slab.c:3294 [inline] kmem_cache_alloc_trace+0x212/0x460 mm/slab.c:3557 kmalloc include/linux/slab.h:600 [inline] gro_cells_destroy net/core/gro_cells.c:126 [inline] gro_cells_destroy+0x302/0x510 net/core/gro_cells.c:106 ip_tunnel_dev_free+0x15/0x60 net/ipv4/ip_tunnel.c:1012 netdev_run_todo+0x6bb/0x1100 net/core/dev.c:10377 ip_tunnel_delete_nets+0x3a4/0x5b0 net/ipv4/ip_tunnel.c:1126 ops_exit_list+0x125/0x170 net/core/net_namespace.c:168 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:595 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 Memory state around the buggy address: ffff88807e261000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807e261080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807e261100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807e261180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807e261200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================