================================================================== 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 ffff888073c85818 by task syz.2.1293/12495 CPU: 0 UID: 0 PID: 12495 Comm: syz.2.1293 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:568 kasan_check_byte include/linux/kasan.h:399 [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:2719 [inline] vring_interrupt+0x31b/0x400 drivers/virtio/virtio_ring.c:2694 __handle_irq_event_percpu+0x22c/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+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:693 RIP: 0010:write_comp_data+0x0/0x90 kernel/kcov.c:240 Code: 48 8b 05 2b ce 1a 12 48 8b 80 30 16 00 00 c3 cc cc cc cc 0f 1f 80 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 <49> 89 d2 49 89 f8 49 89 f1 65 48 8b 15 f7 cd 1a 12 65 8b 05 08 ce RSP: 0018:ffffc900046ef828 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffff888051320000 RCX: ffffffff8a36787e RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 0000000000000002 R08: 0000000000000001 R09: 0000000000000000 R10: ffffc900046ef8f8 R11: 0000000000000000 R12: ffff888051320570 R13: 0000000000000000 R14: 0000000000000000 R15: ffff88802803a280 __unix_dgram_recvmsg+0x62e/0xc30 net/unix/af_unix.c:2654 unix_dgram_recvmsg+0xd0/0x110 net/unix/af_unix.c:2700 sock_recvmsg_nosec net/socket.c:1065 [inline] ____sys_recvmsg+0x5f9/0x6b0 net/socket.c:2832 ___sys_recvmsg+0x114/0x1a0 net/socket.c:2876 do_recvmmsg+0x55d/0x750 net/socket.c:2963 __sys_recvmmsg+0x21c/0x280 net/socket.c:3045 __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+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf710e579 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:00000000f54dd55c EFLAGS: 00000296 ORIG_RAX: 0000000000000151 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000080000040 RDX: 00000000080002c1 RSI: 0000000000000002 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 12496: 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:388 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:405 kmalloc_noprof include/linux/slab.h:905 [inline] p9_client_create+0xc7/0x11c0 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+0x109/0x220 fs/fs_context.c:666 vfs_get_tree+0x8e/0x340 fs/super.c:1815 do_new_mount fs/namespace.c:3808 [inline] path_mount+0x1513/0x2000 fs/namespace.c:4123 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount fs/namespace.c:4324 [inline] __ia32_sys_mount+0x28b/0x310 fs/namespace.c:4324 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 12496: 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:243 [inline] __kasan_slab_free+0x60/0x70 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2417 [inline] slab_free mm/slub.c:4680 [inline] kfree+0x2b4/0x4d0 mm/slub.c:4879 p9_client_create+0xa28/0x11c0 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+0x109/0x220 fs/fs_context.c:666 vfs_get_tree+0x8e/0x340 fs/super.c:1815 do_new_mount fs/namespace.c:3808 [inline] path_mount+0x1513/0x2000 fs/namespace.c:4123 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount fs/namespace.c:4324 [inline] __ia32_sys_mount+0x28b/0x310 fs/namespace.c:4324 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff888073c85800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff888073c85800, ffff888073c85a00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x73c84 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801b842c80 ffffea00017dc800 dead000000000002 raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff88801b842c80 ffffea00017dc800 dead000000000002 head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 04fff00000000002 ffffea0001cf2101 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 12071, tgid 12066 (syz.2.1203), ts 532695430841, free_ts 525042913558 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab mm/slub.c:2655 [inline] new_slab+0x247/0x330 mm/slub.c:2709 ___slab_alloc+0xcf2/0x1740 mm/slub.c:3891 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3981 __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] __kmalloc_cache_noprof+0xfb/0x3e0 mm/slub.c:4391 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] io_get_sq_data io_uring/sqpoll.c:154 [inline] io_sq_offload_create+0x4cb/0x1270 io_uring/sqpoll.c:443 io_uring_create io_uring/io_uring.c:3808 [inline] io_uring_setup+0x1493/0x2080 io_uring/io_uring.c:3891 __do_sys_io_uring_setup io_uring/io_uring.c:3925 [inline] __se_sys_io_uring_setup io_uring/io_uring.c:3916 [inline] __ia32_sys_io_uring_setup+0xc2/0x170 io_uring/io_uring.c:3916 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] do_int80_emulation+0x104/0x460 arch/x86/entry/syscall_32.c:172 asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:626 page last free pid 12015 tgid 12014 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x7d5/0x10f0 mm/page_alloc.c:2895 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:340 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4180 [inline] slab_alloc_node mm/slub.c:4229 [inline] kmem_cache_alloc_noprof+0x1cb/0x3b0 mm/slub.c:4236 ptlock_alloc+0x1f/0x70 mm/memory.c:7161 ptlock_init include/linux/mm.h:2953 [inline] pagetable_pte_ctor include/linux/mm.h:3002 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:78 [inline] pte_alloc_one+0x82/0x3a0 arch/x86/mm/pgtable.c:18 do_fault_around mm/memory.c:5525 [inline] do_read_fault mm/memory.c:5564 [inline] do_fault mm/memory.c:5707 [inline] do_pte_missing+0x1afc/0x3ba0 mm/memory.c:4234 handle_pte_fault mm/memory.c:6052 [inline] __handle_mm_fault+0x152a/0x2a50 mm/memory.c:6195 handle_mm_fault+0x589/0xd10 mm/memory.c:6364 faultin_page mm/gup.c:1144 [inline] __get_user_pages+0x551/0x34a0 mm/gup.c:1446 populate_vma_page_range+0x267/0x3f0 mm/gup.c:1880 __mm_populate+0x1d8/0x380 mm/gup.c:1983 mm_populate include/linux/mm.h:3367 [inline] vm_mmap_pgoff+0x37f/0x470 mm/util.c:585 ksys_mmap_pgoff+0x7d/0x5c0 mm/mmap.c:604 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 Memory state around the buggy address: ffff888073c85700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888073c85780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888073c85800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888073c85880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888073c85900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 48 8b 05 2b ce 1a 12 mov 0x121ace2b(%rip),%rax # 0x121ace32 7: 48 8b 80 30 16 00 00 mov 0x1630(%rax),%rax e: c3 ret f: cc int3 10: cc int3 11: cc int3 12: cc int3 13: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 1a: 90 nop 1b: 90 nop 1c: 90 nop 1d: 90 nop 1e: 90 nop 1f: 90 nop 20: 90 nop 21: 90 nop 22: 90 nop 23: 90 nop 24: 90 nop 25: 90 nop 26: 90 nop 27: 90 nop 28: 90 nop 29: 90 nop * 2a: 49 89 d2 mov %rdx,%r10 <-- trapping instruction 2d: 49 89 f8 mov %rdi,%r8 30: 49 89 f1 mov %rsi,%r9 33: 65 48 8b 15 f7 cd 1a mov %gs:0x121acdf7(%rip),%rdx # 0x121ace32 3a: 12 3b: 65 gs 3c: 8b .byte 0x8b 3d: 05 .byte 0x5 3e: 08 ce or %cl,%dh