================================================================== BUG: KASAN: slab-use-after-free in __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [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 ffff88804683a018 by task syz.2.565/7974 CPU: 3 UID: 0 PID: 7974 Comm: syz.2.565 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 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:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 __kasan_check_byte+0x36/0x50 mm/kasan/common.c:580 kasan_check_byte include/linux/kasan.h:401 [inline] lock_acquire kernel/locking/lockdep.c:5842 [inline] lock_acquire+0xfc/0x350 kernel/locking/lockdep.c:5825 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/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+0x1dc/0x2e0 net/9p/trans_virtio.c:147 vring_interrupt drivers/virtio/virtio_ring.c:2718 [inline] vring_interrupt+0x31e/0x400 drivers/virtio/virtio_ring.c:2693 __handle_irq_event_percpu+0x236/0x920 kernel/irq/handle.c:203 handle_irq_event_percpu kernel/irq/handle.c:240 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:257 handle_edge_irq+0x3ca/0x9e0 kernel/irq/chip.c:855 generic_handle_irq_desc include/linux/irqdesc.h:173 [inline] handle_irq arch/x86/kernel/irq.c:254 [inline] call_irq_handler arch/x86/kernel/irq.c:310 [inline] __common_interrupt+0xd0/0x2f0 arch/x86/kernel/irq.c:325 common_interrupt+0xba/0xe0 arch/x86/kernel/irq.c:318 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:688 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:194 Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 26 88 35 f6 48 89 df e8 0e dc 35 f6 f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 35 e4 25 f6 65 8b 05 7e 45 3e 08 85 c0 74 16 5b RSP: 0018:ffffc90003a2fb78 EFLAGS: 00000246 RAX: 0000000000000002 RBX: ffff888023cf5350 RCX: ffffffff81c4e99f RDX: 0000000000000000 RSI: ffffffff8da2b720 RDI: ffffffff8bf070c0 RBP: 0000000000000287 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff90820cd7 R11: 0000000000000002 R12: ffff888023cf5350 R13: ffff888023cf4914 R14: ffff888023cf4900 R15: ffff888023cf534f class_raw_spinlock_irqsave_destructor include/linux/spinlock.h:557 [inline] try_to_wake_up+0xa5d/0x1870 kernel/sched/core.c:4181 wake_up_process kernel/sched/core.c:4424 [inline] wake_up_q+0xa1/0x130 kernel/sched/core.c:1086 futex_wake+0x460/0x530 kernel/futex/waitwake.c:198 do_futex+0x1e3/0x350 kernel/futex/syscalls.c:135 __do_sys_futex kernel/futex/syscalls.c:207 [inline] __se_sys_futex kernel/futex/syscalls.c:188 [inline] __x64_sys_futex+0x1e0/0x4c0 kernel/futex/syscalls.c:188 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f33f2d8f6c9 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc570b4308 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: ffffffffffffffda RBX: 00007f33f2fe5fa8 RCX: 00007f33f2d8f6c9 RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f33f2fe5fa8 RBP: 0000000000000000 R08: 0000000000000008 R09: 00000002570b45ff R10: 00007f33f2fe5fa0 R11: 0000000000000246 R12: 00007f33f2fe5fac R13: 00007f33f2fe5fa0 R14: 0000000000001097 R15: 0000000000000005 Allocated by task 7975: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:417 kmalloc_noprof include/linux/slab.h:957 [inline] p9_client_create+0xc7/0x11d0 net/9p/client.c:985 v9fs_session_init+0x1f7/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc5/0xa90 fs/9p/vfs_super.c:122 legacy_get_tree+0x10c/0x220 fs/fs_context.c:663 vfs_get_tree+0x8e/0x340 fs/super.c:1751 fc_mount fs/namespace.c:1208 [inline] do_new_mount_fc fs/namespace.c:3651 [inline] do_new_mount fs/namespace.c:3727 [inline] path_mount+0x7b9/0x23a0 fs/namespace.c:4037 do_mount fs/namespace.c:4050 [inline] __do_sys_mount fs/namespace.c:4238 [inline] __se_sys_mount fs/namespace.c:4215 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4215 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 7975: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 __kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2539 [inline] slab_free mm/slub.c:6634 [inline] kfree+0x2b8/0x6d0 mm/slub.c:6841 p9_client_create+0xa28/0x11d0 net/9p/client.c:1064 v9fs_session_init+0x1f7/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc5/0xa90 fs/9p/vfs_super.c:122 legacy_get_tree+0x10c/0x220 fs/fs_context.c:663 vfs_get_tree+0x8e/0x340 fs/super.c:1751 fc_mount fs/namespace.c:1208 [inline] do_new_mount_fc fs/namespace.c:3651 [inline] do_new_mount fs/namespace.c:3727 [inline] path_mount+0x7b9/0x23a0 fs/namespace.c:4037 do_mount fs/namespace.c:4050 [inline] __do_sys_mount fs/namespace.c:4238 [inline] __se_sys_mount fs/namespace.c:4215 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4215 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88804683a000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff88804683a000, ffff88804683a200) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x46838 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 ffff88801b442c80 0000000000000000 dead000000000001 raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b442c80 0000000000000000 dead000000000001 head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea00011a0e01 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5952, tgid 5952 (syz-executor), ts 115890938591, free_ts 115871697323 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x10a3/0x3a30 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x25f/0x2470 mm/page_alloc.c:5183 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3055 [inline] allocate_slab mm/slub.c:3228 [inline] new_slab+0x24a/0x360 mm/slub.c:3282 ___slab_alloc+0xd79/0x1a50 mm/slub.c:4651 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4774 __slab_alloc_node mm/slub.c:4850 [inline] slab_alloc_node mm/slub.c:5272 [inline] __do_kmalloc_node mm/slub.c:5645 [inline] __kmalloc_noprof+0x501/0x880 mm/slub.c:5658 kmalloc_noprof include/linux/slab.h:961 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] fib6_info_alloc+0x40/0x160 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x14c/0x870 net/ipv6/route.c:3809 ip6_route_add.part.0+0x22/0x1d0 net/ipv6/route.c:3938 ip6_route_add+0x45/0x60 net/ipv6/route.c:3935 addrconf_prefix_route+0x2fd/0x510 net/ipv6/addrconf.c:2488 fixup_permanent_addr net/ipv6/addrconf.c:3598 [inline] addrconf_permanent_addr net/ipv6/addrconf.c:3622 [inline] addrconf_notify+0x12c6/0x19e0 net/ipv6/addrconf.c:3694 notifier_call_chain+0xbc/0x410 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:2229 page last free pid 5963 tgid 5963 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0x7df/0x1160 mm/page_alloc.c:2906 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4d/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:352 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4974 [inline] slab_alloc_node mm/slub.c:5284 [inline] __kmalloc_cache_noprof+0x274/0x780 mm/slub.c:5762 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] psp_dev_create+0x184/0x580 net/psp/psp_main.c:66 nsim_psp_init+0x92/0x150 drivers/net/netdevsim/psp.c:217 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:1064 [inline] nsim_create+0xe00/0x13f0 drivers/net/netdevsim/netdev.c:1141 __nsim_dev_port_add+0x435/0x7d0 drivers/net/netdevsim/dev.c:1438 nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1494 [inline] nsim_drv_probe+0xe40/0x1520 drivers/net/netdevsim/dev.c:1653 call_driver_probe drivers/base/dd.c:581 [inline] really_probe+0x241/0xa90 drivers/base/dd.c:659 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:801 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:831 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:959 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:462 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:1031 Memory state around the buggy address: ffff888046839f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888046839f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88804683a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804683a080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804683a100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: f5 cmc 1: 53 push %rbx 2: 48 8b 74 24 10 mov 0x10(%rsp),%rsi 7: 48 89 fb mov %rdi,%rbx a: 48 83 c7 18 add $0x18,%rdi e: e8 26 88 35 f6 call 0xf6358839 13: 48 89 df mov %rbx,%rdi 16: e8 0e dc 35 f6 call 0xf635dc29 1b: f7 c5 00 02 00 00 test $0x200,%ebp 21: 75 23 jne 0x46 23: 9c pushf 24: 58 pop %rax 25: f6 c4 02 test $0x2,%ah 28: 75 37 jne 0x61 * 2a: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction 2f: e8 35 e4 25 f6 call 0xf625e469 34: 65 8b 05 7e 45 3e 08 mov %gs:0x83e457e(%rip),%eax # 0x83e45b9 3b: 85 c0 test %eax,%eax 3d: 74 16 je 0x55 3f: 5b pop %rbx