================================================================== BUG: KASAN: slab-use-after-free in __lock_acquire+0x2dd6/0x3b30 kernel/locking/lockdep.c:5004 Read of size 8 at addr ffff888041ae4818 by task udevd/4694 CPU: 3 PID: 4694 Comm: udevd Not tainted 6.10.0-syzkaller-04472-g51835949dda3 #0 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: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:5004 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5718 __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+0xca/0x250 net/9p/client.c:402 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:173 [inline] handle_irq arch/x86/kernel/irq.c:247 [inline] call_irq_handler arch/x86/kernel/irq.c:259 [inline] __common_interrupt+0xdf/0x250 arch/x86/kernel/irq.c:285 common_interrupt+0xab/0xd0 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:tomoyo_check_acl+0x317/0x410 security/tomoyo/domain.c:183 Code: 0f 92 c7 31 ff 44 89 fe 66 89 44 24 16 e8 71 9e 49 fd 45 84 ff 75 29 e8 c7 a3 49 fd 0f b7 74 24 16 bf 00 01 00 00 48 83 c3 01 84 9e 49 fd 48 81 fb 00 01 00 00 75 a1 45 31 ff e9 c5 fe ff ff RSP: 0018:ffffc900046bf6e8 EFLAGS: 00000202 RAX: 0000000000000000 RBX: 00000000000000ce RCX: ffffffff844459df RDX: ffff88802aa04880 RSI: 00000000000000ce RDI: 0000000000000100 RBP: dffffc0000000000 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: ffffc900046bf7d8 R13: ffff888105af1e30 R14: 00000000000000cd R15: 0000000000000000 tomoyo_path_permission security/tomoyo/file.c:586 [inline] tomoyo_path_permission+0x1ff/0x3b0 security/tomoyo/file.c:573 tomoyo_check_open_permission+0x377/0x3b0 security/tomoyo/file.c:777 tomoyo_file_open+0x71/0x90 security/tomoyo/tomoyo.c:334 security_file_open+0x78/0x8b0 security/security.c:2988 do_dentry_open+0x5c7/0x15f0 fs/open.c:946 vfs_open+0x82/0x3f0 fs/open.c:1089 do_open fs/namei.c:3727 [inline] path_openat+0x2141/0x2d20 fs/namei.c:3886 do_filp_open+0x1dc/0x430 fs/namei.c:3913 do_sys_openat2+0x17a/0x1e0 fs/open.c:1416 do_sys_open fs/open.c:1431 [inline] __do_sys_openat fs/open.c:1447 [inline] __se_sys_openat fs/open.c:1442 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1442 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fdda271a477 Code: 10 00 00 00 44 8b 54 24 e0 48 89 44 24 c0 48 8d 44 24 d0 48 89 44 24 c8 44 89 c2 4c 89 ce bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 76 10 48 8b 15 82 69 0d 00 f7 d8 64 89 02 48 83 RSP: 002b:00007ffe00270a08 EFLAGS: 00000287 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000561c4c2c13f0 RCX: 00007fdda271a477 RDX: 0000000000090800 RSI: 0000561c4c289f60 RDI: 00000000ffffff9c RBP: 0000561c4c304e60 R08: 0000000000090800 R09: 0000561c4c289f60 R10: 0000000000000000 R11: 0000000000000287 R12: 0000561c4c289f60 R13: 00000000000000ff R14: 0000561c4a77d1c4 R15: 0000000000000000 Allocated by task 6213: 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_noprof include/linux/slab.h:660 [inline] p9_client_create+0xcf/0x1210 net/9p/client.c:983 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:1789 do_new_mount fs/namespace.c:3472 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3799 do_mount fs/namespace.c:3812 [inline] __do_sys_mount fs/namespace.c:4020 [inline] __se_sys_mount fs/namespace.c:3997 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:3997 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6213: 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+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2196 [inline] slab_free mm/slub.c:4438 [inline] kfree+0x12a/0x3b0 mm/slub.c:4559 p9_client_create+0xaaa/0x1210 net/9p/client.c:1054 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:1789 do_new_mount fs/namespace.c:3472 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3799 do_mount fs/namespace.c:3812 [inline] __do_sys_mount fs/namespace.c:4020 [inline] __se_sys_mount fs/namespace.c:3997 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:3997 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888041ae4800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff888041ae4800, ffff888041ae4a00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888041ae5400 pfn:0x41ae4 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff888015442c80 0000000000000000 0000000000000001 raw: ffff888041ae5400 000000008010000f 00000001ffffefff 0000000000000000 head: 00fff00000000040 ffff888015442c80 0000000000000000 0000000000000001 head: ffff888041ae5400 000000008010000f 00000001ffffefff 0000000000000000 head: 00fff00000000002 ffffea000106b901 ffffffffffffffff 0000000000000000 head: 0000000000000004 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 13, tgid 13 (kworker/u32:1), ts 84844165816, free_ts 84784867570 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1473 prep_new_page mm/page_alloc.c:1481 [inline] get_page_from_freelist+0x1353/0x2e50 mm/page_alloc.c:3425 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4683 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3990 [inline] kmalloc_trace_noprof+0x2b4/0x300 mm/slub.c:4149 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] mca_alloc net/ipv6/mcast.c:880 [inline] __ipv6_dev_mc_inc+0x2b7/0xc50 net/ipv6/mcast.c:936 addrconf_join_solict net/ipv6/addrconf.c:2241 [inline] addrconf_dad_begin net/ipv6/addrconf.c:4102 [inline] addrconf_dad_work+0x232/0x1500 net/ipv6/addrconf.c:4227 process_one_work+0x9c5/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page last free pid 5928 tgid 5928 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1093 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2588 stack_depot_save_flags+0x2da/0x8f0 lib/stackdepot.c:666 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+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2196 [inline] slab_free mm/slub.c:4438 [inline] kfree+0x12a/0x3b0 mm/slub.c:4559 free_slab_obj_exts mm/slub.c:1996 [inline] unaccount_slab mm/slub.c:2401 [inline] __free_slab+0x145/0x180 mm/slub.c:2497 __put_partials+0x14c/0x170 mm/slub.c:2995 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3940 [inline] slab_alloc_node mm/slub.c:4002 [inline] kmalloc_trace_noprof+0x11e/0x300 mm/slub.c:4149 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] inet_alloc_ifa net/ipv4/devinet.c:221 [inline] rtm_to_ifaddr.constprop.0+0x23c/0xd70 net/ipv4/devinet.c:878 inet_rtm_newaddr+0x125/0xae0 net/ipv4/devinet.c:967 Memory state around the buggy address: ffff888041ae4700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888041ae4780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888041ae4800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888041ae4880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888041ae4900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 0f 92 c7 setb %bh 3: 31 ff xor %edi,%edi 5: 44 89 fe mov %r15d,%esi 8: 66 89 44 24 16 mov %ax,0x16(%rsp) d: e8 71 9e 49 fd call 0xfd499e83 12: 45 84 ff test %r15b,%r15b 15: 75 29 jne 0x40 17: e8 c7 a3 49 fd call 0xfd49a3e3 1c: 0f b7 74 24 16 movzwl 0x16(%rsp),%esi 21: bf 00 01 00 00 mov $0x100,%edi 26: 48 83 c3 01 add $0x1,%rbx * 2a: e8 84 9e 49 fd call 0xfd499eb3 <-- trapping instruction 2f: 48 81 fb 00 01 00 00 cmp $0x100,%rbx 36: 75 a1 jne 0xffffffd9 38: 45 31 ff xor %r15d,%r15d 3b: e9 c5 fe ff ff jmp 0xffffff05