syzbot


KASAN: use-after-free Write in diWrite

Status: upstream: reported C repro on 2024/09/20 20:20
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+32799a32790e9973dc5b@syzkaller.appspotmail.com
First crash: 265d, last: 3d02h
Bug presence (1)
Date Name Commit Repro Result
2025/01/03 upstream (ToT) 0bc21e701a6f C [report] KASAN: slab-out-of-bounds Write in diWrite
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Write in diWrite jfs C inconclusive 35 3d06h 413d 0/28 upstream: reported C repro on 2024/04/25 21:10
linux-4.19 KASAN: use-after-free Write in diWrite syz error 2 968d 968d 0/1 upstream: reported syz repro on 2022/10/19 03:08
linux-6.1 KASAN: slab-out-of-bounds Write in diWrite origin:upstream C error 7 6d17h 124d 0/3 upstream: reported C repro on 2025/02/08 22:36
upstream UBSAN: array-index-out-of-bounds in diWrite jfs C error done 13 546d 966d 25/28 fixed on 2024/01/30 15:47
Last patch testing requests (2)
Created Duration User Patch Repo Result
2025/05/24 05:50 11m retest repro linux-5.15.y report log
2025/01/11 23:07 31m retest repro linux-5.15.y report log
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2025/05/02 03:36 1h30m bisect fix linux-5.15.y OK (0) job log log
2025/03/31 03:24 2h26m bisect fix linux-5.15.y OK (0) job log log
2025/02/27 06:55 2h12m bisect fix linux-5.15.y OK (0) job log log

Sample crash report:
loop0: detected capacity change from 0 to 32768
==================================================================
BUG: KASAN: slab-out-of-bounds in diWrite+0xbe7/0x1610 fs/jfs/jfs_imap.c:753
Read of size 32 at addr ffff8880740e5110 by task syz-executor309/4168

CPU: 0 PID: 4168 Comm: syz-executor309 Not tainted 5.15.184-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 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
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x27b/0x290 mm/kasan/generic.c:189
 memcpy+0x25/0x60 mm/kasan/shadow.c:65
 diWrite+0xbe7/0x1610 fs/jfs/jfs_imap.c:753
 txCommit+0x84b/0x51c0 fs/jfs/jfs_txnmgr.c:1255
 jfs_mkdir+0x875/0xa70 fs/jfs/namei.c:290
 vfs_mkdir+0x387/0x570 fs/namei.c:4065
 do_mkdirat+0x1d7/0x5a0 fs/namei.c:4090
 __do_sys_mkdir fs/namei.c:4110 [inline]
 __se_sys_mkdir fs/namei.c:4108 [inline]
 __x64_sys_mkdir+0x6a/0x80 fs/namei.c:4108
 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
RIP: 0033:0x7fd4727e21a9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 21 18 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffea537bb08 EFLAGS: 00000246 ORIG_RAX: 0000000000000053
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fd4727e21a9
RDX: 00007fd4727e21a9 RSI: 0000000000000000 RDI: 0000200000000200
RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffea537bb50
R13: 00007ffea537bb90 R14: 0000000001000000 R15: 0000000000000003
 </TASK>

Allocated by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8880740e4a00
 which belongs to the cache jfs_ip of size 2240
The buggy address is located 1808 bytes inside of
 2240-byte region [ffff8880740e4a00, ffff8880740e52c0)
The buggy address belongs to the page:
page:ffffea0001d03800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x740e0
head:ffffea0001d03800 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff88801d474c80
raw: 0000000000000000 00000000800d000d 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Reclaimable, gfp_mask 0xd2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE), pid 4168, ts 65286563648, free_ts 19398701585
 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]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0x195/0x290 mm/slub.c:3233
 jfs_alloc_inode+0x17/0x50 fs/jfs/super.c:105
 alloc_inode fs/inode.c:261 [inline]
 new_inode_pseudo+0x5f/0x210 fs/inode.c:1001
 new_inode+0x25/0x1c0 fs/inode.c:1030
 jfs_fill_super+0x392/0xaf0 fs/jfs/super.c:549
 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:3014
 do_mount fs/namespace.c:3357 [inline]
 __do_sys_mount fs/namespace.c:3565 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3542
 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_contig_range+0x96/0xf0 mm/page_alloc.c:9385
 destroy_args+0xef/0x8b0 mm/debug_vm_pgtable.c:1018
 debug_vm_pgtable+0x318/0x370 mm/debug_vm_pgtable.c:1331
 do_one_initcall+0x1ee/0x680 init/main.c:1302
 do_initcall_level+0x137/0x1f0 init/main.c:1375
 do_initcalls+0x4b/0x90 init/main.c:1391
 kernel_init_freeable+0x3ce/0x560 init/main.c:1615
 kernel_init+0x19/0x1b0 init/main.c:1506
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Memory state around the buggy address:
 ffff8880740e5000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880740e5080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880740e5100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                         ^
 ffff8880740e5180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880740e5200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (19):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/31 05:09 linux-5.15.y 98f47d0e9b8c 3d2f584d .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in diWrite
2024/12/28 21:44 linux-5.15.y 91786f140358 d3ccff63 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in diWrite
2025/06/02 09:56 linux-5.15.y 98f47d0e9b8c 3d2f584d .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in diWrite
2025/05/04 10:41 linux-5.15.y 16fdf2c7111b b0714e37 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in diWrite
2025/05/04 10:09 linux-5.15.y 16fdf2c7111b b0714e37 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in diWrite
2025/01/26 14:33 linux-5.15.y 003148680b79 9fbd772e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in diWrite
2024/11/29 04:29 linux-5.15.y 0a51d2d4527b 5df23865 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in diWrite
2024/09/20 20:19 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in diWrite
2025/06/01 06:51 linux-5.15.y 98f47d0e9b8c 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in diWrite
2024/12/28 20:36 linux-5.15.y 91786f140358 d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in diWrite
2025/06/10 09:11 linux-5.15.y 1c700860e8bc 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in diWrite
2025/06/10 03:32 linux-5.15.y 1c700860e8bc 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in diWrite
2025/06/05 15:20 linux-5.15.y 1c700860e8bc 6b6b5f21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in diWrite
2025/06/05 15:17 linux-5.15.y 1c700860e8bc 6b6b5f21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in diWrite
2025/06/05 15:15 linux-5.15.y 1c700860e8bc 6b6b5f21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Write in diWrite
2025/06/05 14:32 linux-5.15.y 1c700860e8bc 6b6b5f21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in diWrite
2025/06/02 21:10 linux-5.15.y 98f47d0e9b8c b396b4bf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in diWrite
2025/06/01 18:29 linux-5.15.y 98f47d0e9b8c 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in diWrite
2025/05/08 20:17 linux-5.15.y 16fdf2c7111b dbf35fa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Write in diWrite
* Struck through repros no longer work on HEAD.