================================================================== 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 ffff8880611cb818 by task syz.8.3459/19371 CPU: 0 UID: 0 PID: 19371 Comm: syz.8.3459 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP 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/0x1a0 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+0xf5/0x330 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: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+0x33b/0x430 drivers/virtio/virtio_ring.c:2718 __handle_irq_event_percpu+0x232/0x800 kernel/irq/handle.c:211 handle_irq_event_percpu kernel/irq/handle.c:248 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:265 handle_edge_irq+0x375/0x970 kernel/irq/chip.c:855 generic_handle_irq_desc include/linux/irqdesc.h:172 [inline] handle_irq arch/x86/kernel/irq.c:255 [inline] call_irq_handler arch/x86/kernel/irq.c:311 [inline] __common_interrupt+0xd8/0x2f0 arch/x86/kernel/irq.c:326 common_interrupt+0x60/0xe0 arch/x86/kernel/irq.c:319 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:688 RIP: 0010:handle_softirqs+0x1ad/0x910 kernel/softirq.c:608 Code: 20 44 88 74 24 1e 45 89 ee 48 c7 c7 e0 6f 8d 8b e8 f8 e5 ac 09 31 d2 65 66 89 15 d6 a8 1c 12 e8 d9 0a 47 00 fb bb ff ff ff ff <49> c7 c4 c0 c0 20 8e 41 0f bc de 83 c3 01 0f 85 a4 00 00 00 e9 ab RSP: 0000:ffffc90000007f30 EFLAGS: 00000206 RAX: 000000000002ee88 RBX: 00000000ffffffff RCX: 0000000000000004 RDX: 0000000000000000 RSI: ffffffff8dc413ca RDI: ffffffff8bfa32a0 RBP: 0000000100013bc3 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000001 R12: 000000000000000a R13: 0000000000000200 R14: 0000000000000200 R15: 1ffff92000000fed __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xef/0x150 kernel/softirq.c:723 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline] sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1056 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 RIP: 0010:__mutex_lock_common kernel/locking/mutex.c:616 [inline] RIP: 0010:__mutex_lock+0x1a2/0x1b90 kernel/locking/mutex.c:776 Code: f6 48 8d 43 68 31 c9 31 d2 4d 89 e9 48 89 85 88 fe ff ff 48 89 c7 41 b8 01 00 00 00 44 89 e6 ff b5 a8 fe ff ff e8 9e d6 6c f6 21 00 00 00 48 89 df e8 61 d6 6b f6 be 08 00 00 00 48 89 df 48 RSP: 0000:ffffc9000e1f7668 EFLAGS: 00000296 RAX: 0000000000000000 RBX: ffff888025df5d10 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff8dc1b439 RDI: ffffffff8bfa32a0 RBP: ffffc9000e1f77f0 R08: 00000000c565a97f R09: 000000000000067a R10: 0000000000000200 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: dffffc0000000000 R15: 0000000000000000 __unix_dgram_recvmsg+0x255/0xc30 net/unix/af_unix.c:2573 unix_dgram_recvmsg+0xd0/0x110 net/unix/af_unix.c:2675 sock_recvmsg_nosec net/socket.c:1078 [inline] ____sys_recvmsg+0x5f7/0x6b0 net/socket.c:2810 ___sys_recvmsg+0x16a/0x1a0 net/socket.c:2854 do_recvmmsg+0x563/0x760 net/socket.c:2941 __sys_recvmmsg+0x21f/0x270 net/socket.c:3023 __do_compat_sys_recvmmsg_time32 net/compat.c:418 [inline] __se_compat_sys_recvmmsg_time32 net/compat.c:414 [inline] __ia32_compat_sys_recvmmsg_time32+0xc4/0x160 net/compat.c:414 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xde/0x660 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 RIP: 0023:0xf73ad579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 2e 8d b4 26 00 00 00 00 8d b4 26 00 00 00 RSP: 002b:00000000f53b550c EFLAGS: 00000292 ORIG_RAX: 0000000000000151 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000080000040 RDX: 00000000080002c1 RSI: 0000000000000002 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 19378: 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:957 [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:1751 fc_mount fs/namespace.c:1199 [inline] do_new_mount_fc fs/namespace.c:3636 [inline] do_new_mount fs/namespace.c:3712 [inline] path_mount+0x7d0/0x23c0 fs/namespace.c:4022 do_mount fs/namespace.c:4035 [inline] __do_sys_mount fs/namespace.c:4224 [inline] __se_sys_mount fs/namespace.c:4201 [inline] __ia32_sys_mount+0x292/0x310 fs/namespace.c:4201 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xde/0x660 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 19378: 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:2540 [inline] slab_free mm/slub.c:6674 [inline] kfree+0x1c7/0x690 mm/slub.c:6882 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:1751 fc_mount fs/namespace.c:1199 [inline] do_new_mount_fc fs/namespace.c:3636 [inline] do_new_mount fs/namespace.c:3712 [inline] path_mount+0x7d0/0x23c0 fs/namespace.c:4022 do_mount fs/namespace.c:4035 [inline] __do_sys_mount fs/namespace.c:4224 [inline] __se_sys_mount fs/namespace.c:4201 [inline] __ia32_sys_mount+0x292/0x310 fs/namespace.c:4201 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xde/0x660 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 ffff8880611cb800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff8880611cb800, ffff8880611cba00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x611c8 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 ksm flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801b842c80 ffffea0000967200 dead000000000003 raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff88801b842c80 ffffea0000967200 dead000000000003 head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 04fff00000000002 ffffea0001847201 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 5955, tgid 5955 (syz-executor), ts 119499456738, free_ts 119492596131 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1e1/0x250 mm/page_alloc.c:1884 prep_new_page mm/page_alloc.c:1892 [inline] get_page_from_freelist+0xe3d/0x2e10 mm/page_alloc.c:3945 __alloc_frozen_pages_noprof+0x26c/0x2410 mm/page_alloc.c:5240 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x2c4/0x440 mm/slub.c:3302 ___slab_alloc+0xda3/0x1ca0 mm/slub.c:4656 __slab_alloc.isra.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __kmalloc_cache_noprof+0x531/0x810 mm/slub.c:5775 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] inetdev_init+0x66/0x570 net/ipv4/devinet.c:273 inetdev_event+0x7fa/0x17f0 net/ipv4/devinet.c:1590 notifier_call_chain+0x99/0x3b0 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2243 call_netdevice_notifiers_extack net/core/dev.c:2281 [inline] call_netdevice_notifiers net/core/dev.c:2295 [inline] register_netdevice+0x16b9/0x21d0 net/core/dev.c:11444 team_newlink+0xb4/0x190 drivers/net/team/team_core.c:2150 rtnl_newlink_create net/core/rtnetlink.c:3840 [inline] __rtnl_newlink net/core/rtnetlink.c:3957 [inline] rtnl_newlink+0x1494/0x2380 net/core/rtnetlink.c:4072 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:6958 page last free pid 5955 tgid 5955 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0x822/0x1130 mm/page_alloc.c:2973 stack_depot_save_flags+0x412/0x9c0 lib/stackdepot.c:727 kasan_save_stack+0x3f/0x50 mm/kasan/common.c:58 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:957 [inline] netdev_name_node_alloc net/core/dev.c:270 [inline] netdev_name_node_head_alloc net/core/dev.c:284 [inline] register_netdevice+0x50c/0x21d0 net/core/dev.c:11327 team_newlink+0xb4/0x190 drivers/net/team/team_core.c:2150 rtnl_newlink_create net/core/rtnetlink.c:3840 [inline] __rtnl_newlink net/core/rtnetlink.c:3957 [inline] rtnl_newlink+0x1494/0x2380 net/core/rtnetlink.c:4072 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:6958 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2550 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x5aa/0x870 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg net/socket.c:742 [inline] __sys_sendto+0x4aa/0x520 net/socket.c:2206 __do_compat_sys_socketcall net/compat.c:475 [inline] __se_compat_sys_socketcall net/compat.c:423 [inline] __ia32_compat_sys_socketcall+0x59a/0x770 net/compat.c:423 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] do_int80_emulation+0x101/0x470 arch/x86/entry/syscall_32.c:172 asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:621 Memory state around the buggy address: ffff8880611cb700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880611cb780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880611cb800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880611cb880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880611cb900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 20 44 88 74 and %al,0x74(%rax,%rcx,4) 4: 24 1e and $0x1e,%al 6: 45 89 ee mov %r13d,%r14d 9: 48 c7 c7 e0 6f 8d 8b mov $0xffffffff8b8d6fe0,%rdi 10: e8 f8 e5 ac 09 call 0x9ace60d 15: 31 d2 xor %edx,%edx 17: 65 66 89 15 d6 a8 1c mov %dx,%gs:0x121ca8d6(%rip) # 0x121ca8f5 1e: 12 1f: e8 d9 0a 47 00 call 0x470afd 24: fb sti 25: bb ff ff ff ff mov $0xffffffff,%ebx * 2a: 49 c7 c4 c0 c0 20 8e mov $0xffffffff8e20c0c0,%r12 <-- trapping instruction 31: 41 0f bc de bsf %r14d,%ebx 35: 83 c3 01 add $0x1,%ebx 38: 0f 85 a4 00 00 00 jne 0xe2 3e: e9 .byte 0xe9 3f: ab stos %eax,%es:(%rdi)