R13: 0000000000000000 R14: 00007efc833b5fa0 R15: 00007efc834dfa28 iommufd_mock iommufd_mock0: Adding to iommu group 0 ================================================================== BUG: KASAN: slab-use-after-free in software_node_notify_remove+0x1bc/0x1c0 drivers/base/swnode.c:1108 Read of size 1 at addr ffff8880280efd08 by task syz.5.5271/26188 CPU: 1 UID: 0 PID: 26188 Comm: syz.5.5271 Not tainted 6.15.0-rc3-syzkaller-00019-gbc3372351d0c #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 software_node_notify_remove+0x1bc/0x1c0 drivers/base/swnode.c:1108 device_platform_notify_remove drivers/base/core.c:2387 [inline] device_del+0x594/0x9b0 drivers/base/core.c:3858 device_unregister+0x20/0xc0 drivers/base/core.c:3896 mock_dev_destroy drivers/iommu/iommufd/selftest.c:960 [inline] iommufd_test_mock_domain drivers/iommu/iommufd/selftest.c:1022 [inline] iommufd_test+0x3715/0x56a0 drivers/iommu/iommufd/selftest.c:1866 iommufd_fops_ioctl+0x4fc/0x610 drivers/iommu/iommufd/main.c:419 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7efc8318e169 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007efc840d9038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007efc833b5fa0 RCX: 00007efc8318e169 RDX: 0000200000000740 RSI: 0000000000003ba0 RDI: 0000000000000003 RBP: 00007efc840d9090 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 0000000000000000 R14: 00007efc833b5fa0 R15: 00007efc834dfa28 Allocated by task 26188: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x9d/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x236/0x370 mm/slub.c:4372 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] swnode_register+0x5a/0x540 drivers/base/swnode.c:790 fwnode_create_software_node+0x199/0x1f0 drivers/base/swnode.c:949 device_create_managed_software_node+0xd5/0x1f0 drivers/base/swnode.c:1060 mock_dev_create drivers/iommu/iommufd/selftest.c:942 [inline] iommufd_test_mock_domain drivers/iommu/iommufd/selftest.c:989 [inline] iommufd_test+0x3335/0x56a0 drivers/iommu/iommufd/selftest.c:1866 iommufd_fops_ioctl+0x4fc/0x610 drivers/iommu/iommufd/main.c:419 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 26188: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2398 [inline] slab_free mm/slub.c:4656 [inline] kfree+0x198/0x430 mm/slub.c:4855 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x22f/0x480 lib/kobject.c:737 software_node_notify_remove+0x159/0x1c0 drivers/base/swnode.c:1106 device_platform_notify_remove drivers/base/core.c:2387 [inline] device_del+0x594/0x9b0 drivers/base/core.c:3858 device_unregister+0x20/0xc0 drivers/base/core.c:3896 mock_dev_destroy drivers/iommu/iommufd/selftest.c:960 [inline] iommufd_test_mock_domain drivers/iommu/iommufd/selftest.c:1022 [inline] iommufd_test+0x3715/0x56a0 drivers/iommu/iommufd/selftest.c:1866 iommufd_fops_ioctl+0x4fc/0x610 drivers/iommu/iommufd/main.c:419 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880280efc00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 264 bytes inside of freed 512-byte region [ffff8880280efc00, ffff8880280efe00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x280ec 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 ffff88801b041c80 ffffea0001f39900 dead000000000002 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b041c80 ffffea0001f39900 dead000000000002 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea0000a03b01 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 53, tgid 53 (kworker/u8:3), ts 95197821531, free_ts 95063168831 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1718 prep_new_page mm/page_alloc.c:1726 [inline] get_page_from_freelist+0x360a/0x37a0 mm/page_alloc.c:3688 __alloc_frozen_pages_noprof+0x211/0x5b0 mm/page_alloc.c:4970 alloc_pages_mpol+0x339/0x690 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2468 [inline] allocate_slab+0x8f/0x3b0 mm/slub.c:2632 new_slab mm/slub.c:2686 [inline] ___slab_alloc+0xc3b/0x1500 mm/slub.c:3872 __slab_alloc+0x58/0xa0 mm/slub.c:3962 __slab_alloc_node mm/slub.c:4037 [inline] slab_alloc_node mm/slub.c:4198 [inline] __do_kmalloc_node mm/slub.c:4340 [inline] __kmalloc_noprof+0x2ea/0x4d0 mm/slub.c:4353 kmalloc_noprof include/linux/slab.h:909 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] fib6_info_alloc+0x2e/0xf0 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x445/0x12c0 net/ipv6/route.c:3802 addrconf_f6i_alloc+0x3c7/0x7f0 net/ipv6/route.c:4631 ipv6_add_addr+0x5d4/0x10d0 net/ipv6/addrconf.c:1121 addrconf_add_linklocal+0x36e/0xa30 net/ipv6/addrconf.c:3313 addrconf_addr_gen+0x508/0xb90 net/ipv6/addrconf.c:-1 addrconf_dev_config net/ipv6/addrconf.c:3490 [inline] addrconf_init_auto_addrs+0xa38/0xfe0 net/ipv6/addrconf.c:3568 addrconf_notify+0xaff/0x1020 net/ipv6/addrconf.c:3741 page last free pid 5904 tgid 5904 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_frozen_pages+0xde8/0x10a0 mm/page_alloc.c:2725 __slab_free+0x2c6/0x390 mm/slub.c:4567 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4161 [inline] slab_alloc_node mm/slub.c:4210 [inline] kmem_cache_alloc_noprof+0x1e1/0x390 mm/slub.c:4217 ptlock_alloc+0x20/0x70 mm/memory.c:7354 ptlock_init include/linux/mm.h:3074 [inline] pagetable_pte_ctor include/linux/mm.h:3122 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:73 [inline] pte_alloc_one+0x6d/0x160 arch/x86/mm/pgtable.c:17 do_fault_around mm/memory.c:5470 [inline] do_read_fault mm/memory.c:5509 [inline] do_fault mm/memory.c:5652 [inline] do_pte_missing mm/memory.c:4160 [inline] handle_pte_fault+0x2ac2/0x61c0 mm/memory.c:5997 __handle_mm_fault mm/memory.c:6140 [inline] handle_mm_fault+0x1129/0x1bf0 mm/memory.c:6309 do_user_addr_fault arch/x86/mm/fault.c:1337 [inline] handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x45b/0x920 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 Memory state around the buggy address: ffff8880280efc00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880280efc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880280efd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880280efd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880280efe00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================