================================================================== BUG: KASAN: slab-use-after-free in __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:132 [inline] BUG: KASAN: slab-use-after-free in _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 Read of size 1 at addr ffff888024cf0418 by task swapper/0/0 CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x156/0x4c9 mm/kasan/report.c:482 kasan_report+0xdf/0x1e0 mm/kasan/report.c:595 __kasan_check_byte+0x36/0x50 mm/kasan/common.c:574 kasan_check_byte include/linux/kasan.h:402 [inline] lock_acquire kernel/locking/lockdep.c:5842 [inline] lock_acquire+0x148/0x380 kernel/locking/lockdep.c:5825 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:132 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 p9_tag_remove net/9p/client.c:274 [inline] p9_req_put net/9p/client.c:282 [inline] p9_req_put+0xaf/0x250 net/9p/client.c:279 req_done+0x1dc/0x2e0 net/9p/trans_virtio.c:147 vring_interrupt+0x2ef/0x650 drivers/virtio/virtio_ring.c:3255 __handle_irq_event_percpu+0x232/0x8e0 kernel/irq/handle.c:209 handle_irq_event_percpu kernel/irq/handle.c:246 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:263 handle_edge_irq+0x375/0x970 kernel/irq/chip.c:855 generic_handle_irq_desc include/linux/irqdesc.h:186 [inline] handle_irq arch/x86/kernel/irq.c:262 [inline] call_irq_handler arch/x86/kernel/irq.c:318 [inline] __common_interrupt+0xd8/0x2f0 arch/x86/kernel/irq.c:333 common_interrupt+0xb9/0xe0 arch/x86/kernel/irq.c:326 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:688 RIP: 0010:sched_core_balance+0x9f/0xe20 kernel/sched/core.c:6326 Code: 92 7e 8e e8 63 ef 0d 00 e8 ce d6 b5 09 41 5a 85 c0 0f 85 28 0a 00 00 4c 89 ef e8 fc 35 ff ff e8 07 ad 39 00 fb 48 63 44 24 50 <48> c7 c3 80 72 0e 94 48 89 dd 48 89 44 24 08 48 83 f8 08 0f 83 4c RSP: 0000:ffffffff8e407b70 EFLAGS: 00000202 RAX: 0000000000000000 RBX: ffff88802b23b280 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff8de76c50 RDI: ffffffff8c1ae520 RBP: ffffffff8e407c88 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff8e4975c0 R13: ffff88802b23b280 R14: 0000000000000000 R15: dffffc0000000000 do_balance_callbacks kernel/sched/core.c:4926 [inline] __balance_callbacks kernel/sched/core.c:4982 [inline] finish_lock_switch kernel/sched/core.c:5031 [inline] finish_task_switch.isra.0+0x446/0xb80 kernel/sched/core.c:5150 context_switch kernel/sched/core.c:5298 [inline] __schedule+0xff6/0x60e0 kernel/sched/core.c:6907 schedule_idle+0x54/0x80 kernel/sched/core.c:7030 do_idle+0x289/0x4b0 kernel/sched/idle.c:360 cpu_startup_entry+0x4f/0x60 kernel/sched/idle.c:430 rest_init+0x251/0x260 init/main.c:760 start_kernel+0x47f/0x480 init/main.c:1210 x86_64_start_reservations+0x24/0x30 arch/x86/kernel/head64.c:310 x86_64_start_kernel+0x12b/0x130 arch/x86/kernel/head64.c:291 common_startup_64+0x13e/0x148 Allocated by task 8791: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kmalloc_noprof include/linux/slab.h:962 [inline] p9_client_create+0xaf/0xd40 net/9p/client.c:862 v9fs_session_init+0x40/0xce0 fs/9p/v9fs.c:442 v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97 vfs_get_tree+0x92/0x320 fs/super.c:1754 fc_mount fs/namespace.c:1193 [inline] do_new_mount_fc fs/namespace.c:3760 [inline] do_new_mount fs/namespace.c:3836 [inline] path_mount+0x7d0/0x23d0 fs/namespace.c:4146 do_mount fs/namespace.c:4159 [inline] __do_sys_mount fs/namespace.c:4348 [inline] __se_sys_mount fs/namespace.c:4325 [inline] __ia32_sys_mount+0x292/0x310 fs/namespace.c:4325 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe3/0x8c0 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 8791: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2687 [inline] slab_free mm/slub.c:6124 [inline] kfree+0x1f6/0x6b0 mm/slub.c:6442 p9_client_create+0x72d/0xd40 net/9p/client.c:941 v9fs_session_init+0x40/0xce0 fs/9p/v9fs.c:442 v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97 vfs_get_tree+0x92/0x320 fs/super.c:1754 fc_mount fs/namespace.c:1193 [inline] do_new_mount_fc fs/namespace.c:3760 [inline] do_new_mount fs/namespace.c:3836 [inline] path_mount+0x7d0/0x23d0 fs/namespace.c:4146 do_mount fs/namespace.c:4159 [inline] __do_sys_mount fs/namespace.c:4348 [inline] __se_sys_mount fs/namespace.c:4325 [inline] __ia32_sys_mount+0x292/0x310 fs/namespace.c:4325 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe3/0x8c0 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff888024cf0400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff888024cf0400, ffff888024cf0600) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x24cf0 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b842c80 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b842c80 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea0000933c01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 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 99, tgid 99 (kworker/u32:4), ts 56533371445, free_ts 56064526030 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x153/0x170 mm/page_alloc.c:1888 prep_new_page mm/page_alloc.c:1896 [inline] get_page_from_freelist+0x111d/0x3140 mm/page_alloc.c:3961 __alloc_frozen_pages_noprof+0x27c/0x2ba0 mm/page_alloc.c:5249 alloc_slab_page mm/slub.c:3255 [inline] allocate_slab mm/slub.c:3444 [inline] new_slab+0xa6/0x6d0 mm/slub.c:3502 refill_objects+0x26b/0x400 mm/slub.c:7134 refill_sheaf mm/slub.c:2804 [inline] alloc_full_sheaf mm/slub.c:2825 [inline] __pcs_replace_empty_main+0x19f/0x600 mm/slub.c:4588 alloc_from_pcs mm/slub.c:4681 [inline] slab_alloc_node mm/slub.c:4815 [inline] __do_kmalloc_node mm/slub.c:5218 [inline] __kmalloc_noprof+0x688/0x850 mm/slub.c:5231 kmalloc_noprof include/linux/slab.h:966 [inline] kzalloc_noprof include/linux/slab.h:1204 [inline] fib6_info_alloc+0x40/0x160 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x14c/0xad0 net/ipv6/route.c:3819 ip6_route_add+0x4b/0x1d0 net/ipv6/route.c:3948 addrconf_add_mroute+0x1de/0x350 net/ipv6/addrconf.c:2552 addrconf_add_dev+0x14e/0x1a0 net/ipv6/addrconf.c:2570 addrconf_dev_config net/ipv6/addrconf.c:3484 [inline] addrconf_init_auto_addrs+0x10e/0x780 net/ipv6/addrconf.c:3572 addrconf_notify+0x9aa/0x19c0 net/ipv6/addrconf.c:3745 notifier_call_chain+0x99/0x420 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2242 page last free pid 2 tgid 2 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1432 [inline] __free_frozen_pages+0x7ca/0x10a0 mm/page_alloc.c:2977 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xe0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4501 [inline] slab_alloc_node mm/slub.c:4830 [inline] __kmalloc_cache_noprof+0x243/0x6f0 mm/slub.c:5334 kmalloc_noprof include/linux/slab.h:962 [inline] kzalloc_noprof include/linux/slab.h:1204 [inline] set_kthread_struct+0xcb/0x3a0 kernel/kthread.c:125 copy_process+0x3978/0x7a10 kernel/fork.c:2152 kernel_clone+0xfc/0x9a0 kernel/fork.c:2654 kernel_thread+0xdb/0x120 kernel/fork.c:2715 create_kthread kernel/kthread.c:490 [inline] kthreadd+0x498/0x7a0 kernel/kthread.c:849 ret_from_fork+0x754/0xd80 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888024cf0300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888024cf0380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888024cf0400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888024cf0480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888024cf0500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 92 xchg %eax,%edx 1: 7e 8e jle 0xffffff91 3: e8 63 ef 0d 00 call 0xdef6b 8: e8 ce d6 b5 09 call 0x9b5d6db d: 41 5a pop %r10 f: 85 c0 test %eax,%eax 11: 0f 85 28 0a 00 00 jne 0xa3f 17: 4c 89 ef mov %r13,%rdi 1a: e8 fc 35 ff ff call 0xffff361b 1f: e8 07 ad 39 00 call 0x39ad2b 24: fb sti 25: 48 63 44 24 50 movslq 0x50(%rsp),%rax * 2a: 48 c7 c3 80 72 0e 94 mov $0xffffffff940e7280,%rbx <-- trapping instruction 31: 48 89 dd mov %rbx,%rbp 34: 48 89 44 24 08 mov %rax,0x8(%rsp) 39: 48 83 f8 08 cmp $0x8,%rax 3d: 0f .byte 0xf 3e: 83 .byte 0x83 3f: 4c rex.WR