================================================================== BUG: KASAN: double-free in kfree+0xb8/0x19c mm/slab_common.c:1015 Free of addr ffff0000dd4a8000 by task syz-executor.0/5820 CPU: 1 PID: 5820 Comm: syz-executor.0 Not tainted 6.4.0-rc6-syzkaller-00279-g8c1f0c38b310 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233 show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:351 [inline] print_report+0x174/0x514 mm/kasan/report.c:462 kasan_report_invalid_free+0xc4/0x114 mm/kasan/report.c:537 ____kasan_slab_free+0x14c/0x1a4 mm/kasan/common.c:225 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3786 [inline] __kmem_cache_free+0x220/0x410 mm/slub.c:3799 kfree+0xb8/0x19c mm/slab_common.c:1015 diUnmount+0xf4/0x10c fs/jfs/jfs_imap.c:195 jfs_umount+0x15c/0x360 fs/jfs/jfs_umount.c:63 jfs_put_super+0x90/0x188 fs/jfs/super.c:194 generic_shutdown_super+0x130/0x328 fs/super.c:500 kill_block_super+0x70/0xdc fs/super.c:1407 deactivate_locked_super+0xac/0x124 fs/super.c:331 deactivate_super+0xe0/0x100 fs/super.c:362 cleanup_mnt+0x34c/0x3dc fs/namespace.c:1177 __cleanup_mnt+0x20/0x30 fs/namespace.c:1184 task_work_run+0x230/0x2e0 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2180/0x3c90 arch/arm64/kernel/signal.c:1304 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x90/0x15c arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 Allocated by task 5820: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:510 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x90/0xa8 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc+0xcc/0x1b8 mm/slab_common.c:979 kmalloc include/linux/slab.h:563 [inline] tomoyo_realpath_from_path+0xc8/0x4cc security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x1ec/0x414 security/tomoyo/file.c:771 tomoyo_file_open+0x130/0x19c security/tomoyo/tomoyo.c:332 security_file_open+0x6c/0xb0 security/security.c:2797 do_dentry_open+0x2a0/0xf90 fs/open.c:907 vfs_open+0x7c/0x90 fs/open.c:1051 do_open fs/namei.c:3636 [inline] path_openat+0x1f2c/0x27f8 fs/namei.c:3791 do_filp_open+0x1bc/0x3cc fs/namei.c:3818 do_sys_openat2+0x128/0x3d8 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __arm64_sys_openat+0x1f0/0x240 fs/open.c:1383 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:193 el0_svc+0x4c/0x15c arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 Freed by task 5820: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:521 ____kasan_slab_free+0x128/0x1a4 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3786 [inline] __kmem_cache_free+0x220/0x410 mm/slub.c:3799 kfree+0xb8/0x19c mm/slab_common.c:1015 tomoyo_realpath_from_path+0x484/0x4cc security/tomoyo/realpath.c:286 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x1ec/0x414 security/tomoyo/file.c:771 tomoyo_file_open+0x130/0x19c security/tomoyo/tomoyo.c:332 security_file_open+0x6c/0xb0 security/security.c:2797 do_dentry_open+0x2a0/0xf90 fs/open.c:907 vfs_open+0x7c/0x90 fs/open.c:1051 do_open fs/namei.c:3636 [inline] path_openat+0x1f2c/0x27f8 fs/namei.c:3791 do_filp_open+0x1bc/0x3cc fs/namei.c:3818 do_sys_openat2+0x128/0x3d8 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __arm64_sys_openat+0x1f0/0x240 fs/open.c:1383 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:193 el0_svc+0x4c/0x15c arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 The buggy address belongs to the object at ffff0000dd4a8000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 0 bytes inside of 4096-byte region [ffff0000dd4a8000, ffff0000dd4a9000) The buggy address belongs to the physical page: page:00000000e6e9d9ee refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11d4a8 head:00000000e6e9d9ee order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000010200 ffff0000c0002a80 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000dd4a7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000dd4a7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000dd4a8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000dd4a8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000dd4a8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ WARNING: CPU: 1 PID: 5820 at mm/slab_common.c:934 free_large_kmalloc+0x34/0x12c mm/slab_common.c:935 Modules linked in: CPU: 1 PID: 5820 Comm: syz-executor.0 Tainted: G B 6.4.0-rc6-syzkaller-00279-g8c1f0c38b310 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : free_large_kmalloc+0x34/0x12c mm/slab_common.c:935 lr : kfree+0xf8/0x19c mm/slab_common.c:1009 sp : ffff80001d337700 x29: ffff80001d337700 x28: ffff0000ddf44e30 x27: ffff0000ddf444f0 x26: ffff0000c7e5b828 x25: ffff0000c7e5b820 x24: 0000000000000000 x23: ffff0000ddf43270 x22: dfff800000000000 x21: ffff8000088226ac x20: ffff0000dbe58000 x19: fffffc00036f9600 x18: ffff80001d3375d4 x17: ffff800014f6d000 x16: ffff800011c3e670 x15: 0000000000000003 x14: 00000000ffff8000 x13: 00000000faabc627 x12: 000000000000000f x11: 0000000000000000 x10: 0000000000000000 x9 : 05ffc00000000000 x8 : ffff8000174ef000 x7 : 0000000000000000 x6 : 000000000000003f x5 : 0000000000000040 x4 : 0000000000000000 x3 : 0000000000000030 x2 : 0000000000000008 x1 : ffff0000dbe58000 x0 : fffffc00036f9600 Call trace: free_large_kmalloc+0x34/0x12c mm/slab_common.c:935 kfree+0xf8/0x19c mm/slab_common.c:1009 diUnmount+0xf4/0x10c fs/jfs/jfs_imap.c:195 jfs_umount+0x15c/0x360 fs/jfs/jfs_umount.c:63 jfs_put_super+0x90/0x188 fs/jfs/super.c:194 generic_shutdown_super+0x130/0x328 fs/super.c:500 kill_block_super+0x70/0xdc fs/super.c:1407 deactivate_locked_super+0xac/0x124 fs/super.c:331 deactivate_super+0xe0/0x100 fs/super.c:362 cleanup_mnt+0x34c/0x3dc fs/namespace.c:1177 __cleanup_mnt+0x20/0x30 fs/namespace.c:1184 task_work_run+0x230/0x2e0 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2180/0x3c90 arch/arm64/kernel/signal.c:1304 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x90/0x15c arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 irq event stamp: 167767 hardirqs last enabled at (167767): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1378 [inline] hardirqs last enabled at (167767): [] finish_lock_switch+0xbc/0x1e4 kernel/sched/core.c:5095 hardirqs last disabled at (167766): [] __schedule+0x2b4/0x23b8 kernel/sched/core.c:6568 softirqs last enabled at (166938): [] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32 softirqs last disabled at (166936): [] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19 ---[ end trace 0000000000000000 ]--- object pointer: 0x000000009af42ce0 page:00000000b54f14c4 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11be58 flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000000 fffffc00033a7808 fffffc000351de08 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0) ------------[ cut here ]------------ kernel BUG at include/linux/mm.h:996! Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 5820 Comm: syz-executor.0 Tainted: G B W 6.4.0-rc6-syzkaller-00279-g8c1f0c38b310 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : put_page_testzero include/linux/mm.h:996 [inline] pc : __free_pages+0x15c/0x1cc mm/page_alloc.c:4856 lr : put_page_testzero include/linux/mm.h:996 [inline] lr : __free_pages+0x15c/0x1cc mm/page_alloc.c:4856 sp : ffff80001d3376c0 x29: ffff80001d3376c0 x28: ffff0000ddf44e30 x27: ffff0000ddf444f0 x26: ffff0000c7e5b828 x25: ffff0000c7e5b820 x24: 0000000000000000 x23: dfff800000000000 x22: 05ffc00000000000 x21: fffffc00036f9634 x20: 0000000000000000 x19: fffffc00036f9600 x18: 1fffe000368de9be x17: 0000000000000000 x16: ffff800011b945f0 x15: 0000000000000001 x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000001 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : ffff0000cc233780 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff80001d336f38 x4 : ffff80001504c840 x3 : ffff800008352c5c x2 : 0000000000000001 x1 : 0000000100000000 x0 : 000000000000003e Call trace: put_page_testzero include/linux/mm.h:996 [inline] __free_pages+0x15c/0x1cc mm/page_alloc.c:4856 free_large_kmalloc+0xc8/0x12c mm/slab_common.c:943 kfree+0xf8/0x19c mm/slab_common.c:1009 diUnmount+0xf4/0x10c fs/jfs/jfs_imap.c:195 jfs_umount+0x15c/0x360 fs/jfs/jfs_umount.c:63 jfs_put_super+0x90/0x188 fs/jfs/super.c:194 generic_shutdown_super+0x130/0x328 fs/super.c:500 kill_block_super+0x70/0xdc fs/super.c:1407 deactivate_locked_super+0xac/0x124 fs/super.c:331 deactivate_super+0xe0/0x100 fs/super.c:362 cleanup_mnt+0x34c/0x3dc fs/namespace.c:1177 __cleanup_mnt+0x20/0x30 fs/namespace.c:1184 task_work_run+0x230/0x2e0 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2180/0x3c90 arch/arm64/kernel/signal.c:1304 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x90/0x15c arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 Code: 9004aa41 911f8021 aa1303e0 97fd9043 (d4210000) ---[ end trace 0000000000000000 ]---