================================================================== BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x271/0x2c0 kernel/locking/spinlock_debug.c:115 Read of size 4 at addr ffff888035a2c404 by task kworker/3:1/59 CPU: 3 UID: 0 PID: 59 Comm: kworker/3:1 Not tainted 6.14.0-rc7-syzkaller-00069-g81e4f8d68c66 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: rcu_gp process_srcu Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xc3/0x670 mm/kasan/report.c:521 kasan_report+0xd9/0x110 mm/kasan/report.c:634 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock+0x271/0x2c0 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:162 p9_tag_remove net/9p/client.c:397 [inline] p9_req_put net/9p/client.c:405 [inline] p9_req_put+0xaf/0x250 net/9p/client.c:402 req_done+0x1e7/0x2f0 net/9p/trans_virtio.c:147 vring_interrupt drivers/virtio/virtio_ring.c:2715 [inline] vring_interrupt+0x31b/0x400 drivers/virtio/virtio_ring.c:2690 __handle_irq_event_percpu+0x229/0x7d0 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:210 handle_edge_irq+0x263/0xd10 kernel/irq/chip.c:831 generic_handle_irq_desc include/linux/irqdesc.h:173 [inline] handle_irq arch/x86/kernel/irq.c:249 [inline] call_irq_handler arch/x86/kernel/irq.c:261 [inline] __common_interrupt+0xdf/0x250 arch/x86/kernel/irq.c:287 common_interrupt+0xba/0xe0 arch/x86/kernel/irq.c:280 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:preempt_latency_start kernel/sched/core.c:5837 [inline] RIP: 0010:preempt_count_add+0x5e/0x150 kernel/sched/core.c:5863 Code: 08 84 d2 0f 85 dd 00 00 00 8b 15 cd bb 03 19 85 d2 75 0b 65 8b 05 6a 7c 7b 7e 3c f4 77 6b 65 8b 05 5f 7c 7b 7e 25 ff ff ff 7f <39> c3 74 07 5b 5d c3 cc cc cc cc 48 8b 5c 24 10 48 89 df e8 7a b4 RSP: 0018:ffffc90000abfab8 EFLAGS: 00000202 RAX: 0000000000000001 RBX: 0000000000000001 RCX: 1ffffffff3518314 RDX: 0000000000000000 RSI: ffffffff8bd36920 RDI: 0000000000000001 RBP: 0000002001bb2b3a R08: 0000000000000001 R09: ffffed102dba8d38 R10: ffff88816dd469c7 R11: 0000000000000002 R12: 0000000000000003 R13: 00000000000032c9 R14: ffffffff9a8f4fe0 R15: 0000000000001a10 delay_tsc+0x3c/0xc0 arch/x86/lib/delay.c:79 udelay include/asm-generic/delay.h:64 [inline] try_check_zero+0x3c6/0x5a0 kernel/rcu/srcutree.c:1112 srcu_advance_state kernel/rcu/srcutree.c:1742 [inline] process_srcu+0x575/0x1720 kernel/rcu/srcutree.c:1851 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3400 kthread+0x3af/0x750 kernel/kthread.c:464 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 6223: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kmalloc_noprof include/linux/slab.h:901 [inline] p9_client_create+0xc8/0x1200 net/9p/client.c:985 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xa30 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8b/0x340 fs/super.c:1814 do_new_mount fs/namespace.c:3560 [inline] path_mount+0x14e6/0x1f10 fs/namespace.c:3887 do_mount fs/namespace.c:3900 [inline] __do_sys_mount fs/namespace.c:4111 [inline] __se_sys_mount fs/namespace.c:4088 [inline] __x64_sys_mount+0x28f/0x310 fs/namespace.c:4088 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6223: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4609 [inline] kfree+0x2c4/0x4d0 mm/slub.c:4757 p9_client_create+0xa58/0x1200 net/9p/client.c:1064 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xa30 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8b/0x340 fs/super.c:1814 do_new_mount fs/namespace.c:3560 [inline] path_mount+0x14e6/0x1f10 fs/namespace.c:3887 do_mount fs/namespace.c:3900 [inline] __do_sys_mount fs/namespace.c:4111 [inline] __se_sys_mount fs/namespace.c:4088 [inline] __x64_sys_mount+0x28f/0x310 fs/namespace.c:4088 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888035a2c400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 4 bytes inside of freed 512-byte region [ffff888035a2c400, ffff888035a2c600) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x35a2c head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b042c80 0000000000000000 0000000000000001 raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b042c80 0000000000000000 0000000000000001 head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea0000d68b01 ffffffffffffffff 0000000000000000 head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5940, tgid 5940 (syz-executor), ts 46356063826, free_ts 46355207819 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x221/0x2470 mm/page_alloc.c:4740 alloc_pages_mpol+0x1fc/0x540 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2587 [inline] new_slab+0x23d/0x330 mm/slub.c:2640 ___slab_alloc+0xc5d/0x1720 mm/slub.c:3826 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __do_kmalloc_node mm/slub.c:4293 [inline] __kmalloc_noprof+0x2ec/0x510 mm/slub.c:4306 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] tnode_alloc net/ipv4/fib_trie.c:327 [inline] tnode_new+0x25a/0x340 net/ipv4/fib_trie.c:380 inflate net/ipv4/fib_trie.c:540 [inline] resize+0xa2b/0x2250 net/ipv4/fib_trie.c:864 trie_rebalance net/ipv4/fib_trie.c:1101 [inline] fib_insert_node net/ipv4/fib_trie.c:1145 [inline] fib_insert_alias+0x9c0/0xe30 net/ipv4/fib_trie.c:1159 fib_table_insert+0xaab/0x1d70 net/ipv4/fib_trie.c:1373 fib_magic+0x4d6/0x5c0 net/ipv4/fib_frontend.c:1112 fib_add_ifaddr+0x174/0x560 net/ipv4/fib_frontend.c:1134 fib_inetaddr_event+0x174/0x2c0 net/ipv4/fib_frontend.c:1448 notifier_call_chain+0xb7/0x410 kernel/notifier.c:85 page last free pid 5940 tgid 5940 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0x6db/0xfb0 mm/page_alloc.c:2660 __put_partials+0x14c/0x170 mm/slub.c:3153 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4115 [inline] slab_alloc_node mm/slub.c:4164 [inline] kmem_cache_alloc_node_noprof+0x223/0x3c0 mm/slub.c:4216 __alloc_skb+0x2b1/0x380 net/core/skbuff.c:596 alloc_skb include/linux/skbuff.h:1331 [inline] netlink_alloc_large_skb+0x69/0x130 net/netlink/af_netlink.c:1186 netlink_sendmsg+0x689/0xd70 net/netlink/af_netlink.c:1857 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:733 [inline] __sys_sendto+0x488/0x4f0 net/socket.c:2187 __do_sys_sendto net/socket.c:2194 [inline] __se_sys_sendto net/socket.c:2190 [inline] __x64_sys_sendto+0xe0/0x1c0 net/socket.c:2190 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888035a2c300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888035a2c380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888035a2c400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888035a2c480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888035a2c500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 08 84 d2 0f 85 dd 00 or %al,0xdd850f(%rdx,%rdx,8) 7: 00 00 add %al,(%rax) 9: 8b 15 cd bb 03 19 mov 0x1903bbcd(%rip),%edx # 0x1903bbdc f: 85 d2 test %edx,%edx 11: 75 0b jne 0x1e 13: 65 8b 05 6a 7c 7b 7e mov %gs:0x7e7b7c6a(%rip),%eax # 0x7e7b7c84 1a: 3c f4 cmp $0xf4,%al 1c: 77 6b ja 0x89 1e: 65 8b 05 5f 7c 7b 7e mov %gs:0x7e7b7c5f(%rip),%eax # 0x7e7b7c84 25: 25 ff ff ff 7f and $0x7fffffff,%eax * 2a: 39 c3 cmp %eax,%ebx <-- trapping instruction 2c: 74 07 je 0x35 2e: 5b pop %rbx 2f: 5d pop %rbp 30: c3 ret 31: cc int3 32: cc int3 33: cc int3 34: cc int3 35: 48 8b 5c 24 10 mov 0x10(%rsp),%rbx 3a: 48 89 df mov %rbx,%rdi 3d: e8 .byte 0xe8 3e: 7a b4 jp 0xfffffff4