================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x2dd6/0x3b30 kernel/locking/lockdep.c:5005 Read of size 8 at addr ffff88805bd8e018 by task syz-executor.3/20010 CPU: 0 PID: 20010 Comm: syz-executor.3 Not tainted 6.9.0-rc7-syzkaller-00136-gf4345f05c0df #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 __lock_acquire+0x2dd6/0x3b30 kernel/locking/lockdep.c:5005 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __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:394 [inline] p9_req_put net/9p/client.c:402 [inline] p9_req_put+0xca/0x250 net/9p/client.c:399 req_done+0x1e7/0x2f0 net/9p/trans_virtio.c:147 vring_interrupt drivers/virtio/virtio_ring.c:2595 [inline] vring_interrupt+0x31b/0x400 drivers/virtio/virtio_ring.c:2570 __handle_irq_event_percpu+0x229/0x7c0 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+0x263/0xd10 kernel/irq/chip.c:831 generic_handle_irq_desc include/linux/irqdesc.h:161 [inline] handle_irq arch/x86/kernel/irq.c:238 [inline] __common_interrupt+0xde/0x250 arch/x86/kernel/irq.c:257 common_interrupt+0xab/0xd0 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:check_kcov_mode kernel/kcov.c:175 [inline] RIP: 0010:write_comp_data+0x2e/0x90 kernel/kcov.c:236 Code: 89 f8 49 89 f1 65 48 8b 15 8f 6e 75 7e 65 8b 05 90 6e 75 7e a9 00 01 ff 00 74 0f f6 c4 01 74 59 8b 82 14 16 00 00 85 c0 74 4f <8b> 82 f0 15 00 00 83 f8 03 75 44 48 8b 82 f8 15 00 00 8b 92 f4 15 RSP: 0018:ffffc900042f7348 EFLAGS: 00000246 RAX: 0000000080000001 RBX: ffffc900042f73d0 RCX: ffffffff813cc7be RDX: ffff88802000a440 RSI: ffffffff81f455c1 RDI: 0000000000000006 RBP: 0000000000000001 R08: 0000000000000006 R09: ffffffff81f455c1 R10: ffffffff81000000 R11: 0000000000000000 R12: ffffffff81f455c1 R13: 0000000000000000 R14: ffffc900042f7490 R15: ffffc900042f7405 orc_find arch/x86/kernel/unwind_orc.c:206 [inline] unwind_next_frame+0x1de/0x23a0 arch/x86/kernel/unwind_orc.c:494 arch_stack_walk+0x100/0x170 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122 save_stack+0x162/0x1f0 mm/page_owner.c:156 __reset_page_owner+0x8d/0x400 mm/page_owner.c:302 reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_folios+0x256/0xad0 mm/page_alloc.c:2536 folios_put_refs+0x487/0x6d0 mm/swap.c:1034 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x5a1/0x1170 mm/shmem.c:1005 shmem_truncate_range mm/shmem.c:1114 [inline] shmem_evict_inode+0x3a3/0xbb0 mm/shmem.c:1242 evict+0x2ed/0x6c0 fs/inode.c:667 iput_final fs/inode.c:1741 [inline] iput.part.0+0x5a8/0x7f0 fs/inode.c:1767 iput+0x5c/0x80 fs/inode.c:1757 dentry_unlink_inode+0x295/0x440 fs/dcache.c:400 __dentry_kill+0x1d0/0x600 fs/dcache.c:603 dput.part.0+0x4b1/0x9b0 fs/dcache.c:845 dput+0x1f/0x30 fs/dcache.c:835 __fput+0x3bc/0xb80 fs/file_table.c:430 __fput_sync+0x47/0x50 fs/file_table.c:507 __do_sys_close fs/open.c:1556 [inline] __se_sys_close fs/open.c:1541 [inline] __ia32_sys_close+0x86/0x100 fs/open.c:1541 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf72a4579 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:00000000f5e963b0 EFLAGS: 00000293 ORIG_RAX: 0000000000000006 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000f5e96b40 RDX: 0000000000000000 RSI: 00000000f73fbff4 RDI: 0000000000000004 RBP: 0000000000000010 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 20031: 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:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc include/linux/slab.h:628 [inline] p9_client_create+0xcf/0x11b0 net/9p/client.c:980 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xaa0 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1779 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x6e1/0x1f10 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __ia32_sys_mount+0x295/0x320 fs/namespace.c:3875 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 20031: 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:579 poison_slab_object mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2111 [inline] slab_free mm/slub.c:4286 [inline] kfree+0x129/0x3a0 mm/slub.c:4396 p9_client_create+0x9ca/0x11b0 net/9p/client.c:1051 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xaa0 fs/9p/vfs_super.c:122 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1779 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x6e1/0x1f10 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __ia32_sys_mount+0x295/0x320 fs/namespace.c:3875 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff88805bd8e000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff88805bd8e000, ffff88805bd8e200) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5bd8c head: order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000840(slab|head|node=1|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 04fff00000000840 ffff888014c42c80 ffffea0001534f00 dead000000000002 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 head: 04fff00000000840 ffff888014c42c80 ffffea0001534f00 dead000000000002 head: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 head: 04fff00000000002 ffffea00016f6301 ffffea00016f6348 00000000ffffffff head: 0000000400000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5210, tgid -1686873115 (syz-executor.2), ts 5210, free_ts 45521631926 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2180 [inline] allocate_slab mm/slub.c:2343 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2396 ___slab_alloc+0x670/0x16d0 mm/slub.c:3530 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3615 __slab_alloc_node mm/slub.c:3668 [inline] slab_alloc_node mm/slub.c:3841 [inline] __do_kmalloc_node mm/slub.c:3971 [inline] __kmalloc+0x3bf/0x440 mm/slub.c:3985 kmalloc include/linux/slab.h:632 [inline] kzalloc include/linux/slab.h:749 [inline] tomoyo_init_log+0x126b/0x1f60 security/tomoyo/audit.c:275 tomoyo_supervisor+0x30c/0x1180 security/tomoyo/common.c:2089 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline] tomoyo_path_permission security/tomoyo/file.c:587 [inline] tomoyo_path_permission+0x270/0x3b0 security/tomoyo/file.c:573 tomoyo_check_open_permission+0x345/0x3b0 security/tomoyo/file.c:780 tomoyo_file_open+0x71/0x90 security/tomoyo/tomoyo.c:334 security_file_open+0x78/0x630 security/security.c:2961 do_dentry_open+0x583/0x18c0 fs/open.c:942 do_open fs/namei.c:3642 [inline] path_openat+0x1dfb/0x2990 fs/namei.c:3799 do_filp_open+0x1dc/0x430 fs/namei.c:3826 page last free pid 5207 tgid 5207 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 stack_depot_save_flags+0x2da/0x900 lib/stackdepot.c:673 kasan_save_stack+0x42/0x60 mm/kasan/common.c:48 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2111 [inline] slab_free mm/slub.c:4286 [inline] kmem_cache_free+0x12e/0x390 mm/slub.c:4350 kfree_skbmem+0x10e/0x200 net/core/skbuff.c:1159 __kfree_skb net/core/skbuff.c:1217 [inline] kfree_skb_reason+0x13a/0x210 net/core/skbuff.c:1252 kfree_skb include/linux/skbuff.h:1262 [inline] napi_free_frags include/linux/netdevice.h:3907 [inline] napi_get_frags_check+0x56/0xa0 net/core/skbuff.c:304 netif_napi_add_weight+0x538/0xac0 net/core/dev.c:6535 netif_napi_add include/linux/netdevice.h:2634 [inline] gro_cells_init net/core/gro_cells.c:85 [inline] gro_cells_init+0x18c/0x2e0 net/core/gro_cells.c:70 ip_tunnel_init+0x1dc/0x760 net/ipv4/ip_tunnel.c:1283 ipgre_tunnel_init+0x207/0x500 net/ipv4/ip_gre.c:1020 register_netdevice+0x59f/0x1c40 net/core/dev.c:10210 Memory state around the buggy address: ffff88805bd8df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805bd8df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805bd8e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805bd8e080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805bd8e100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 89 f8 mov %edi,%eax 2: 49 89 f1 mov %rsi,%r9 5: 65 48 8b 15 8f 6e 75 mov %gs:0x7e756e8f(%rip),%rdx # 0x7e756e9c c: 7e d: 65 8b 05 90 6e 75 7e mov %gs:0x7e756e90(%rip),%eax # 0x7e756ea4 14: a9 00 01 ff 00 test $0xff0100,%eax 19: 74 0f je 0x2a 1b: f6 c4 01 test $0x1,%ah 1e: 74 59 je 0x79 20: 8b 82 14 16 00 00 mov 0x1614(%rdx),%eax 26: 85 c0 test %eax,%eax 28: 74 4f je 0x79 * 2a: 8b 82 f0 15 00 00 mov 0x15f0(%rdx),%eax <-- trapping instruction 30: 83 f8 03 cmp $0x3,%eax 33: 75 44 jne 0x79 35: 48 8b 82 f8 15 00 00 mov 0x15f8(%rdx),%rax 3c: 8b .byte 0x8b 3d: 92 xchg %eax,%edx 3e: f4 hlt 3f: 15 .byte 0x15