================================================================== 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 ffff888044096b00 by task kswapd0/112 CPU: 1 PID: 112 Comm: kswapd0 Not tainted 6.4.0-rc2-syzkaller-00338-ge2065b8c1b01 #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_release_folio+0x462/0x570 fs/hfs/inode.c:123 filemap_release_folio+0x13f/0x1b0 mm/filemap.c:4118 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 Allocated by task 7181: 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_cat_find_brec+0x143/0x350 fs/hfs/catalog.c:194 hfs_fill_super+0xfbd/0x1480 fs/hfs/super.c:419 mount_bdev+0x357/0x420 fs/super.c:1380 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x350 fs/super.c:1510 do_new_mount fs/namespace.c:3039 [inline] path_mount+0x134b/0x1e40 fs/namespace.c:3369 do_mount fs/namespace.c:3382 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __ia32_sys_mount+0x282/0x300 fs/namespace.c:3568 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 5171: 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_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 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2627 neigh_parms_release net/core/neighbour.c:1750 [inline] neigh_parms_release+0x209/0x290 net/core/neighbour.c:1741 addrconf_ifdown.isra.0+0x1394/0x1940 net/ipv6/addrconf.c:3909 addrconf_notify+0x106/0x19f0 net/ipv6/addrconf.c:3678 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1935 call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers net/core/dev.c:1987 [inline] unregister_netdevice_many_notify+0x75f/0x18c0 net/core/dev.c:10882 ip_tunnel_delete_nets+0x2c2/0x3a0 net/ipv4/ip_tunnel.c:1144 ops_exit_list+0x125/0x170 net/core/net_namespace.c:175 cleanup_net+0x4ee/0xb10 net/core/net_namespace.c:614 process_one_work+0x99a/0x15e0 kernel/workqueue.c:2405 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2552 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 insert_work+0x48/0x360 kernel/workqueue.c:1365 __queue_work+0x625/0x1120 kernel/workqueue.c:1526 queue_work_on+0xf2/0x110 kernel/workqueue.c:1554 queue_work include/linux/workqueue.h:505 [inline] netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:659 [inline] netdevice_event+0x5e9/0x8f0 drivers/infiniband/core/roce_gid_mgmt.c:802 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1935 call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers net/core/dev.c:1987 [inline] __dev_notify_flags+0x120/0x2d0 net/core/dev.c:8605 dev_change_flags+0x11b/0x170 net/core/dev.c:8643 do_setlink+0x9f4/0x3d30 net/core/rtnetlink.c:2836 __rtnl_newlink+0xd69/0x1840 net/core/rtnetlink.c:3626 rtnl_newlink+0x68/0xa0 net/core/rtnetlink.c:3673 rtnetlink_rcv_msg+0x43d/0xd50 net/core/rtnetlink.c:6395 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2546 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 __sys_sendto+0x23a/0x340 net/socket.c:2144 __do_compat_sys_socketcall+0x62e/0x720 net/compat.c:475 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 The buggy address belongs to the object at ffff888044096b00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 0 bytes inside of 192-byte region [ffff888044096b00, ffff888044096bc0) The buggy address belongs to the physical page: page:ffffea0001102580 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x44096 flags: 0x4fff00000000200(slab|node=1|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 04fff00000000200 ffff888012442a00 ffffea00014b4ac0 dead000000000004 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 6194240954, free_ts 0 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_page_interleave+0x1e/0x200 mm/mempolicy.c:2112 alloc_pages+0x233/0x270 mm/mempolicy.c:2274 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/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 kmalloc_node_trace+0x21/0xd0 mm/slab_common.c:1070 kmalloc_node include/linux/slab.h:575 [inline] kzalloc_node include/linux/slab.h:691 [inline] alloc_worker+0x43/0x1c0 kernel/workqueue.c:1849 init_rescuer.part.0+0x1a/0x1a0 kernel/workqueue.c:4397 init_rescuer kernel/workqueue.c:4394 [inline] alloc_workqueue+0xd7a/0x1110 kernel/workqueue.c:4482 xfs_mru_cache_init+0x21/0x40 fs/xfs/xfs_mru_cache.c:296 init_xfs_fs+0xe9/0x400 fs/xfs/xfs_super.c:2327 do_one_initcall+0x102/0x540 init/main.c:1246 page_owner free stack trace missing Memory state around the buggy address: ffff888044096a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888044096a80: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc >ffff888044096b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888044096b80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888044096c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================