================================================================== BUG: KASAN: slab-use-after-free in rht_key_hashfn include/linux/rhashtable.h:159 [inline] BUG: KASAN: slab-use-after-free in rht_head_hashfn include/linux/rhashtable.h:174 [inline] BUG: KASAN: slab-use-after-free in __rhashtable_remove_fast_one include/linux/rhashtable.h:1007 [inline] BUG: KASAN: slab-use-after-free in __rhashtable_remove_fast include/linux/rhashtable.h:1093 [inline] BUG: KASAN: slab-use-after-free in rhashtable_remove_fast include/linux/rhashtable.h:1122 [inline] BUG: KASAN: slab-use-after-free in xfs_buf_rele_cached fs/xfs/xfs_buf.c:926 [inline] BUG: KASAN: slab-use-after-free in xfs_buf_rele+0x977/0x1030 fs/xfs/xfs_buf.c:951 Read of size 4 at addr ffff888034662408 by task kswapd0/73 CPU: 0 UID: 0 PID: 73 Comm: kswapd0 Not tainted 6.16.0-syzkaller-11579-g35a813e010b9 #0 PREEMPT(full) 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_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 rht_key_hashfn include/linux/rhashtable.h:159 [inline] rht_head_hashfn include/linux/rhashtable.h:174 [inline] __rhashtable_remove_fast_one include/linux/rhashtable.h:1007 [inline] __rhashtable_remove_fast include/linux/rhashtable.h:1093 [inline] rhashtable_remove_fast include/linux/rhashtable.h:1122 [inline] xfs_buf_rele_cached fs/xfs/xfs_buf.c:926 [inline] xfs_buf_rele+0x977/0x1030 fs/xfs/xfs_buf.c:951 xfs_buftarg_shrink_scan+0x23e/0x2d0 fs/xfs/xfs_buf.c:1653 do_shrink_slab+0x6ef/0x1110 mm/shrinker.c:437 shrink_slab+0xd74/0x10d0 mm/shrinker.c:664 shrink_one+0x28a/0x7c0 mm/vmscan.c:4954 shrink_many mm/vmscan.c:5015 [inline] lru_gen_shrink_node mm/vmscan.c:5093 [inline] shrink_node+0x314e/0x3760 mm/vmscan.c:6078 kswapd_shrink_node mm/vmscan.c:6938 [inline] balance_pgdat mm/vmscan.c:7121 [inline] kswapd+0x147c/0x2830 mm/vmscan.c:7386 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 5357: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4365 [inline] __kvmalloc_node_noprof+0x30d/0x5f0 mm/slub.c:5052 bucket_table_alloc lib/rhashtable.c:186 [inline] rhashtable_init_noprof+0x4ee/0xbb0 lib/rhashtable.c:1075 xfs_perag_alloc fs/xfs/libxfs/xfs_ag.c:238 [inline] xfs_initialize_perag+0x27d/0x630 fs/xfs/libxfs/xfs_ag.c:279 xfs_mountfs+0xae0/0x2330 fs/xfs/xfs_mount.c:976 xfs_fs_fill_super+0x11b3/0x1600 fs/xfs/xfs_super.c:1965 get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1692 vfs_get_tree+0x8f/0x2b0 fs/super.c:1815 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3805 do_mount fs/namespace.c:4133 [inline] __do_sys_mount fs/namespace.c:4344 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4321 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5357: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2417 [inline] slab_free mm/slub.c:4680 [inline] kfree+0x18e/0x440 mm/slub.c:4879 rhashtable_free_and_destroy+0x7e8/0x940 lib/rhashtable.c:1173 xfs_group_free+0x163/0x370 fs/xfs/libxfs/xfs_group.c:171 xfs_free_perag_range+0x36/0x60 fs/xfs/libxfs/xfs_ag.c:133 xfs_mountfs+0x1445/0x2330 fs/xfs/xfs_mount.c:1269 xfs_fs_fill_super+0x11b3/0x1600 fs/xfs/xfs_super.c:1965 get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1692 vfs_get_tree+0x8f/0x2b0 fs/super.c:1815 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3805 do_mount fs/namespace.c:4133 [inline] __do_sys_mount fs/namespace.c:4344 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4321 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888034662400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of freed 512-byte region [ffff888034662400, ffff888034662600) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x34662 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 ksm flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801a441c80 ffffea0000d16900 dead000000000003 raw: 0000000000000000 0000000000080008 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff88801a441c80 ffffea0000d16900 dead000000000003 head: 0000000000000000 0000000000080008 00000000f5000000 0000000000000000 head: 04fff00000000001 ffffea0000d19881 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd2000(__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 16435876185, free_ts 15466862291 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab+0x8a/0x370 mm/slub.c:2655 new_slab mm/slub.c:2709 [inline] ___slab_alloc+0xbeb/0x1410 mm/slub.c:3891 __slab_alloc mm/slub.c:3981 [inline] __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] __kmalloc_cache_noprof+0x296/0x3d0 mm/slub.c:4391 kmalloc_noprof include/linux/slab.h:905 [inline] usb_cache_string+0x66/0x140 drivers/usb/core/message.c:1028 usb_enumerate_device drivers/usb/core/hub.c:2537 [inline] usb_new_device+0x2fe/0x16f0 drivers/usb/core/hub.c:2664 register_root_hub+0x275/0x590 drivers/usb/core/hcd.c:994 usb_add_hcd+0xba1/0x1050 drivers/usb/core/hcd.c:2989 vhci_hcd_probe+0x144/0x380 drivers/usb/usbip/vhci_hcd.c:1363 platform_probe+0xf6/0x190 drivers/base/platform.c:1405 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x26a/0x9e0 drivers/base/dd.c:659 __driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801 driver_probe_device+0x4f/0x430 drivers/base/dd.c:831 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895 discard_slab mm/slub.c:2753 [inline] __put_partials+0x156/0x1a0 mm/slub.c:3218 put_cpu_partial+0x17c/0x250 mm/slub.c:3293 __slab_free+0x2d5/0x3c0 mm/slub.c:4550 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4180 [inline] slab_alloc_node mm/slub.c:4229 [inline] __kmalloc_cache_noprof+0x1be/0x3d0 mm/slub.c:4391 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] bus_add_driver+0x162/0x640 drivers/base/bus.c:662 driver_register+0x23a/0x320 drivers/base/driver.c:249 usb_register_driver+0x1e4/0x390 drivers/usb/core/driver.c:1078 do_one_initcall+0x233/0x820 init/main.c:1269 do_initcall_level+0x104/0x190 init/main.c:1331 do_initcalls+0x59/0xa0 init/main.c:1347 kernel_init_freeable+0x334/0x4b0 init/main.c:1579 kernel_init+0x1d/0x1d0 init/main.c:1469 Memory state around the buggy address: ffff888034662300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888034662380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888034662400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888034662480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888034662500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================