================================================================== BUG: KASAN: slab-out-of-bounds in cache_alloc_handle mm/zsmalloc.c:410 [inline] BUG: KASAN: slab-out-of-bounds in zs_malloc+0x77/0x720 mm/zsmalloc.c:1281 Read of size 8 at addr ffff888100ae7680 by task syz.2.19/6046 CPU: 1 UID: 0 PID: 6046 Comm: syz.2.19 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-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 cache_alloc_handle mm/zsmalloc.c:410 [inline] zs_malloc+0x77/0x720 mm/zsmalloc.c:1281 zswap_compress mm/zswap.c:910 [inline] zswap_store_page mm/zswap.c:1429 [inline] zswap_store+0x1062/0x1f40 mm/zswap.c:1540 swap_writeout+0x710/0xd70 mm/page_io.c:275 writeout mm/vmscan.c:662 [inline] pageout mm/vmscan.c:721 [inline] shrink_folio_list+0x3011/0x4c70 mm/vmscan.c:1453 reclaim_folio_list+0xeb/0x500 mm/vmscan.c:2233 reclaim_pages+0x454/0x520 mm/vmscan.c:2270 madvise_cold_or_pageout_pte_range+0x1974/0x1d00 mm/madvise.c:565 walk_pmd_range mm/pagewalk.c:130 [inline] walk_pud_range mm/pagewalk.c:224 [inline] walk_p4d_range mm/pagewalk.c:262 [inline] walk_pgd_range+0xfe9/0x1d40 mm/pagewalk.c:303 __walk_page_range+0x14c/0x710 mm/pagewalk.c:410 walk_page_range_vma+0x393/0x440 mm/pagewalk.c:705 madvise_pageout_page_range mm/madvise.c:624 [inline] madvise_pageout mm/madvise.c:649 [inline] madvise_vma_behavior+0x311f/0x3a10 mm/madvise.c:1352 madvise_walk_vmas+0x51c/0xa30 mm/madvise.c:1669 madvise_do_behavior+0x38e/0x550 mm/madvise.c:1885 do_madvise+0x1bc/0x270 mm/madvise.c:1978 __do_sys_madvise mm/madvise.c:1987 [inline] __se_sys_madvise mm/madvise.c:1985 [inline] __x64_sys_madvise+0xa7/0xc0 mm/madvise.c:1985 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa813d8ec29 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:00007fa814c4c038 EFLAGS: 00000246 ORIG_RAX: 000000000000001c RAX: ffffffffffffffda RBX: 00007fa813fd5fa0 RCX: 00007fa813d8ec29 RDX: 0000000000000015 RSI: 0000000000600000 RDI: 0000200000000000 RBP: 00007fa813e11e41 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fa813fd6038 R14: 00007fa813fd5fa0 R15: 00007ffcee547488 Allocated by task 1: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 unpoison_slab_object mm/kasan/common.c:342 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:368 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4945 [inline] slab_alloc_node mm/slub.c:5244 [inline] kmem_cache_alloc_noprof+0x367/0x6e0 mm/slub.c:5251 __kernfs_new_node+0xd7/0x7e0 fs/kernfs/dir.c:637 kernfs_new_node+0x102/0x210 fs/kernfs/dir.c:713 __kernfs_create_file+0x4b/0x2e0 fs/kernfs/file.c:1057 sysfs_add_file_mode_ns+0x238/0x300 fs/sysfs/file.c:313 create_files fs/sysfs/group.c:76 [inline] internal_create_group+0x66d/0x1110 fs/sysfs/group.c:183 internal_create_groups fs/sysfs/group.c:223 [inline] sysfs_create_groups+0x59/0x120 fs/sysfs/group.c:249 device_add_groups drivers/base/core.c:2836 [inline] device_add_attrs+0x1c4/0x5a0 drivers/base/core.c:2911 device_add+0x496/0xb50 drivers/base/core.c:3643 usb_new_device+0xa39/0x16f0 drivers/usb/core/hub.c:2694 register_root_hub+0x275/0x590 drivers/usb/core/hcd.c:994 usb_add_hcd+0xba1/0x1050 drivers/usb/core/hcd.c:2993 vhci_hcd_probe+0x1c1/0x380 drivers/usb/usbip/vhci_hcd.c:1377 platform_probe+0xf9/0x190 drivers/base/platform.c:1405 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x26d/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 __device_attach_driver+0x2ce/0x530 drivers/base/dd.c:959 bus_for_each_drv+0x251/0x2e0 drivers/base/bus.c:462 __device_attach+0x2b8/0x400 drivers/base/dd.c:1031 bus_probe_device+0x185/0x260 drivers/base/bus.c:537 device_add+0x7b6/0xb50 drivers/base/core.c:3689 platform_device_add+0x4b4/0x820 drivers/base/platform.c:716 platform_device_register_full+0x46c/0x570 drivers/base/platform.c:844 vhci_hcd_init+0x1bc/0x310 drivers/usb/usbip/vhci_hcd.c:1533 do_one_initcall+0x236/0x820 init/main.c:1283 do_initcall_level+0x104/0x190 init/main.c:1345 do_initcalls+0x59/0xa0 init/main.c:1361 kernel_init_freeable+0x334/0x4b0 init/main.c:1593 kernel_init+0x1d/0x1d0 init/main.c:1483 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888100ae75a0 which belongs to the cache kernfs_node_cache of size 176 The buggy address is located 48 bytes to the right of allocated 176-byte region [ffff888100ae75a0, ffff888100ae7650) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x100ae7 flags: 0x57ff00000000000(node=1|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 057ff00000000000 ffff888100015dc0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000110011 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1, tgid 1 (swapper/0), ts 12683536009, free_ts 12683151344 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3869 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5159 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3023 [inline] allocate_slab+0x96/0x3a0 mm/slub.c:3196 new_slab mm/slub.c:3250 [inline] ___slab_alloc+0xe94/0x1920 mm/slub.c:4626 __slab_alloc+0x65/0x100 mm/slub.c:4745 __slab_alloc_node mm/slub.c:4821 [inline] slab_alloc_node mm/slub.c:5232 [inline] kmem_cache_alloc_noprof+0x3f9/0x6e0 mm/slub.c:5251 __kernfs_new_node+0xd7/0x7e0 fs/kernfs/dir.c:637 kernfs_new_node+0x102/0x210 fs/kernfs/dir.c:713 __kernfs_create_file+0x4b/0x2e0 fs/kernfs/file.c:1057 sysfs_add_file_mode_ns+0x238/0x300 fs/sysfs/file.c:313 create_files fs/sysfs/group.c:76 [inline] internal_create_group+0x66d/0x1110 fs/sysfs/group.c:183 internal_create_groups fs/sysfs/group.c:223 [inline] sysfs_create_groups+0x59/0x120 fs/sysfs/group.c:249 device_add_groups drivers/base/core.c:2836 [inline] device_add_attrs+0x1c4/0x5a0 drivers/base/core.c:2911 device_add+0x496/0xb50 drivers/base/core.c:3643 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:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 __slab_free+0x2e7/0x390 mm/slub.c:5922 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:352 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4945 [inline] slab_alloc_node mm/slub.c:5244 [inline] __kmalloc_cache_noprof+0x36f/0x6f0 mm/slub.c:5718 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] device_private_init drivers/base/core.c:3534 [inline] device_add+0xbe/0xb50 drivers/base/core.c:3585 usb_new_device+0xa39/0x16f0 drivers/usb/core/hub.c:2694 register_root_hub+0x275/0x590 drivers/usb/core/hcd.c:994 usb_add_hcd+0xba1/0x1050 drivers/usb/core/hcd.c:2993 vhci_hcd_probe+0x1c1/0x380 drivers/usb/usbip/vhci_hcd.c:1377 platform_probe+0xf9/0x190 drivers/base/platform.c:1405 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x26d/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 __device_attach_driver+0x2ce/0x530 drivers/base/dd.c:959 Memory state around the buggy address: ffff888100ae7580: fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 ffff888100ae7600: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc >ffff888100ae7680: fc fc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888100ae7700: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff888100ae7780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================