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+0x261/0x2a0 kernel/locking/spinlock_debug.c:114 Read of size 4 at addr ffff888011914c94 by task syz-executor.1/26163 CPU: 3 PID: 26163 Comm: syz-executor.1 Not tainted 5.18.0-rc2-syzkaller-00050-ga19944809fe9 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 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+0xeb/0x467 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] do_raw_spin_lock+0x261/0x2a0 kernel/locking/spinlock_debug.c:114 spin_lock_irq include/linux/spinlock.h:374 [inline] post_one_notification.isra.0+0x59/0x990 kernel/watch_queue.c:86 __post_watch_notification kernel/watch_queue.c:206 [inline] __post_watch_notification+0x561/0x840 kernel/watch_queue.c:176 post_watch_notification include/linux/watch_queue.h:109 [inline] notify_key security/keys/internal.h:199 [inline] __key_update security/keys/key.c:775 [inline] key_create_or_update+0xdbf/0xde0 security/keys/key.c:979 __do_sys_add_key+0x215/0x430 security/keys/keyctl.c:134 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:0x7ff7da089049 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:00007ff7db1e3168 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8 RAX: ffffffffffffffda RBX: 00007ff7da19bf60 RCX: 00007ff7da089049 RDX: 00000000200000c0 RSI: 0000000020000080 RDI: 0000000020000040 RBP: 00007ff7da0e308d R08: fffffffffffffffc R09: 0000000000000000 R10: 0000000000000048 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffceb84149f R14: 00007ff7db1e3300 R15: 0000000000022000 Allocated by task 26160: 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:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:524 kasan_kmalloc include/linux/kasan.h:234 [inline] kmem_cache_alloc_trace+0x1ea/0x4a0 mm/slab.c:3583 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] alloc_pipe_info+0x105/0x590 fs/pipe.c:790 get_pipe_inode fs/pipe.c:881 [inline] create_pipe_files+0x8d/0x880 fs/pipe.c:913 __do_pipe_flags fs/pipe.c:962 [inline] do_pipe2+0x96/0x1b0 fs/pipe.c:1010 __do_sys_pipe2 fs/pipe.c:1028 [inline] __se_sys_pipe2 fs/pipe.c:1026 [inline] __x64_sys_pipe2+0x50/0x70 fs/pipe.c:1026 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 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3595 inet6_ifa_finish_destroy+0x153/0x1b0 net/ipv6/addrconf.c:976 in6_ifa_put include/net/addrconf.h:416 [inline] addrconf_ifdown.isra.0+0x109f/0x16b0 net/ipv6/addrconf.c:3866 addrconf_notify+0xeb/0x1ba0 net/ipv6/addrconf.c:3662 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1938 call_netdevice_notifiers_extack net/core/dev.c:1976 [inline] call_netdevice_notifiers net/core/dev.c:1990 [inline] __dev_notify_flags+0x1da/0x2b0 net/core/dev.c:8473 dev_change_flags+0x112/0x170 net/core/dev.c:8509 do_setlink+0x96d/0x3a20 net/core/rtnetlink.c:2731 rtnl_group_changelink net/core/rtnetlink.c:3265 [inline] __rtnl_newlink+0xc18/0x1760 net/core/rtnetlink.c:3421 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3531 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5990 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2496 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x6e2/0x800 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496 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 Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x62e/0x1140 kernel/workqueue.c:1517 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1461 [inline] __run_timers.part.0+0x4a6/0xa30 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 The buggy address belongs to the object at ffff888011914c00 which belongs to the cache kmalloc-cg-512 of size 512 The buggy address is located 148 bytes inside of 512-byte region [ffff888011914c00, ffff888011914e00) The buggy address belongs to the physical page: page:ffffea0000464500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11914 memcg:ffff88802b3549c1 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000462708 ffffea00007699c8 ffff888010c43a00 raw: 0000000000000000 ffff888011914000 0000000100000004 ffff88802b3549c1 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2c20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 11432, tgid 11431 (syz-executor.2), ts 617172053821, free_ts 607488201421 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0xba2/0x3e00 mm/page_alloc.c:4182 __alloc_pages_slowpath.constprop.0+0x2eb/0x20e0 mm/page_alloc.c:4953 __alloc_pages+0x412/0x500 mm/page_alloc.c:5421 __alloc_pages_node include/linux/gfp.h:587 [inline] kmem_getpages mm/slab.c:1378 [inline] cache_grow_begin+0x75/0x350 mm/slab.c:2584 cache_alloc_refill+0x27f/0x380 mm/slab.c:2957 ____cache_alloc mm/slab.c:3040 [inline] ____cache_alloc mm/slab.c:3023 [inline] slab_alloc_node mm/slab.c:3241 [inline] kmem_cache_alloc_node_trace+0x518/0x5b0 mm/slab.c:3625 __do_kmalloc_node mm/slab.c:3647 [inline] __kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3662 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1300 [inline] alloc_skb_with_frags+0x93/0x730 net/core/skbuff.c:5995 sock_alloc_send_pskb+0x793/0x920 net/core/sock.c:2600 unix_dgram_sendmsg+0x414/0x1a90 net/unix/af_unix.c:1896 unix_seqpacket_sendmsg+0x111/0x1a0 net/unix/af_unix.c:2346 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x6e2/0x800 net/socket.c:2413 __sys_sendmsg_sock+0x26/0x30 net/socket.c:2479 io_sendmsg+0x1da/0x5a0 fs/io_uring.c:5241 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1356 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3328 [inline] free_unref_page+0x19/0x6a0 mm/page_alloc.c:3423 __vunmap+0x8e8/0xe10 mm/vmalloc.c:2675 free_work+0x58/0x70 mm/vmalloc.c:97 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Memory state around the buggy address: ffff888011914b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888011914c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888011914c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888011914d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888011914d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================