syzbot


KASAN: use-after-free Read in jfs_lazycommit

Status: upstream: reported C repro on 2023/05/07 23:35
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+46e6acbe2a7c2c6facf8@syzkaller.appspotmail.com
First crash: 347d, last: 2h25m
Bug presence (2)
Date Name Commit Repro Result
2023/10/11 upstream (ToT) 1c8b86a3799f C [report] KASAN: slab-use-after-free Read in jfs_lazycommit
2024/04/09 upstream (ToT) 20cb38a7af88 C Failed due to an error; will retry later
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in jfs_lazycommit jfs C error 83 1d05h 566d 0/26 upstream: reported C repro on 2022/10/01 13:43
linux-4.19 KASAN: use-after-free Read in jfs_lazycommit jfs C error 5 437d 554d 0/1 upstream: reported C repro on 2022/10/13 08:33
linux-5.15 KASAN: use-after-free Read in jfs_lazycommit origin:upstream C error 24 2d21h 349d 0/3 upstream: reported C repro on 2023/05/06 12:04
linux-4.14 KASAN: use-after-free Read in jfs_lazycommit jfs C 6 413d 555d 0/1 upstream: reported C repro on 2022/10/11 20:09
Fix bisection attempts (6)
Created Duration User Patch Repo Result
2024/02/25 16:27 2h06m bisect fix linux-6.1.y job log (0) log
2024/01/18 03:50 2h03m bisect fix linux-6.1.y job log (0) log
2023/12/14 16:53 1h43m bisect fix linux-6.1.y job log (0) log
2023/11/14 00:03 2h05m bisect fix linux-6.1.y job log (0) log
2023/10/11 12:57 2h06m bisect fix linux-6.1.y job log (0) log
2023/08/31 19:19 1h59m bisect fix linux-6.1.y job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in jfs_lazycommit+0x7da/0xb60 fs/jfs/jfs_txnmgr.c:2730
Read of size 4 at addr ffff888013a68294 by task jfsCommit/132

CPU: 0 PID: 132 Comm: jfsCommit Not tainted 6.1.32-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:284 [inline]
 print_report+0x15f/0x4f0 mm/kasan/report.c:395
 kasan_report+0x136/0x160 mm/kasan/report.c:495
 jfs_lazycommit+0x7da/0xb60 fs/jfs/jfs_txnmgr.c:2730
 kthread+0x26e/0x300 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
 </TASK>

Allocated by task 3742:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383
 kmalloc include/linux/slab.h:553 [inline]
 kzalloc include/linux/slab.h:689 [inline]
 jfs_fill_super+0xfb/0xc40 fs/jfs/super.c:495
 mount_bdev+0x2c9/0x3f0 fs/super.c:1423
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:610
 vfs_get_tree+0x88/0x270 fs/super.c:1553
 do_new_mount+0x28b/0xae0 fs/namespace.c:3040
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3568
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Freed by task 3578:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1724 [inline]
 slab_free_freelist_hook mm/slub.c:1750 [inline]
 slab_free mm/slub.c:3661 [inline]
 __kmem_cache_free+0x25c/0x3c0 mm/slub.c:3674
 generic_shutdown_super+0x130/0x340 fs/super.c:501
 kill_block_super+0x7a/0xe0 fs/super.c:1450
 deactivate_locked_super+0xa0/0x110 fs/super.c:332
 cleanup_mnt+0x490/0x520 fs/namespace.c:1186
 task_work_run+0x246/0x300 kernel/task_work.c:179
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xd9/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:286 [inline]
 syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:297
 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

The buggy address belongs to the object at ffff888013a68200
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 148 bytes inside of
 256-byte region [ffff888013a68200, ffff888013a68300)

The buggy address belongs to the physical page:
page:ffffea00004e9a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888013a69400 pfn:0x13a68
head:ffffea00004e9a00 order:1 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888012441b40
raw: ffff888013a69400 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 2339497190, free_ts 0
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2533
 prep_new_page mm/page_alloc.c:2540 [inline]
 get_page_from_freelist+0x32ed/0x3480 mm/page_alloc.c:4292
 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5559
 alloc_page_interleave+0x22/0x1c0 mm/mempolicy.c:2113
 alloc_slab_page+0x6a/0x150 mm/slub.c:1794
 allocate_slab mm/slub.c:1939 [inline]
 new_slab+0x84/0x2d0 mm/slub.c:1992
 ___slab_alloc+0xa71/0x1080 mm/slub.c:3180
 __slab_alloc mm/slub.c:3279 [inline]
 slab_alloc_node mm/slub.c:3364 [inline]
 __kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437
 __do_kmalloc_node mm/slab_common.c:954 [inline]
 __kmalloc_node_track_caller+0xa0/0x220 mm/slab_common.c:975
 __do_krealloc mm/slab_common.c:1348 [inline]
 krealloc+0x61/0xf0 mm/slab_common.c:1381
 add_sysfs_param+0xca/0x7f0 kernel/params.c:651
 kernel_add_sysfs_param+0xb0/0x126 kernel/params.c:812
 param_sysfs_builtin+0x16a/0x1e2 kernel/params.c:851
 param_sysfs_init+0x66/0x6a kernel/params.c:970
 do_one_initcall+0x265/0x8f0 init/main.c:1303
 do_initcall_level+0x157/0x207 init/main.c:1376
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888013a68180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888013a68200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888013a68280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff888013a68300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888013a68380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/07 04:29 linux-6.1.y 76ba310227d2 a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan KASAN: use-after-free Read in jfs_lazycommit
2023/05/07 23:35 linux-6.1.y ca48fc16c493 90c93c40 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2024/04/19 11:38 linux-6.1.y 6741e066ec76 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in jfs_lazycommit
2024/03/27 20:22 linux-6.1.y e5cd595e23c1 120789fd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in jfs_lazycommit
2024/03/06 18:23 linux-6.1.y 61adba85cc40 f39a7eed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/12/18 18:52 linux-6.1.y ba6f5fb46511 924661f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/06/24 00:13 linux-6.1.y e84a4e368abe 79782afc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/05/28 08:20 linux-6.1.y a343b0dd87b4 cf184559 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/05/26 22:00 linux-6.1.y a343b0dd87b4 cf184559 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/05/19 16:05 linux-6.1.y fa74641fb6b9 96689200 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
* Struck through repros no longer work on HEAD.