================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x4208/0x5de0 kernel/locking/lockdep.c:5004 Read of size 8 at addr ffff8880646fd018 by task syz-executor.3/14013 CPU: 0 PID: 14013 Comm: syz-executor.3 Not tainted 6.6.0-syzkaller-15494-g6bc986ab839c #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+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 __lock_acquire+0x4208/0x5de0 kernel/locking/lockdep.c:5004 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x50 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+0xc6/0x250 net/9p/client.c:399 req_done+0x1e7/0x2e0 net/9p/trans_virtio.c:147 vring_interrupt drivers/virtio/virtio_ring.c:2595 [inline] vring_interrupt+0x317/0x3f0 drivers/virtio/virtio_ring.c:2570 __handle_irq_event_percpu+0x22a/0x740 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+0x261/0xcf0 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+0xdb/0x240 arch/x86/kernel/irq.c:257 common_interrupt+0x51/0xd0 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:636 RIP: 0023:0xf721f879 Code: 10 89 74 24 14 8d 74 26 00 8b 45 08 8b 4d 0c 83 c5 08 89 ce 39 d0 19 fe 72 ef 89 44 24 0c 8b 44 24 10 89 4c 24 10 8b 74 24 14 <83> e8 08 89 f9 39 f2 19 d9 73 15 8d 74 26 00 8b 70 f8 8b 58 fc 83 RSP: 002b:00000000ffc75950 EFLAGS: 00000246 RAX: 00000000f6cbcea8 RBX: 00000000ffffffff RCX: 0000000000000000 RDX: 00000000813a791a RSI: 00000000813a791a RDI: 00000000ffffffff RBP: 00000000f6cbce80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 14018: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:600 [inline] p9_client_create+0xcf/0x1210 net/9p/client.c:980 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xcd0 fs/9p/vfs_super.c:123 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8c/0x370 fs/super.c:1771 do_new_mount fs/namespace.c:3337 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3664 do_mount fs/namespace.c:3677 [inline] __do_sys_mount fs/namespace.c:3886 [inline] __se_sys_mount fs/namespace.c:3863 [inline] __ia32_sys_mount+0x291/0x310 fs/namespace.c:3863 do_syscall_32_irqs_on arch/x86/entry/common.c:164 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:230 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:255 entry_SYSENTER_compat_after_hwframe+0x70/0x7a Freed by task 14018: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xc0/0x180 mm/slub.c:3822 p9_client_create+0xa14/0x1210 net/9p/client.c:1051 v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410 v9fs_mount+0xc6/0xcd0 fs/9p/vfs_super.c:123 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8c/0x370 fs/super.c:1771 do_new_mount fs/namespace.c:3337 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3664 do_mount fs/namespace.c:3677 [inline] __do_sys_mount fs/namespace.c:3886 [inline] __se_sys_mount fs/namespace.c:3863 [inline] __ia32_sys_mount+0x291/0x310 fs/namespace.c:3863 do_syscall_32_irqs_on arch/x86/entry/common.c:164 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:230 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:255 entry_SYSENTER_compat_after_hwframe+0x70/0x7a The buggy address belongs to the object at ffff8880646fd000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff8880646fd000, ffff8880646fd200) The buggy address belongs to the physical page: page:ffffea000191bf00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x646fc head:ffffea000191bf00 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 ffff888013042c80 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000100010 00000001ffffffff 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 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 1139, tgid 1139 (kworker/u16:10), ts 447086251818, free_ts 428211383447 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0xa25/0x36c0 mm/page_alloc.c:3312 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4568 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8c7/0x1580 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x131/0x310 mm/slub.c:3517 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] batadv_forw_packet_alloc+0x3a8/0x4e0 net/batman-adv/send.c:519 batadv_iv_ogm_aggregate_new+0x132/0x4a0 net/batman-adv/bat_iv_ogm.c:562 batadv_iv_ogm_queue_add net/batman-adv/bat_iv_ogm.c:670 [inline] batadv_iv_ogm_schedule_buff+0xe7f/0x14f0 net/batman-adv/bat_iv_ogm.c:849 batadv_iv_ogm_schedule net/batman-adv/bat_iv_ogm.c:868 [inline] batadv_iv_ogm_schedule net/batman-adv/bat_iv_ogm.c:861 [inline] batadv_iv_send_outstanding_bat_ogm_packet+0x31e/0x8c0 net/batman-adv/bat_iv_ogm.c:1712 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x4f8/0xa90 mm/page_alloc.c:2347 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2487 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3478 [inline] __kmem_cache_alloc_node+0x195/0x310 mm/slub.c:3517 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] ext4_htree_create_dir_info fs/ext4/dir.c:438 [inline] ext4_dx_readdir fs/ext4/dir.c:556 [inline] ext4_readdir+0x2646/0x3720 fs/ext4/dir.c:142 iterate_dir+0x1e5/0x5b0 fs/readdir.c:106 __do_sys_getdents64 fs/readdir.c:405 [inline] __se_sys_getdents64 fs/readdir.c:390 [inline] __ia32_sys_getdents64+0x14f/0x2e0 fs/readdir.c:390 do_syscall_32_irqs_on arch/x86/entry/common.c:164 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:230 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:255 entry_SYSENTER_compat_after_hwframe+0x70/0x7a Memory state around the buggy address: ffff8880646fcf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880646fcf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880646fd000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880646fd080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880646fd100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 89 74 24 14 mov %esi,0x14(%rsp) 4: 8d 74 26 00 lea 0x0(%rsi,%riz,1),%esi 8: 8b 45 08 mov 0x8(%rbp),%eax b: 8b 4d 0c mov 0xc(%rbp),%ecx e: 83 c5 08 add $0x8,%ebp 11: 89 ce mov %ecx,%esi 13: 39 d0 cmp %edx,%eax 15: 19 fe sbb %edi,%esi 17: 72 ef jb 0x8 19: 89 44 24 0c mov %eax,0xc(%rsp) 1d: 8b 44 24 10 mov 0x10(%rsp),%eax 21: 89 4c 24 10 mov %ecx,0x10(%rsp) 25: 8b 74 24 14 mov 0x14(%rsp),%esi * 29: 83 e8 08 sub $0x8,%eax <-- trapping instruction 2c: 89 f9 mov %edi,%ecx 2e: 39 f2 cmp %esi,%edx 30: 19 d9 sbb %ebx,%ecx 32: 73 15 jae 0x49 34: 8d 74 26 00 lea 0x0(%rsi,%riz,1),%esi 38: 8b 70 f8 mov -0x8(%rax),%esi 3b: 8b 58 fc mov -0x4(%rax),%ebx 3e: 83 .byte 0x83