================================================================== BUG: KASAN: double-free in slab_free mm/slub.c:3801 [inline] BUG: KASAN: double-free in __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3814 Free of addr ffff888023d71400 by task syz-executor.0/5180 CPU: 2 PID: 5180 Comm: syz-executor.0 Not tainted 6.5.0-rc4-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report_invalid_free+0xab/0xd0 mm/kasan/report.c:550 ____kasan_slab_free+0x183/0x1b0 mm/kasan/common.c:225 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1792 [inline] slab_free_freelist_hook+0x10b/0x1e0 mm/slub.c:1818 slab_free mm/slub.c:3801 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3814 hfs_btree_close+0xac/0x390 fs/hfs/btree.c:154 hfs_mdb_put+0xbf/0x380 fs/hfs/mdb.c:360 generic_shutdown_super+0x158/0x480 fs/super.c:499 kill_block_super+0x64/0xb0 fs/super.c:1417 deactivate_locked_super+0x9a/0x170 fs/super.c:330 deactivate_super+0xde/0x100 fs/super.c:361 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 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+0x6d/0xe0 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:0xf7f41579 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:00000000ffd426c8 EFLAGS: 00000292 ORIG_RAX: 0000000000000034 RAX: 0000000000000000 RBX: 00000000ffd42770 RCX: 000000000000000a RDX: 00000000f7353ff4 RSI: 00000000f72a53bd RDI: 00000000ffd43814 RBP: 00000000ffd42770 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 13600: kasan_save_stack+0x33/0x50 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+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:985 [inline] __kmalloc+0x5d/0x100 mm/slab_common.c:998 kmalloc include/linux/slab.h:586 [inline] kzalloc include/linux/slab.h:703 [inline] __hfs_bnode_create+0x108/0x850 fs/hfs/bnode.c:259 hfs_bnode_find+0x2cf/0xcb0 fs/hfs/bnode.c:335 hfs_brec_find+0x2af/0x510 fs/hfs/bfind.c:126 hfs_cat_create+0x2ff/0x820 fs/hfs/catalog.c:112 hfs_create+0x67/0xe0 fs/hfs/dir.c:202 lookup_open.isra.0+0x1049/0x1360 fs/namei.c:3492 open_last_lookups fs/namei.c:3560 [inline] path_openat+0x931/0x29c0 fs/namei.c:3790 do_filp_open+0x1de/0x430 fs/namei.c:3820 do_sys_openat2+0x176/0x1e0 fs/open.c:1407 do_sys_open fs/open.c:1422 [inline] __do_compat_sys_openat fs/open.c:1482 [inline] __se_compat_sys_openat fs/open.c:1480 [inline] __ia32_compat_sys_openat+0x16e/0x200 fs/open.c:1480 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 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+0x33/0x50 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:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15e/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1792 [inline] slab_free_freelist_hook+0x10b/0x1e0 mm/slub.c:1818 slab_free mm/slub.c:3801 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3814 hfs_release_folio+0x431/0x570 fs/hfs/inode.c:123 filemap_release_folio+0x143/0x1b0 mm/filemap.c:4079 shrink_folio_list+0x2e7a/0x3d40 mm/vmscan.c:2068 evict_folios+0x6bc/0x18f0 mm/vmscan.c:5181 try_to_shrink_lruvec+0x769/0xb00 mm/vmscan.c:5357 shrink_one+0x45f/0x700 mm/vmscan.c:5401 shrink_many mm/vmscan.c:5453 [inline] lru_gen_shrink_node mm/vmscan.c:5570 [inline] shrink_node+0x20c2/0x3730 mm/vmscan.c:6510 kswapd_shrink_node mm/vmscan.c:7315 [inline] balance_pgdat+0xa37/0x1b90 mm/vmscan.c:7505 kswapd+0x5be/0xbf0 mm/vmscan.c:7765 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 insert_work+0x4a/0x330 kernel/workqueue.c:1553 __queue_work+0x5f5/0x1040 kernel/workqueue.c:1714 queue_work_on+0xed/0x110 kernel/workqueue.c:1744 queue_work include/linux/workqueue.h:506 [inline] netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:659 [inline] netdevice_event+0x6be/0x9a0 drivers/infiniband/core/roce_gid_mgmt.c:802 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1962 call_netdevice_notifiers_extack net/core/dev.c:2000 [inline] call_netdevice_notifiers net/core/dev.c:2014 [inline] unregister_netdevice_many_notify+0x82b/0x19a0 net/core/dev.c:10850 ip_tunnel_delete_nets+0x2bb/0x3a0 net/ipv4/ip_tunnel.c:1144 ops_exit_list+0x125/0x170 net/core/net_namespace.c:175 cleanup_net+0x505/0xb20 net/core/net_namespace.c:614 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2597 worker_thread+0x687/0x1110 kernel/workqueue.c:2748 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2649 neigh_parms_release net/core/neighbour.c:1750 [inline] neigh_parms_release+0x209/0x290 net/core/neighbour.c:1741 addrconf_ifdown.isra.0+0x166c/0x1c50 net/ipv6/addrconf.c:3914 addrconf_notify+0x22d/0x1940 net/ipv6/addrconf.c:3683 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1962 call_netdevice_notifiers_extack net/core/dev.c:2000 [inline] call_netdevice_notifiers net/core/dev.c:2014 [inline] unregister_netdevice_many_notify+0x82b/0x19a0 net/core/dev.c:10850 ip_tunnel_delete_nets+0x2bb/0x3a0 net/ipv4/ip_tunnel.c:1144 ops_exit_list+0x125/0x170 net/core/net_namespace.c:175 cleanup_net+0x505/0xb20 net/core/net_namespace.c:614 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2597 worker_thread+0x687/0x1110 kernel/workqueue.c:2748 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 The buggy address belongs to the object at ffff888023d71400 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 0 bytes inside of 192-byte region [ffff888023d71400, ffff888023d714c0) The buggy address belongs to the physical page: page:ffffea00008f5c40 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888023d71200 pfn:0x23d71 anon flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000200 ffff888012842a00 0000000000000000 dead000000000001 raw: ffff888023d71200 000000008010000b 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 0x112c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 8851, tgid 8851 (syz-executor.0), ts 222653043778, free_ts 222484013581 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 __alloc_pages_node include/linux/gfp.h:237 [inline] alloc_slab_page mm/slub.c:1864 [inline] allocate_slab+0xa1/0x380 mm/slub.c:2009 new_slab mm/slub.c:2062 [inline] ___slab_alloc+0x8bc/0x1570 mm/slub.c:3215 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3314 __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3509 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc_node+0x4f/0x100 mm/slab_common.c:992 kmalloc_array_node include/linux/slab.h:680 [inline] kcalloc_node include/linux/slab.h:685 [inline] memcg_alloc_slab_cgroups+0xa9/0x170 mm/memcontrol.c:2899 memcg_slab_post_alloc_hook+0xaa/0x390 mm/slab.h:530 slab_post_alloc_hook mm/slab.h:770 [inline] slab_alloc_node mm/slub.c:3470 [inline] slab_alloc mm/slub.c:3478 [inline] __kmem_cache_alloc_lru mm/slub.c:3485 [inline] kmem_cache_alloc+0x1a7/0x3b0 mm/slub.c:3494 kmem_cache_zalloc include/linux/slab.h:693 [inline] alloc_buffer_head+0x21/0x140 fs/buffer.c:3037 folio_alloc_buffers+0x2ad/0x800 fs/buffer.c:940 folio_create_empty_buffers+0x36/0x470 fs/buffer.c:1669 ext4_block_write_begin+0xc08/0xe30 fs/ext4/inode.c:1024 ext4_da_write_begin+0x40a/0x8c0 fs/ext4/inode.c:2892 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2348 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443 vfree+0x181/0x7a0 mm/vmalloc.c:2842 delayed_vfree_work+0x56/0x70 mm/vmalloc.c:2763 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2597 worker_thread+0x687/0x1110 kernel/workqueue.c:2748 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff888023d71300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888023d71380: 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888023d71400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888023d71480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888023d71500: 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 ret 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