================================================================== BUG: KASAN: use-after-free in __mutex_waiter_is_first kernel/locking/mutex.c:191 [inline] BUG: KASAN: use-after-free in __mutex_lock_common+0xc85/0x2390 kernel/locking/mutex.c:671 Read of size 8 at addr ffff8880253a7108 by task jfsCommit/275 CPU: 1 PID: 275 Comm: jfsCommit Not tainted 5.15.180-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 __mutex_waiter_is_first kernel/locking/mutex.c:191 [inline] __mutex_lock_common+0xc85/0x2390 kernel/locking/mutex.c:671 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 jfs_syncpt+0x21/0x90 fs/jfs/jfs_logmgr.c:1047 txEnd+0x2e1/0x520 fs/jfs/jfs_txnmgr.c:549 txLazyCommit fs/jfs/jfs_txnmgr.c:2718 [inline] jfs_lazycommit+0x5ba/0xb20 fs/jfs/jfs_txnmgr.c:2766 kthread+0x436/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Allocated by task 5476: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:735 [inline] open_inline_log fs/jfs/jfs_logmgr.c:1167 [inline] lmLogOpen+0x2c0/0xf90 fs/jfs/jfs_logmgr.c:1077 jfs_mount_rw+0xf2/0x5c0 fs/jfs/jfs_mount.c:253 jfs_fill_super+0x5bb/0xaf0 fs/jfs/super.c:570 mount_bdev+0x287/0x3c0 fs/super.c:1400 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x24a/0xa40 fs/namespace.c:3012 do_mount fs/namespace.c:3355 [inline] __do_sys_mount fs/namespace.c:3563 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3540 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 4177: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xea/0x170 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0xef/0x2a0 mm/slub.c:4559 lmLogClose+0x293/0x520 fs/jfs/jfs_logmgr.c:-1 jfs_umount+0x28f/0x360 fs/jfs/jfs_umount.c:116 jfs_put_super+0x88/0x190 fs/jfs/super.c:194 generic_shutdown_super+0x130/0x300 fs/super.c:475 kill_block_super+0x7c/0xe0 fs/super.c:1427 deactivate_locked_super+0x93/0xf0 fs/super.c:335 cleanup_mnt+0x418/0x4d0 fs/namespace.c:1143 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Last potentially related work creation: kasan_save_stack+0x35/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3007 [inline] call_rcu+0x179/0x920 kernel/rcu/tree.c:3087 sctp_association_free+0x69d/0x7e0 net/sctp/associola.c:382 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:944 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1331 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1199 [inline] sctp_do_sm+0x36b6/0x54f0 net/sctp/sm_sideeffect.c:1170 sctp_assoc_bh_rcv+0x3ee/0x630 net/sctp/associola.c:1054 sctp_backlog_rcv+0x15f/0x3c0 net/sctp/input.c:346 sk_backlog_rcv include/net/sock.h:1061 [inline] __release_sock+0x1b9/0x420 net/core/sock.c:2727 release_sock+0x5b/0x1b0 net/core/sock.c:3268 sctp_close+0x6f7/0x8f0 net/sctp/socket.c:1533 inet_release+0x17c/0x1f0 net/ipv4/af_inet.c:432 __sock_release net/socket.c:649 [inline] sock_close+0xd5/0x240 net/socket.c:1336 __fput+0x234/0x930 fs/file_table.c:311 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff8880253a7000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 264 bytes inside of 1024-byte region [ffff8880253a7000, ffff8880253a7400) The buggy address belongs to the page: page:ffffea000094e800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x253a0 head:ffffea000094e800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 0000000900000001 ffff888016841dc0 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4165, ts 60504882052, free_ts 60500236344 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5466 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xc0/0x4b0 mm/slub.c:1975 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] __kmalloc_node+0x200/0x3b0 mm/slub.c:4451 kmalloc_node include/linux/slab.h:627 [inline] kvmalloc_node+0x84/0x130 mm/util.c:619 kvmalloc include/linux/mm.h:805 [inline] kvzalloc include/linux/mm.h:813 [inline] bucket_table_alloc lib/rhashtable.c:184 [inline] rhashtable_init+0x57b/0xa70 lib/rhashtable.c:1061 ipc_init_ids+0x77/0x1e0 ipc/util.c:120 create_ipc_ns ipc/namespace.c:62 [inline] copy_ipcs+0x36b/0x4b0 ipc/namespace.c:84 create_new_namespaces+0x212/0x6f0 kernel/nsproxy.c:90 unshare_nsproxy_namespaces+0x116/0x160 kernel/nsproxy.c:226 ksys_unshare+0x4bc/0x890 kernel/fork.c:3099 __do_sys_unshare kernel/fork.c:3173 [inline] __se_sys_unshare kernel/fork.c:3171 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:3171 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page+0x94/0x280 mm/page_alloc.c:3396 free_slab mm/slub.c:2015 [inline] discard_slab mm/slub.c:2021 [inline] __unfreeze_partials+0x1a5/0x200 mm/slub.c:2507 put_cpu_partial+0x12d/0x190 mm/slub.c:2587 qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] __kmalloc+0x127/0x330 mm/slub.c:4403 kmalloc include/linux/slab.h:609 [inline] kzalloc include/linux/slab.h:735 [inline] tomoyo_encode2 security/tomoyo/realpath.c:45 [inline] tomoyo_encode+0x27e/0x540 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x5cd/0x610 security/tomoyo/realpath.c:288 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x183/0x360 security/tomoyo/file.c:771 security_file_open+0x5e/0xa0 security/security.c:1668 do_dentry_open+0x322/0xf80 fs/open.c:813 do_open fs/namei.c:3608 [inline] path_openat+0x2682/0x2f30 fs/namei.c:3742 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769 Memory state around the buggy address: ffff8880253a7000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880253a7080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880253a7100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880253a7180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880253a7200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================