================================================================== 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 ffff88803408b018 by task udevd/13015 CPU: 3 UID: 0 PID: 13015 Comm: udevd Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP 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/0x1a0 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+0xf5/0x330 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: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+0x33b/0x430 drivers/virtio/virtio_ring.c:2718 __handle_irq_event_percpu+0x232/0x800 kernel/irq/handle.c:211 handle_irq_event_percpu kernel/irq/handle.c:248 [inline] handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:265 handle_edge_irq+0x375/0x970 kernel/irq/chip.c:855 generic_handle_irq_desc include/linux/irqdesc.h:172 [inline] handle_irq arch/x86/kernel/irq.c:255 [inline] call_irq_handler arch/x86/kernel/irq.c:311 [inline] __common_interrupt+0xd8/0x2f0 arch/x86/kernel/irq.c:326 common_interrupt+0x60/0xe0 arch/x86/kernel/irq.c:319 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:688 RIP: 0010:handle_softirqs+0x1ad/0x910 kernel/softirq.c:608 Code: 20 44 88 74 24 1e 45 89 ee 48 c7 c7 e0 6f 8d 8b e8 58 62 af 09 31 d2 65 66 89 15 36 e5 1c 12 e8 a9 5c 47 00 fb bb ff ff ff ff <49> c7 c4 c0 c0 20 8e 41 0f bc de 83 c3 01 0f 85 a4 00 00 00 e9 ab RSP: 0018:ffffc900006f8f30 EFLAGS: 00000206 RAX: 000000000000d444 RBX: 00000000ffffffff RCX: 0000000000000004 RDX: 0000000000000000 RSI: ffffffff8dc46051 RDI: ffffffff8bfa38a0 RBP: 00000000ffffea8f R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000001 R12: 000000000000000a R13: 0000000000000200 R14: 0000000000000200 R15: 1ffff920000df1ed __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xef/0x150 kernel/softirq.c:723 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline] sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1056 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 RIP: 0010:console_flush_one_record+0xac3/0xe50 kernel/printk/printk.c:3216 Code: 00 e8 91 34 29 00 9c 5d 81 e5 00 02 00 00 31 ff 48 89 ee e8 ef 46 21 00 48 85 ed 0f 85 d7 01 00 00 e8 01 4c 21 00 fb 4c 89 e8 <48> c1 e8 03 42 80 3c 38 00 0f 85 64 03 00 00 48 8b 0c 24 48 8b 6b RSP: 0018:ffffc900079e6cc0 EFLAGS: 00000293 RAX: ffffffff8f2f9eb8 RBX: ffffffff8f2f9e60 RCX: ffffffff81e5b331 RDX: ffff888028a04980 RSI: ffffffff81e5b33f RDI: ffff888028a04980 RBP: 0000000000000000 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 00000000000014ac R13: ffffffff8f2f9eb8 R14: ffffc900079e6d40 R15: dffffc0000000000 console_flush_all kernel/printk/printk.c:3289 [inline] __console_flush_and_unlock kernel/printk/printk.c:3319 [inline] console_unlock+0x103/0x260 kernel/printk/printk.c:3359 vprintk_emit+0x407/0x6b0 kernel/printk/printk.c:2426 _printk+0xcf/0x110 kernel/printk/printk.c:2451 buffer_io_error fs/buffer.c:130 [inline] buffer_io_error.cold+0x58/0x64 fs/buffer.c:127 end_buffer_async_read+0x2ba/0x330 fs/buffer.c:271 end_buffer_async_read_io+0x13b/0x4d0 fs/buffer.c:380 end_bio_bh_io_sync+0xe8/0x140 fs/buffer.c:2776 bio_endio+0x755/0x8b0 block/bio.c:1675 bio_io_error include/linux/bio.h:384 [inline] blk_mq_submit_bio+0x992/0x2b60 block/blk-mq.c:3174 __submit_bio+0x3f0/0x6c0 block/blk-core.c:637 __submit_bio_noacct_mq block/blk-core.c:724 [inline] submit_bio_noacct_nocheck+0x50f/0xbb0 block/blk-core.c:755 submit_bio_noacct+0xb5c/0x1e80 block/blk-core.c:879 submit_bh fs/buffer.c:2829 [inline] block_read_full_folio+0x4c8/0x8e0 fs/buffer.c:2461 filemap_read_folio+0xfc/0x3b0 mm/filemap.c:2496 do_read_cache_folio+0x2d7/0x6b0 mm/filemap.c:4096 read_mapping_folio include/linux/pagemap.h:1028 [inline] read_part_sector+0xd1/0x370 block/partitions/core.c:722 sgi_partition+0xa1/0x890 block/partitions/sgi.c:47 check_partition block/partitions/core.c:141 [inline] blk_add_partitions block/partitions/core.c:589 [inline] bdev_disk_changed+0x76f/0xbe0 block/partitions/core.c:693 blkdev_get_whole+0x187/0x290 block/bdev.c:765 bdev_open+0x2c7/0xe40 block/bdev.c:974 blkdev_open+0x34e/0x4f0 block/fops.c:698 do_dentry_open+0x73e/0x1570 fs/open.c:962 vfs_open+0x82/0x3f0 fs/open.c:1094 do_open fs/namei.c:4637 [inline] path_openat+0x21dc/0x3120 fs/namei.c:4796 do_filp_open+0x1f7/0x420 fs/namei.c:4823 do_sys_openat2+0x12e/0x220 fs/open.c:1430 do_sys_open fs/open.c:1436 [inline] __do_sys_openat fs/open.c:1452 [inline] __se_sys_openat fs/open.c:1447 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1447 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xc9/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1a0a4a7407 Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff RSP: 002b:00007ffc265b3c20 EFLAGS: 00000202 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f1a0ab3d880 RCX: 00007f1a0a4a7407 RDX: 00000000000a0800 RSI: 000055b6febd25c0 RDI: ffffffffffffff9c RBP: 000055b6febcf2c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 000055b6fee1a4e0 R13: 000055b6fee0a8d0 R14: 0000000000000000 R15: 000055b6fee1a4e0 Allocated by task 13877: 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:957 [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:1751 fc_mount fs/namespace.c:1199 [inline] do_new_mount_fc fs/namespace.c:3636 [inline] do_new_mount fs/namespace.c:3712 [inline] path_mount+0x7d0/0x23c0 fs/namespace.c:4022 do_mount fs/namespace.c:4035 [inline] __do_sys_mount fs/namespace.c:4224 [inline] __se_sys_mount fs/namespace.c:4201 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4201 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xc9/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 13877: 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:2540 [inline] slab_free mm/slub.c:6674 [inline] kfree+0x1c7/0x690 mm/slub.c:6886 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:1751 fc_mount fs/namespace.c:1199 [inline] do_new_mount_fc fs/namespace.c:3636 [inline] do_new_mount fs/namespace.c:3712 [inline] path_mount+0x7d0/0x23c0 fs/namespace.c:4022 do_mount fs/namespace.c:4035 [inline] __do_sys_mount fs/namespace.c:4224 [inline] __se_sys_mount fs/namespace.c:4201 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4201 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xc9/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88803408b000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 24 bytes inside of freed 512-byte region [ffff88803408b000, ffff88803408b200) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x34088 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 ffffea0000fe5d00 dead000000000002 raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b842c80 ffffea0000fe5d00 dead000000000002 head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea0000d02201 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 8611, tgid 8611 (syz-executor), ts 119182091662, free_ts 83516012009 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1e1/0x250 mm/page_alloc.c:1884 prep_new_page mm/page_alloc.c:1892 [inline] get_page_from_freelist+0xe3d/0x2e10 mm/page_alloc.c:3945 __alloc_frozen_pages_noprof+0x26c/0x2410 mm/page_alloc.c:5240 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x2c4/0x440 mm/slub.c:3302 ___slab_alloc+0xda3/0x1ca0 mm/slub.c:4656 __slab_alloc.isra.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __do_kmalloc_node mm/slub.c:5656 [inline] __kmalloc_noprof+0x618/0x9c0 mm/slub.c:5669 kmalloc_noprof include/linux/slab.h:961 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] fib6_info_alloc+0x40/0x160 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x14c/0xad0 net/ipv6/route.c:3820 addrconf_f6i_alloc+0x2d9/0x670 net/ipv6/route.c:4689 ipv6_add_addr+0x580/0x1fb0 net/ipv6/addrconf.c:1126 addrconf_add_linklocal+0x2a5/0x500 net/ipv6/addrconf.c:3311 addrconf_addr_gen+0x364/0x3b0 net/ipv6/addrconf.c:3442 addrconf_dev_config net/ipv6/addrconf.c:3489 [inline] addrconf_init_auto_addrs+0x1cb/0x780 net/ipv6/addrconf.c:3567 addrconf_notify+0x10a6/0x19c0 net/ipv6/addrconf.c:3740 page last free pid 6919 tgid 6919 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0x822/0x1130 mm/page_alloc.c:2973 __folio_put+0x3b4/0x540 mm/swap.c:112 folio_put include/linux/mm.h:1616 [inline] put_page include/linux/mm.h:1685 [inline] anon_pipe_put_page fs/pipe.c:139 [inline] anon_pipe_buf_release+0x40c/0x530 fs/pipe.c:147 pipe_buf_release include/linux/pipe_fs_i.h:273 [inline] free_pipe_info+0x1f1/0x3f0 fs/pipe.c:855 put_pipe_info fs/pipe.c:721 [inline] pipe_release+0x27a/0x2c0 fs/pipe.c:744 __fput+0x3ff/0xb40 fs/file_table.c:468 task_work_run+0x150/0x240 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:44 [inline] exit_to_user_mode_loop+0x100/0x4b0 kernel/entry/common.c:75 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:159 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline] do_syscall_64+0x4fe/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88803408af00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803408af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88803408b000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803408b080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803408b100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 20 44 88 74 and %al,0x74(%rax,%rcx,4) 4: 24 1e and $0x1e,%al 6: 45 89 ee mov %r13d,%r14d 9: 48 c7 c7 e0 6f 8d 8b mov $0xffffffff8b8d6fe0,%rdi 10: e8 58 62 af 09 call 0x9af626d 15: 31 d2 xor %edx,%edx 17: 65 66 89 15 36 e5 1c mov %dx,%gs:0x121ce536(%rip) # 0x121ce555 1e: 12 1f: e8 a9 5c 47 00 call 0x475ccd 24: fb sti 25: bb ff ff ff ff mov $0xffffffff,%ebx * 2a: 49 c7 c4 c0 c0 20 8e mov $0xffffffff8e20c0c0,%r12 <-- trapping instruction 31: 41 0f bc de bsf %r14d,%ebx 35: 83 c3 01 add $0x1,%ebx 38: 0f 85 a4 00 00 00 jne 0xe2 3e: e9 .byte 0xe9 3f: ab stos %eax,%es:(%rdi)