================================================================== BUG: KASAN: double-free in hfs_release_folio+0x462/0x570 fs/hfs/inode.c:123 Free of addr ffff888027ba1000 by task kswapd0/100 CPU: 1 PID: 100 Comm: kswapd0 Not tainted 6.3.0-rc5-syzkaller-00137-gf2afccfefe7b #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:319 print_report mm/kasan/report.c:430 [inline] kasan_report_invalid_free+0xe8/0x100 mm/kasan/report.c:501 ____kasan_slab_free+0x160/0x1a0 mm/kasan/common.c:225 kasan_slab_free include/linux/kasan.h:162 [inline] __cache_free mm/slab.c:3390 [inline] __do_kmem_cache_free mm/slab.c:3577 [inline] __kmem_cache_free+0xcd/0x2c0 mm/slab.c:3584 hfs_release_folio+0x462/0x570 fs/hfs/inode.c:123 filemap_release_folio+0x13f/0x1b0 mm/filemap.c:4121 shrink_folio_list+0x1fe3/0x3c80 mm/vmscan.c:2010 evict_folios+0x794/0x1940 mm/vmscan.c:5121 try_to_shrink_lruvec+0x82c/0xb90 mm/vmscan.c:5297 shrink_one+0x46b/0x810 mm/vmscan.c:5341 shrink_many mm/vmscan.c:5394 [inline] lru_gen_shrink_node mm/vmscan.c:5511 [inline] shrink_node+0x2064/0x35f0 mm/vmscan.c:6459 kswapd_shrink_node mm/vmscan.c:7262 [inline] balance_pgdat+0xa02/0x1ac0 mm/vmscan.c:7452 kswapd+0x677/0xd60 mm/vmscan.c:7712 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 14493: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] ____kasan_kmalloc mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa3/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:967 [inline] __kmalloc+0x5e/0x190 mm/slab_common.c:980 kmalloc include/linux/slab.h:584 [inline] kzalloc include/linux/slab.h:720 [inline] __hfs_bnode_create+0x107/0x820 fs/hfs/bnode.c:259 hfs_bnode_find+0x423/0xc60 fs/hfs/bnode.c:335 hfs_brec_find+0x299/0x500 fs/hfs/bfind.c:126 hfs_cat_create+0x396/0xaa0 fs/hfs/catalog.c:112 hfs_create+0x6b/0xf0 fs/hfs/dir.c:202 lookup_open.isra.0+0x105a/0x1400 fs/namei.c:3416 open_last_lookups fs/namei.c:3484 [inline] path_openat+0x975/0x2750 fs/namei.c:3712 do_filp_open+0x1ba/0x410 fs/namei.c:3742 do_sys_openat2+0x16d/0x4c0 fs/open.c:1348 do_sys_open fs/open.c:1364 [inline] __do_sys_openat fs/open.c:1380 [inline] __se_sys_openat fs/open.c:1375 [inline] __x64_sys_openat+0x143/0x1f0 fs/open.c:1375 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5165: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x13b/0x1a0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] __cache_free mm/slab.c:3390 [inline] __do_kmem_cache_free mm/slab.c:3577 [inline] __kmem_cache_free+0xcd/0x2c0 mm/slab.c:3584 hfs_btree_close+0xab/0x390 fs/hfs/btree.c:154 hfs_mdb_put+0xbf/0x380 fs/hfs/mdb.c:360 generic_shutdown_super+0x158/0x480 fs/super.c:500 kill_block_super+0x9b/0xf0 fs/super.c:1407 deactivate_locked_super+0x98/0x160 fs/super.c:331 deactivate_super+0xb1/0xd0 fs/super.c:362 cleanup_mnt+0x2ae/0x3d0 fs/namespace.c:1177 task_work_run+0x16f/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888027ba1000 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 0 bytes inside of 192-byte region [ffff888027ba1000, ffff888027ba10c0) The buggy address belongs to the physical page: page:ffffea00009ee840 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x27ba1 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff888012440000 ffffea000071ecd0 ffffea000077ed50 raw: 0000000000000000 ffff888027ba1000 0000000100000010 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 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 10619, tgid 10615 (syz-executor.0), ts 420516271297, free_ts 412921901088 prep_new_page mm/page_alloc.c:2553 [inline] get_page_from_freelist+0x1190/0x2e20 mm/page_alloc.c:4326 __alloc_pages_slowpath.constprop.0+0x2e7/0x2170 mm/page_alloc.c:5126 __alloc_pages+0x408/0x4a0 mm/page_alloc.c:5605 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1360 [inline] cache_grow_begin+0x9b/0x3b0 mm/slab.c:2570 cache_alloc_refill+0x27f/0x380 mm/slab.c:2943 ____cache_alloc mm/slab.c:3019 [inline] ____cache_alloc mm/slab.c:3002 [inline] __do_cache_alloc mm/slab.c:3202 [inline] slab_alloc_node mm/slab.c:3250 [inline] __kmem_cache_alloc_node+0x360/0x3f0 mm/slab.c:3541 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1061 kmalloc include/linux/slab.h:580 [inline] __iomap_dio_rw+0x22b/0x1c20 fs/iomap/direct-io.c:499 iomap_dio_rw+0x40/0xa0 fs/iomap/direct-io.c:683 ext4_dio_write_iter fs/ext4/file.c:597 [inline] ext4_file_write_iter+0x94a/0x1740 fs/ext4/file.c:708 call_write_iter include/linux/fs.h:1851 [inline] do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735 do_iter_write+0x182/0x700 fs/read_write.c:861 vfs_iter_write+0x74/0xa0 fs/read_write.c:902 iter_file_splice_write+0x743/0xc80 fs/splice.c:778 do_splice_from fs/splice.c:856 [inline] direct_splice_actor+0x114/0x180 fs/splice.c:1022 splice_direct_to_actor+0x335/0x8a0 fs/splice.c:977 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1454 [inline] free_pcp_prepare+0x5d5/0xa50 mm/page_alloc.c:1504 free_unref_page_prepare mm/page_alloc.c:3388 [inline] free_unref_page+0x1d/0x490 mm/page_alloc.c:3483 slab_destroy mm/slab.c:1613 [inline] drain_freelist.isra.0+0xdd/0x130 mm/slab.c:2206 cache_reap+0x1bd/0x2e0 mm/slab.c:3871 process_one_work+0x991/0x15c0 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff888027ba0f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888027ba0f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888027ba1000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888027ba1080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888027ba1100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================