================================================================== BUG: KASAN: double-free in slab_free mm/slub.c:3786 [inline] BUG: KASAN: double-free in __kmem_cache_free+0xaf/0x2d0 mm/slub.c:3799 Free of addr ffff888076059c00 by task syz-executor.3/5166 CPU: 2 PID: 5166 Comm: syz-executor.3 Not tainted 6.4.0-rc6-syzkaller-00037-gb6dad5178cea #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:351 print_report mm/kasan/report.c:462 [inline] kasan_report_invalid_free+0xe8/0x100 mm/kasan/report.c:537 ____kasan_slab_free+0x185/0x1c0 mm/kasan/common.c:225 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3786 [inline] __kmem_cache_free+0xaf/0x2d0 mm/slub.c:3799 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+0xa1/0x100 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_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7f83579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000ffd5568c EFLAGS: 00000292 ORIG_RAX: 0000000000000034 RAX: 0000000000000000 RBX: 00000000ffd55730 RCX: 000000000000000a RDX: 00000000f734e000 RSI: 0000000000000000 RDI: 00000000f72a24c4 RBP: 00000000ffd55730 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 12736: 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+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc+0x5e/0x190 mm/slab_common.c:979 kmalloc include/linux/slab.h:563 [inline] kzalloc include/linux/slab.h:680 [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_brec_read+0x25/0x120 fs/hfs/bfind.c:165 hfs_lookup+0x1e2/0x310 fs/hfs/dir.c:32 __lookup_slow+0x24c/0x460 fs/namei.c:1690 lookup_slow fs/namei.c:1707 [inline] walk_component+0x33f/0x5a0 fs/namei.c:1998 link_path_walk.part.0+0x74e/0xd60 fs/namei.c:2325 link_path_walk fs/namei.c:2250 [inline] path_parentat+0xa8/0x1b0 fs/namei.c:2526 __filename_parentat+0x1dd/0x620 fs/namei.c:2550 filename_parentat fs/namei.c:2568 [inline] do_renameat2+0x176/0xd40 fs/namei.c:4913 __do_sys_rename fs/namei.c:5048 [inline] __se_sys_rename fs/namei.c:5046 [inline] __ia32_sys_rename+0x80/0xa0 fs/namei.c:5046 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Freed by task 112: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3786 [inline] __kmem_cache_free+0xaf/0x2d0 mm/slub.c:3799 hfs_release_folio+0x462/0x570 fs/hfs/inode.c:123 filemap_release_folio+0x13f/0x1b0 mm/filemap.c:4124 shrink_folio_list+0x2f51/0x3dc0 mm/vmscan.c:2077 evict_folios+0x794/0x1940 mm/vmscan.c:5158 try_to_shrink_lruvec+0x82c/0xb90 mm/vmscan.c:5334 shrink_one+0x462/0x710 mm/vmscan.c:5378 shrink_many mm/vmscan.c:5430 [inline] lru_gen_shrink_node mm/vmscan.c:5547 [inline] shrink_node+0x1fd5/0x3500 mm/vmscan.c:6488 kswapd_shrink_node mm/vmscan.c:7288 [inline] balance_pgdat+0xa02/0x1ac0 mm/vmscan.c:7478 kswapd+0x677/0xd60 mm/vmscan.c:7738 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff888076059c00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 0 bytes inside of 192-byte region [ffff888076059c00, ffff888076059cc0) The buggy address belongs to the physical page: page:ffffea0001d81640 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x76059 anon flags: 0x4fff00000000200(slab|node=1|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 04fff00000000200 ffff888012442a00 ffffea00010efb80 dead000000000005 raw: 0000000000000000 0000000000100010 00000001ffffffff 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 5443, tgid 5443 (syz-executor.0), ts 162169311306, free_ts 162168272169 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3502 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768 __alloc_pages_node include/linux/gfp.h:237 [inline] alloc_slab_page mm/slub.c:1853 [inline] allocate_slab+0xa7/0x390 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3192 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3291 __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] __kmem_cache_alloc_node+0x136/0x320 mm/slub.c:3490 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc_node+0x51/0x1a0 mm/slab_common.c:973 kmalloc_array_node include/linux/slab.h:657 [inline] kcalloc_node include/linux/slab.h:662 [inline] memcg_alloc_slab_cgroups+0x8f/0x150 mm/memcontrol.c:2928 memcg_slab_post_alloc_hook+0xa9/0x390 mm/slab.h:491 slab_post_alloc_hook mm/slab.h:719 [inline] slab_alloc_node mm/slub.c:3451 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc_lru+0x23c/0x600 mm/slub.c:3482 __d_alloc+0x32/0x980 fs/dcache.c:1769 d_alloc+0x4e/0x240 fs/dcache.c:1849 lookup_one_qstr_excl+0xcc/0x180 fs/namei.c:1601 filename_create+0x1da/0x4a0 fs/namei.c:3885 do_symlinkat+0xc8/0x2e0 fs/namei.c:4494 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2564 free_unref_page+0x33/0x370 mm/page_alloc.c:2659 vfree+0x180/0x7e0 mm/vmalloc.c:2798 compat_copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:1575 [inline] compat_get_entries+0x56e/0x7d0 net/ipv6/netfilter/ip6_tables.c:1605 do_ip6t_get_ctl+0x4f1/0xa10 net/ipv6/netfilter/ip6_tables.c:1666 nf_getsockopt+0x76/0xd0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1ef/0x2a0 net/ipv6/ipv6_sockglue.c:1500 tcp_getsockopt+0x99/0x100 net/ipv4/tcp.c:4410 __sys_getsockopt+0x21a/0x6a0 net/socket.c:2317 __do_compat_sys_socketcall+0x4c1/0x720 net/compat.c:494 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Memory state around the buggy address: ffff888076059b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888076059b80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888076059c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888076059c80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888076059d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 retq 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi