================================================================== BUG: KASAN: slab-use-after-free in jfs_lazycommit+0x7de/0xb70 fs/jfs/jfs_txnmgr.c:2735 Read of size 4 at addr ffff888076ff3a94 by task jfsCommit/107 CPU: 0 PID: 107 Comm: jfsCommit Not tainted 6.7.0-rc5-syzkaller-00014-g26aff849438c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/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+0x142/0x170 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:242 Allocated by task 5937: 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+0x98/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] jfs_fill_super+0xff/0xc50 fs/jfs/super.c:495 mount_bdev+0x237/0x300 fs/super.c:1650 legacy_get_tree+0xef/0x190 fs/fs_context.c:662 vfs_get_tree+0x8c/0x2a0 fs/super.c:1771 do_new_mount+0x28f/0xae0 fs/namespace.c:3337 do_mount fs/namespace.c:3677 [inline] __do_sys_mount fs/namespace.c:3886 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3863 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Freed by task 5938: 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+0xd6/0x120 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+0x263/0x3a0 mm/slub.c:3822 generic_shutdown_super+0x13a/0x2c0 fs/super.c:696 kill_block_super+0x44/0x90 fs/super.c:1667 deactivate_locked_super+0xc1/0x130 fs/super.c:484 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1256 task_work_run+0x24a/0x300 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa34/0x2750 kernel/exit.c:871 do_group_exit+0x206/0x2c0 kernel/exit.c:1021 get_signal+0x1769/0x1840 kernel/signal.c:2904 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xb1/0x150 kernel/entry/common.c:204 irqentry_exit_to_user_mode+0xa/0x50 kernel/entry/common.c:309 exc_page_fault+0x57e/0x870 arch/x86/mm/fault.c:1564 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 The buggy address belongs to the object at ffff888076ff3a00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 148 bytes inside of freed 256-byte region [ffff888076ff3a00, ffff888076ff3b00) The buggy address belongs to the physical page: page:ffffea0001dbfc80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x76ff2 head:ffffea0001dbfc80 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888012c41b40 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000100010 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 0x1d2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5418, tgid 5418 (udevd), ts 103567606781, free_ts 103538051111 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0x33ea/0x3570 mm/page_alloc.c:3312 __alloc_pages+0x255/0x680 mm/page_alloc.c:4568 alloc_pages_mpol+0x3de/0x640 mm/mempolicy.c:2133 alloc_slab_page+0x6a/0x170 mm/slub.c:1870 allocate_slab mm/slub.c:2017 [inline] new_slab+0x84/0x2f0 mm/slub.c:2070 ___slab_alloc+0xc8a/0x1330 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+0x21d/0x300 mm/slub.c:3517 kmalloc_trace+0x2a/0x60 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] smk_fetch+0x92/0x140 security/smack/smack_lsm.c:300 smack_d_instantiate+0x841/0xa50 security/smack/smack_lsm.c:3602 security_d_instantiate+0x9b/0xf0 security/security.c:3799 d_instantiate+0x55/0x90 fs/dcache.c:2033 shmem_mknod+0x191/0x1c0 mm/shmem.c:3246 lookup_open fs/namei.c:3477 [inline] open_last_lookups fs/namei.c:3546 [inline] path_openat+0x13fa/0x3290 fs/namei.c:3776 do_filp_open+0x234/0x490 fs/namei.c:3809 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x931/0xa60 mm/page_alloc.c:2347 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2487 __slab_free+0x2f6/0x390 mm/slub.c:3715 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x75/0xe0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook+0x6c/0x3c0 mm/slab.h:763 slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x19e/0x2b0 mm/slub.c:3502 getname_flags+0xbc/0x4f0 fs/namei.c:140 user_path_at_empty+0x2c/0x60 fs/namei.c:2910 user_path_at include/linux/namei.h:57 [inline] inotify_find_inode fs/notify/inotify/inotify_user.c:378 [inline] __do_sys_inotify_add_watch fs/notify/inotify/inotify_user.c:777 [inline] __se_sys_inotify_add_watch+0x1ab/0x10a0 fs/notify/inotify/inotify_user.c:730 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Memory state around the buggy address: ffff888076ff3980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888076ff3a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888076ff3a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888076ff3b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888076ff3b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================