================================================================== 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 ffff888073f7ac18 by task syz-executor/6127 CPU: 0 UID: 0 PID: 6127 Comm: syz-executor 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~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:573 kasan_check_byte include/linux/kasan.h:401 [inline] lock_acquire kernel/locking/lockdep.c:5842 [inline] lock_acquire+0xfc/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+0x2cf/0x440 drivers/virtio/virtio_ring.c:2718 __handle_irq_event_percpu+0x236/0x890 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+0x3ca/0x9e0 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+0xd0/0x2f0 arch/x86/kernel/irq.c:326 common_interrupt+0xba/0xe0 arch/x86/kernel/irq.c:319 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:688 RIP: 0010:pte_none arch/x86/include/asm/pgtable.h:949 [inline] RIP: 0010:copy_pte_range mm/memory.c:1275 [inline] RIP: 0010:copy_pmd_range mm/memory.c:1392 [inline] RIP: 0010:copy_pud_range mm/memory.c:1429 [inline] RIP: 0010:copy_p4d_range mm/memory.c:1453 [inline] RIP: 0010:copy_page_range+0x129a/0x6780 mm/memory.c:1535 Code: 89 b1 ff 48 8b 44 24 18 48 b9 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 08 00 0f 85 3f 47 00 00 48 8b 44 24 18 31 ff 48 8b 18 <48> 89 dd 48 83 e5 9f 48 89 ee e8 67 84 b1 ff 48 85 ed 0f 84 44 12 RSP: 0018:ffffc9000476f650 EFLAGS: 00000246 RAX: ffff888043ca1840 RBX: 8000000062cdd007 RCX: dffffc0000000000 RDX: ffff8880266b4980 RSI: ffffffff820ccef3 RDI: 0000000000000000 RBP: 0000000000001000 R08: 0000000000000005 R09: 000000000000001f R10: 0000000000000008 R11: ffff8880266b54b0 R12: 0000000000000008 R13: 0000000000000001 R14: 00000000f6600000 R15: ffffea00018b3700 dup_mmap+0xbea/0x20e0 mm/mmap.c:1827 dup_mm kernel/fork.c:1529 [inline] copy_mm kernel/fork.c:1581 [inline] copy_process+0x3b9f/0x7430 kernel/fork.c:2221 kernel_clone+0xfc/0x910 kernel/fork.c:2651 __do_compat_sys_ia32_clone+0xcb/0x110 arch/x86/kernel/sys_ia32.c:254 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe8/0x680 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7f37579 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 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000fffc50bc EFLAGS: 00000292 ORIG_RAX: 0000000000000078 RAX: ffffffffffffffda RBX: 0000000001200011 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000578e54a8 RBP: 00000000f73c6ff4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 31763: 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:397 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:414 kmalloc_noprof include/linux/slab.h:957 [inline] p9_client_create+0xae/0xe40 net/9p/client.c:862 v9fs_session_init+0x40/0xd40 fs/9p/v9fs.c:442 v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97 vfs_get_tree+0x8e/0x330 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+0x7bf/0x23a0 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+0x291/0x310 fs/namespace.c:4201 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe8/0x680 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 31763: 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:584 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:2540 [inline] slab_free mm/slub.c:6668 [inline] kfree+0x2f8/0x6e0 mm/slub.c:6876 p9_client_create+0x6c5/0xe40 net/9p/client.c:941 v9fs_session_init+0x40/0xd40 fs/9p/v9fs.c:442 v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97 vfs_get_tree+0x8e/0x330 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+0x7bf/0x23a0 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+0x291/0x310 fs/namespace.c:4201 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe8/0x680 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff888073f7ac00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff888073f7ac00, ffff888073f7ae00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x73f78 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801b442c80 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff88801b442c80 0000000000000000 dead000000000001 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 04fff00000000002 ffffea0001cfde01 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 28630, tgid 28628 (syz.1.10935), ts 465334332586, free_ts 464597801084 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1846 prep_new_page mm/page_alloc.c:1854 [inline] get_page_from_freelist+0xd0b/0x31a0 mm/page_alloc.c:3915 __alloc_frozen_pages_noprof+0x25f/0x2430 mm/page_alloc.c:5210 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+0x2c3/0x430 mm/slub.c:3302 ___slab_alloc+0xe18/0x1c90 mm/slub.c:4656 __slab_alloc.constprop.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+0x485/0x800 mm/slub.c:5771 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] device_private_init drivers/base/core.c:3534 [inline] device_add+0xcf2/0x1980 drivers/base/core.c:3585 add_one_compat_dev+0x591/0x820 drivers/infiniband/core/device.c:1002 add_compat_devs drivers/infiniband/core/device.c:1063 [inline] enable_device_and_get+0x336/0x3f0 drivers/infiniband/core/device.c:1374 ib_register_device drivers/infiniband/core/device.c:1487 [inline] ib_register_device+0x8de/0xe70 drivers/infiniband/core/device.c:1433 siw_device_register drivers/infiniband/sw/siw/siw_main.c:71 [inline] siw_newlink drivers/infiniband/sw/siw/siw_main.c:430 [inline] siw_newlink+0xb71/0xdc0 drivers/infiniband/sw/siw/siw_main.c:412 nldev_newlink+0x3a6/0x680 drivers/infiniband/core/nldev.c:1797 rdma_nl_rcv_msg+0x38a/0x6e0 drivers/infiniband/core/netlink.c:195 rdma_nl_rcv_skb.constprop.0.isra.0+0x2d0/0x430 drivers/infiniband/core/netlink.c:239 page last free pid 6125 tgid 6125 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x7df/0x1170 mm/page_alloc.c:2943 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4c/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:349 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4953 [inline] slab_alloc_node mm/slub.c:5263 [inline] kmem_cache_alloc_noprof+0x25e/0x770 mm/slub.c:5270 ptlock_alloc+0x1f/0x70 mm/memory.c:7377 ptlock_init include/linux/mm.h:3280 [inline] pagetable_pte_ctor include/linux/mm.h:3334 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:79 [inline] pte_alloc_one+0x84/0x3d0 arch/x86/mm/pgtable.c:18 __pte_alloc+0x6d/0x3f0 mm/memory.c:453 copy_pte_range mm/memory.c:1237 [inline] copy_pmd_range mm/memory.c:1392 [inline] copy_pud_range mm/memory.c:1429 [inline] copy_p4d_range mm/memory.c:1453 [inline] copy_page_range+0x3f3e/0x6780 mm/memory.c:1535 dup_mmap+0xbea/0x20e0 mm/mmap.c:1827 dup_mm kernel/fork.c:1529 [inline] copy_mm kernel/fork.c:1581 [inline] copy_process+0x3b9f/0x7430 kernel/fork.c:2221 kernel_clone+0xfc/0x910 kernel/fork.c:2651 __do_compat_sys_ia32_clone+0xcb/0x110 arch/x86/kernel/sys_ia32.c:254 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe8/0x680 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Memory state around the buggy address: ffff888073f7ab00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888073f7ab80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888073f7ac00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888073f7ac80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888073f7ad00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 89 b1 ff 48 8b 44 mov %esi,0x448b48ff(%rcx) 6: 24 18 and $0x18,%al 8: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx f: fc ff df 12: 48 c1 e8 03 shr $0x3,%rax 16: 80 3c 08 00 cmpb $0x0,(%rax,%rcx,1) 1a: 0f 85 3f 47 00 00 jne 0x475f 20: 48 8b 44 24 18 mov 0x18(%rsp),%rax 25: 31 ff xor %edi,%edi 27: 48 8b 18 mov (%rax),%rbx * 2a: 48 89 dd mov %rbx,%rbp <-- trapping instruction 2d: 48 83 e5 9f and $0xffffffffffffff9f,%rbp 31: 48 89 ee mov %rbp,%rsi 34: e8 67 84 b1 ff call 0xffb184a0 39: 48 85 ed test %rbp,%rbp 3c: 0f .byte 0xf 3d: 84 .byte 0x84 3e: 44 rex.R 3f: 12 .byte 0x12