================================================================== 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 ffff888026f27418 by task syz.0.186/6747 CPU: 3 UID: 0 PID: 6747 Comm: syz.0.186 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:3254 __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:lock_acquire+0x5e/0x380 kernel/locking/lockdep.c:5872 Code: 05 3b ab 28 12 83 f8 07 0f 87 f0 00 00 00 48 0f a3 05 06 9e f4 0e 0f 82 c2 02 00 00 8b 35 ee d1 f4 0e 85 f6 0f 85 dd 00 00 00 <48> 8b 44 24 30 65 48 2b 05 dd aa 28 12 0f 85 02 03 00 00 48 83 c4 RSP: 0018:ffffc90004306908 EFLAGS: 00000206 RAX: 0000000000000046 RBX: 0000000000000000 RCX: 0000000000000006 RDX: 0000000000000000 RSI: ffffffff8de4ec23 RDI: ffffffff8c1afaa0 RBP: ffffffff8e7e7520 R08: 00000000e24ebdd4 R09: 000000000000001e R10: 0000000000000200 R11: 0000000000000000 R12: 0000000000000002 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 rcu_lock_acquire include/linux/rcupdate.h:312 [inline] rcu_read_lock_sched include/linux/rcupdate.h:948 [inline] pfn_valid include/linux/mmzone.h:2197 [inline] page_table_check_set+0x6b/0xa10 mm/page_table_check.c:105 __page_table_check_ptes_set+0x27a/0x4e0 mm/page_table_check.c:215 page_table_check_ptes_set include/linux/page_table_check.h:83 [inline] set_ptes include/linux/pgtable.h:413 [inline] set_pte_range+0x936/0xb10 mm/memory.c:5527 filemap_map_order0_folio mm/filemap.c:3861 [inline] filemap_map_pages+0x7ea/0x2020 mm/filemap.c:3926 do_fault_around mm/memory.c:5757 [inline] do_read_fault mm/memory.c:5790 [inline] do_fault+0x9e5/0x1950 mm/memory.c:5933 do_pte_missing mm/memory.c:4477 [inline] handle_pte_fault mm/memory.c:6317 [inline] __handle_mm_fault+0x180f/0x2b60 mm/memory.c:6455 handle_mm_fault+0x36d/0xa20 mm/memory.c:6624 faultin_page mm/gup.c:1126 [inline] __get_user_pages+0xf9c/0x34d0 mm/gup.c:1428 __get_user_pages_locked mm/gup.c:1692 [inline] get_dump_page+0x27e/0x3d0 mm/gup.c:2192 dump_user_range+0x18d/0xb50 fs/coredump.c:1367 elf_core_dump+0x2d5f/0x3d10 fs/binfmt_elf.c:2110 coredump_write fs/coredump.c:1050 [inline] do_coredump fs/coredump.c:1127 [inline] vfs_coredump+0x27bc/0x5570 fs/coredump.c:1201 get_signal+0x1f2a/0x21e0 kernel/signal.c:3019 arch_do_signal_or_restart+0x91/0x7a0 arch/x86/kernel/signal.c:337 __exit_to_user_mode_loop kernel/entry/common.c:64 [inline] exit_to_user_mode_loop kernel/entry/common.c:98 [inline] __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] irqentry_exit_to_user_mode_prepare include/linux/irq-entry-common.h:270 [inline] irqentry_exit_to_user_mode include/linux/irq-entry-common.h:339 [inline] irqentry_exit+0x1f8/0x670 kernel/entry/common.c:219 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:618 RIP: 0033:0x7f6c5a59c7a1 Code: 00 00 00 00 0f 1f 44 00 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 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f RSP: 002b:0000200000000000 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007f6c5a815fa0 RCX: 00007f6c5a59c799 RDX: 0000000000000000 RSI: 0000200000000000 RDI: 0000000001144280 RBP: 00007f6c5a632c99 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 00007f6c5a816038 R14: 00007f6c5a815fa0 R15: 00007fff62269c38 Allocated by task 6751: 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:950 [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:3763 [inline] do_new_mount fs/namespace.c:3839 [inline] path_mount+0x7d0/0x23d0 fs/namespace.c:4159 do_mount fs/namespace.c:4172 [inline] __do_sys_mount fs/namespace.c:4361 [inline] __se_sys_mount fs/namespace.c:4338 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4338 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6751: 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:2692 [inline] slab_free mm/slub.c:6168 [inline] kfree+0x1f6/0x6b0 mm/slub.c:6486 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:3763 [inline] do_new_mount fs/namespace.c:3839 [inline] path_mount+0x7d0/0x23d0 fs/namespace.c:4159 do_mount fs/namespace.c:4172 [inline] __do_sys_mount fs/namespace.c:4361 [inline] __se_sys_mount fs/namespace.c:4338 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4338 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888026f27400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff888026f27400, ffff888026f27600) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x26f24 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 0000000800100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b842c80 dead000000000100 dead000000000122 head: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea00009bc901 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 1, tgid 1 (swapper/0), ts 13974921224, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x153/0x170 mm/page_alloc.c:1889 prep_new_page mm/page_alloc.c:1897 [inline] get_page_from_freelist+0x111d/0x3140 mm/page_alloc.c:3962 __alloc_frozen_pages_noprof+0x27c/0x2ba0 mm/page_alloc.c:5250 alloc_slab_page mm/slub.c:3296 [inline] allocate_slab mm/slub.c:3485 [inline] new_slab+0xa6/0x6c0 mm/slub.c:3543 refill_objects+0x26b/0x400 mm/slub.c:7178 refill_sheaf mm/slub.c:2818 [inline] alloc_full_sheaf mm/slub.c:2839 [inline] __pcs_replace_empty_main+0x1ab/0x600 mm/slub.c:4629 alloc_from_pcs mm/slub.c:4720 [inline] slab_alloc_node mm/slub.c:4854 [inline] __kmalloc_cache_noprof+0x493/0x6f0 mm/slub.c:5378 kmalloc_noprof include/linux/slab.h:950 [inline] drm_atomic_helper_connector_duplicate_state+0x72/0xd0 drivers/gpu/drm/drm_atomic_state_helper.c:668 drm_atomic_get_connector_state+0x401/0x8f0 drivers/gpu/drm/drm_atomic.c:1309 update_output_state drivers/gpu/drm/drm_atomic.c:1866 [inline] __drm_atomic_helper_set_config+0x991/0xee0 drivers/gpu/drm/drm_atomic.c:1968 drm_client_modeset_commit_atomic+0x53d/0x7e0 drivers/gpu/drm/drm_client_modeset.c:1085 drm_client_modeset_commit_locked+0x14d/0x580 drivers/gpu/drm/drm_client_modeset.c:1207 drm_client_modeset_commit+0x4f/0x80 drivers/gpu/drm/drm_client_modeset.c:1233 __drm_fb_helper_restore_fbdev_mode_unlocked.part.0+0x137/0x160 drivers/gpu/drm/drm_fb_helper.c:137 __drm_fb_helper_restore_fbdev_mode_unlocked drivers/gpu/drm/drm_fb_helper.c:1177 [inline] drm_fb_helper_set_par+0x15a/0x1b0 drivers/gpu/drm/drm_fb_helper.c:1179 fbcon_init+0x139c/0x1820 drivers/video/fbdev/core/fbcon.c:1147 page_owner free stack trace missing Memory state around the buggy address: ffff888026f27300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888026f27380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888026f27400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888026f27480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888026f27500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 05 3b ab 28 12 add $0x1228ab3b,%eax 5: 83 f8 07 cmp $0x7,%eax 8: 0f 87 f0 00 00 00 ja 0xfe e: 48 0f a3 05 06 9e f4 bt %rax,0xef49e06(%rip) # 0xef49e1c 15: 0e 16: 0f 82 c2 02 00 00 jb 0x2de 1c: 8b 35 ee d1 f4 0e mov 0xef4d1ee(%rip),%esi # 0xef4d210 22: 85 f6 test %esi,%esi 24: 0f 85 dd 00 00 00 jne 0x107 * 2a: 48 8b 44 24 30 mov 0x30(%rsp),%rax <-- trapping instruction 2f: 65 48 2b 05 dd aa 28 sub %gs:0x1228aadd(%rip),%rax # 0x1228ab14 36: 12 37: 0f 85 02 03 00 00 jne 0x33f 3d: 48 rex.W 3e: 83 .byte 0x83 3f: c4 .byte 0xc4