================================================================== BUG: KASAN: slab-use-after-free in jfs_lazycommit+0x7de/0xb70 fs/jfs/jfs_txnmgr.c:2735 Read of size 4 at addr ffff8880240d1894 by task jfsCommit/108 CPU: 1 PID: 108 Comm: jfsCommit Not tainted 6.6.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 jfs_lazycommit+0x7de/0xb70 fs/jfs/jfs_txnmgr.c:2735 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Allocated by task 8524: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x7d/0x90 mm/kasan/common.c:383 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] jfs_fill_super+0xff/0xc50 fs/jfs/super.c:495 mount_bdev+0x237/0x300 fs/super.c:1629 legacy_get_tree+0xef/0x190 fs/fs_context.c:662 vfs_get_tree+0x8c/0x280 fs/super.c:1750 do_new_mount+0x28f/0xae0 fs/namespace.c:3335 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 8168: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free+0xb0/0x100 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0x1e6/0x320 mm/slub.c:3822 generic_shutdown_super+0x13a/0x2c0 fs/super.c:693 kill_block_super+0x41/0x70 fs/super.c:1646 deactivate_locked_super+0xa4/0x110 fs/super.c:481 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1254 task_work_run+0x24a/0x300 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:296 do_syscall_64+0x4d/0x90 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880240d1800 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 148 bytes inside of freed 256-byte region [ffff8880240d1800, ffff8880240d1900) The buggy address belongs to the physical page: page:ffffea0000903400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880240d0000 pfn:0x240d0 head:ffffea0000903400 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888012841b40 0000000000000000 0000000000000001 raw: ffff8880240d0000 000000008010000e 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5366, tgid 5366 (syz-executor.0), ts 84888406911, free_ts 62435093032 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x31db/0x3360 mm/page_alloc.c:3170 __alloc_pages+0x255/0x670 mm/page_alloc.c:4426 alloc_slab_page+0x6a/0x160 mm/slub.c:1870 allocate_slab mm/slub.c:2017 [inline] new_slab+0x84/0x2f0 mm/slub.c:2070 ___slab_alloc+0xc85/0x1310 mm/slub.c:3223 __slab_alloc mm/slub.c:3322 [inline] __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x1aa/0x230 mm/slub.c:3517 kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1117 kmalloc include/linux/slab.h:599 [inline] tc_action_net_init include/net/act_api.h:154 [inline] ct_init_net+0xa5/0x230 net/sched/act_ct.c:1555 ops_init+0x351/0x600 net/core/net_namespace.c:136 setup_net+0x35c/0x9f0 net/core/net_namespace.c:339 copy_net_ns+0x399/0x5d0 net/core/net_namespace.c:491 create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x122/0x170 kernel/nsproxy.c:228 ksys_unshare+0x584/0xb20 kernel/fork.c:3435 __do_sys_unshare kernel/fork.c:3506 [inline] __se_sys_unshare kernel/fork.c:3504 [inline] __x64_sys_unshare+0x38/0x40 kernel/fork.c:3504 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0x90 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x8be/0x9d0 mm/page_alloc.c:2312 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2405 vfree+0x186/0x2e0 mm/vmalloc.c:2842 do_free_pages sound/core/pcm_memory.c:93 [inline] snd_pcm_lib_free_pages+0x1cc/0x290 sound/core/pcm_memory.c:499 do_hw_free sound/core/pcm_native.c:876 [inline] snd_pcm_release_substream+0x2be/0x480 sound/core/pcm_native.c:2709 snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2413 [inline] snd_pcm_oss_release+0x1a8/0x270 sound/core/oss/pcm_oss.c:2592 __fput+0x3f8/0x910 fs/file_table.c:384 __do_sys_close fs/open.c:1572 [inline] __se_sys_close+0x15f/0x220 fs/open.c:1557 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff8880240d1780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880240d1800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880240d1880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880240d1900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880240d1980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================