================================================================== BUG: KASAN: use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] BUG: KASAN: use-after-free in do_raw_spin_lock+0x28b/0x360 kernel/locking/spinlock_debug.c:114 Read of size 4 at addr ffff8880741d209c by task syz-executor.2/12092 CPU: 1 PID: 12092 Comm: syz-executor.2 Not tainted 6.1.0-rc2-syzkaller-00105-gb229b6ca5abb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x74/0x340 mm/kasan/report.c:284 print_report+0x107/0x220 mm/kasan/report.c:395 kasan_report+0x139/0x170 mm/kasan/report.c:495 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] do_raw_spin_lock+0x28b/0x360 kernel/locking/spinlock_debug.c:114 spin_lock_bh include/linux/spinlock.h:355 [inline] lock_sock_nested+0x66/0xf0 net/core/sock.c:3450 lock_sock include/net/sock.h:1721 [inline] nr_accept+0x510/0x660 net/netrom/af_netrom.c:805 do_accept+0x4d0/0x6d0 net/socket.c:1856 __sys_accept4_file net/socket.c:1897 [inline] __sys_accept4+0x97/0x100 net/socket.c:1927 __do_sys_accept4 net/socket.c:1938 [inline] __se_sys_accept4 net/socket.c:1935 [inline] __x64_sys_accept4+0x96/0xb0 net/socket.c:1935 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0cf448b5a9 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:00007f0cf5100168 EFLAGS: 00000246 ORIG_RAX: 0000000000000120 RAX: ffffffffffffffda RBX: 00007f0cf45abf80 RCX: 00007f0cf448b5a9 RDX: 0000000000000000 RSI: 00000000200002c0 RDI: 0000000000000004 RBP: 00007f0cf44e67b0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc12c3feef R14: 00007f0cf5100300 R15: 0000000000022000 Allocated by task 12092: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:380 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc+0xaf/0x1a0 mm/slab_common.c:968 kmalloc include/linux/slab.h:581 [inline] sk_prot_alloc+0xde/0x200 net/core/sock.c:2030 sk_alloc+0x36/0x340 net/core/sock.c:2083 nr_create+0x9d/0x500 net/netrom/af_netrom.c:433 __sock_create+0x3fd/0x850 net/socket.c:1515 sock_create net/socket.c:1566 [inline] __sys_socket_create net/socket.c:1603 [inline] __sys_socket+0x137/0x3a0 net/socket.c:1636 __do_sys_socket net/socket.c:1649 [inline] __se_sys_socket net/socket.c:1647 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 21: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:511 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1750 slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0x71/0x110 mm/slub.c:3674 sk_prot_free net/core/sock.c:2066 [inline] __sk_destruct+0x487/0x5d0 net/core/sock.c:2152 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers+0x76a/0x980 kernel/time/timer.c:1790 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803 __do_softirq+0x277/0x75b kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:481 call_rcu+0x163/0xa00 kernel/rcu/tree.c:2798 netlink_release+0x12fc/0x1720 net/netlink/af_netlink.c:815 __sock_release net/socket.c:650 [inline] sock_close+0xd7/0x260 net/socket.c:1365 __fput+0x3ba/0x880 fs/file_table.c:320 task_work_run+0x243/0x300 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x134/0x160 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:481 call_rcu+0x163/0xa00 kernel/rcu/tree.c:2798 netlink_release+0x12fc/0x1720 net/netlink/af_netlink.c:815 __sock_release net/socket.c:650 [inline] sock_release+0x7a/0x140 net/socket.c:678 rdma_dev_exit_net+0x2b9/0x360 drivers/infiniband/core/device.c:1152 ops_exit_list net/core/net_namespace.c:169 [inline] cleanup_net+0x758/0xc50 net/core/net_namespace.c:601 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff8880741d2000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 156 bytes inside of 2048-byte region [ffff8880741d2000, ffff8880741d2800) The buggy address belongs to the physical page: page:ffffea0001d07400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x741d0 head:ffffea0001d07400 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888012042000 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 3635, tgid 3635 (syz-executor.5), ts 140192410226, free_ts 140148177837 prep_new_page mm/page_alloc.c:2538 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4287 __alloc_pages+0x259/0x560 mm/page_alloc.c:5554 alloc_slab_page+0x70/0xf0 mm/slub.c:1794 allocate_slab+0x5e/0x4b0 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0x7f4/0xeb0 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x252/0x310 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc_node+0x9e/0x190 mm/slab_common.c:962 kmalloc_node include/linux/slab.h:602 [inline] kzalloc_node include/linux/slab.h:723 [inline] qdisc_alloc+0x8e/0x940 net/sched/sch_generic.c:938 qdisc_create_dflt+0x6c/0x2a0 net/sched/sch_generic.c:996 attach_one_default_qdisc net/sched/sch_generic.c:1151 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2440 [inline] attach_default_qdiscs net/sched/sch_generic.c:1169 [inline] dev_activate+0x353/0x1250 net/sched/sch_generic.c:1228 __dev_open+0x3f1/0x510 net/core/dev.c:1441 __dev_change_flags+0x1e0/0x6d0 net/core/dev.c:8543 dev_change_flags+0x85/0x190 net/core/dev.c:8614 do_setlink+0xf36/0x3f10 net/core/rtnetlink.c:2788 __rtnl_newlink net/core/rtnetlink.c:3547 [inline] rtnl_newlink+0x183e/0x2060 net/core/rtnetlink.c:3594 rtnetlink_rcv_msg+0x7b8/0xe90 net/core/rtnetlink.c:6091 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1458 [inline] free_pcp_prepare+0x80c/0x8f0 mm/page_alloc.c:1508 free_unref_page_prepare mm/page_alloc.c:3386 [inline] free_unref_page+0x7d/0x630 mm/page_alloc.c:3482 free_slab mm/slub.c:2031 [inline] discard_slab mm/slub.c:2037 [inline] __unfreeze_partials+0x1ab/0x200 mm/slub.c:2586 put_cpu_partial+0x116/0x180 mm/slub.c:2662 qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x169/0x180 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] __kmem_cache_alloc_node+0x1d7/0x310 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc+0x9e/0x1a0 mm/slab_common.c:968 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:712 [inline] fib6_info_alloc+0x2c/0xd0 net/ipv6/ip6_fib.c:156 ip6_route_info_create+0x43d/0x12e0 net/ipv6/route.c:3749 ip6_route_add+0x22/0x120 net/ipv6/route.c:3843 addrconf_prefix_route+0x3fd/0x5c0 net/ipv6/addrconf.c:2425 add_v4_addrs+0x5c5/0x880 net/ipv6/addrconf.c:3169 addrconf_gre_config+0xbe/0x1a0 net/ipv6/addrconf.c:3443 addrconf_notify+0xb66/0xfe0 net/ipv6/addrconf.c:3627 Memory state around the buggy address: ffff8880741d1f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880741d2000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880741d2080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880741d2100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880741d2180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================