syzbot


UBSAN: array-index-out-of-bounds in dbNextAG

Status: fixed on 2023/12/21 01:43
Subsystems: jfs
[Documentation on labels]
Reported-by: syzbot+38e876a8aa44b7115c76@syzkaller.appspotmail.com
Fix commit: 64933ab7b048 fs/jfs: Add validity check for db_maxag and db_agpref
First crash: 608d, last: 178d
Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: UBSAN: array-index-out-of-bounds in dbNextAG (log)
Repro: C syz .config
  
Fix bisection the fix commit could be any of (bisect log):
  1ea66d71b176 jfs: remove unused declarations for jfs
  dee874452409 jfs: remove redundant assignments to ipaimap and ipaimap2
  b0a35efa0ebc fs/jfs/jfs_xattr.h: Fix spelling typo in comment
  ebe060369f8d jfs: Fix fortify moan in symlink
  25e70c6162f2 fs: jfs: fix shift-out-of-bounds in dbDiscardAG
  4ef3405e82d2 MAINTAINERS: git://github -> https://github.com for kleikamp
  73c6da327ff1 fs/jfs: replace ternary operator with min_t()
  d0e482c45c50 jfs: Fix a typo in function jfs_umount
  898f70669568 fs: jfs: fix shift-out-of-bounds in dbAllocAG
  a60dca73a1a8 jfs: makes diUnmount/diMount in jfs_mount_rw atomic
  56c003e4db4a Merge tag 'jfs-6.2' of https://github.com/kleikamp/linux-shaggy
  
Discussions (10)
Title Replies (including bot) Last reply
[PATCH AUTOSEL 4.14 4/9] fs/jfs: Add validity check for db_maxag and db_agpref 1 (1) 2023/11/07 15:54
[PATCH AUTOSEL 4.19 04/11] fs/jfs: Add validity check for db_maxag and db_agpref 1 (1) 2023/11/07 15:54
[PATCH AUTOSEL 5.4 04/12] fs/jfs: Add validity check for db_maxag and db_agpref 1 (1) 2023/11/07 15:53
[PATCH AUTOSEL 5.10 05/16] fs/jfs: Add validity check for db_maxag and db_agpref 1 (1) 2023/11/07 15:52
[PATCH AUTOSEL 5.15 07/22] fs/jfs: Add validity check for db_maxag and db_agpref 1 (1) 2023/11/07 15:51
[PATCH AUTOSEL 6.1 10/30] fs/jfs: Add validity check for db_maxag and db_agpref 1 (1) 2023/11/07 15:49
[PATCH AUTOSEL 6.5 11/34] fs/jfs: Add validity check for db_maxag and db_agpref 1 (1) 2023/11/07 15:47
[PATCH AUTOSEL 6.6 13/36] fs/jfs: Add validity check for db_maxag and db_agpref 1 (1) 2023/11/07 15:45
[PATCH] fs/jfs: Add validity check for db_maxag and db_agpref 2 (2) 2023/10/03 23:43
[syzbot] UBSAN: array-index-out-of-bounds in dbNextAG 0 (1) 2022/09/26 09:55
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in dbNextAG jfs C error 12 502d 607d 0/1 upstream: reported C repro on 2022/09/25 01:19
linux-4.14 KASAN: use-after-free Read in dbNextAG C 2 458d 607d 0/1 upstream: reported C repro on 2022/09/25 01:19
Last patch testing requests (10)
Created Duration User Patch Repo Result
2023/09/30 21:30 17m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci error OK
2023/09/07 16:59 9m ghandatmanas@gmail.com https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master report log
2023/08/25 14:28 32m retest repro upstream report log
2023/07/22 20:43 21m retest repro linux-next OK log
2023/07/22 20:43 18m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log
2023/07/22 19:25 33m retest repro upstream OK log
2023/05/13 17:43 23m retest repro upstream report log
2023/05/13 17:43 31m retest repro upstream OK log
2023/02/28 14:32 30m retest repro upstream OK log
2023/02/28 14:32 16m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log

Sample crash report:
loop0: detected capacity change from 0 to 32768
================================================================================
UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dmap.c:640:34
index 7936 is out of range for type 'atomic_t [128]'
CPU: 0 PID: 5045 Comm: syz-executor280 Not tainted 6.6.0-rc6-syzkaller-00043-gdd72f9c7e512 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x125/0x1b0 lib/dump_stack.c:106
 ubsan_epilogue lib/ubsan.c:217 [inline]
 __ubsan_handle_out_of_bounds+0x111/0x150 lib/ubsan.c:348
 dbNextAG+0x53a/0x5a0 fs/jfs/jfs_dmap.c:640
 dbAlloc+0x3ef/0xaa0 fs/jfs/jfs_dmap.c:875
 dtSplitUp+0x3f3/0x5850 fs/jfs/jfs_dtree.c:974
 dtInsert+0x872/0xb00 fs/jfs/jfs_dtree.c:863
 jfs_symlink+0xba5/0x10b0 fs/jfs/namei.c:1019
 vfs_symlink fs/namei.c:4480 [inline]
 vfs_symlink+0x3e5/0x620 fs/namei.c:4464
 do_symlinkat+0x28e/0x310 fs/namei.c:4506
 __do_sys_symlink fs/namei.c:4527 [inline]
 __se_sys_symlink fs/namei.c:4525 [inline]
 __x64_sys_symlink+0x79/0x90 fs/namei.c:4525
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f3fa79b0679
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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:00007ffde6c87448 EFLAGS: 00000246 ORIG_RAX: 0000000000000058
RAX: ffffffffffffffda RBX: 00007ffde6c87628 RCX: 00007f3fa79b0679
RDX: 00007f3fa79af970 RSI: 0000000020000880 RDI: 0000000020001980
RBP: 00007f3fa7a29610 R08: 0000000000005e42 R09: 0000000000000000
R10: 00007ffde6c87310 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffde6c87618 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
================================================================================

Crashes (52):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/10/19 13:16 upstream dd72f9c7e512 342b9c55 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-root UBSAN: array-index-out-of-bounds in dbNextAG
2023/10/06 08:09 upstream f291209eca5e db17ad9f .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-badwrites-root UBSAN: array-index-out-of-bounds in dbNextAG
2023/07/31 20:42 upstream 5d0c230f1de8 2a0d0f29 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/09/25 05:39 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c194837ebb57 0042f2b4 .config console log report syz C [disk image] [vmlinux] ci-upstream-gce-arm64 BUG: unable to handle kernel paging request in dbNextAG
2022/10/12 02:42 upstream 493ffd6605b2 02b6492e .config strace log report syz C [disk image] [vmlinux] [mounted in repro] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/09 16:06 upstream a6afa4199d3d aea5da89 .config strace log report syz C [disk image] [vmlinux] [mounted in repro] ci-upstream-kasan-gce-root UBSAN: array-index-out-of-bounds in dbNextAG
2022/09/26 00:29 upstream 105a36f3694e 0042f2b4 .config strace log report syz C [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/09/25 11:13 upstream 3db61221f4e8 0042f2b4 .config strace log report syz C ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/09/24 20:52 linux-next aaa11ce2ffc8 0042f2b4 .config strace log report syz C ci-upstream-linux-next-kasan-gce-root UBSAN: array-index-out-of-bounds in dbNextAG
2023/11/28 01:31 upstream 2cc14f52aeb7 7ec6c044 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2023/10/11 10:19 upstream 1c8b86a3799f 83165b57 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2023/09/12 18:26 upstream a747acc0b752 59da8366 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2023/08/26 08:26 upstream 382d4cd18475 7ba13a15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2023/07/31 20:20 upstream 5d0c230f1de8 2a0d0f29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2023/03/04 17:18 upstream 0988a0ea7919 f8902b57 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/11/20 14:30 upstream fe24a97cf254 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/11/18 11:36 upstream 84368d882b96 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/11/07 07:30 upstream 089d1c31224e 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/11/03 19:08 upstream b229b6ca5abb 7a2ebf95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/11/02 22:52 upstream b229b6ca5abb 08977f5d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/11/01 09:48 upstream b229b6ca5abb a1d8560a .config console log report info ci-upstream-kasan-gce-selinux-root UBSAN: array-index-out-of-bounds in dbNextAG
2022/11/01 09:40 upstream b229b6ca5abb a1d8560a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/31 16:08 upstream b229b6ca5abb 2a71366b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/31 15:54 upstream b229b6ca5abb 2a71366b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/28 03:26 upstream b229b6ca5abb 5c716ff6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/28 02:48 upstream b229b6ca5abb 5c716ff6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/24 22:28 upstream 247f34f7b803 faae2fda .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/24 12:32 upstream 247f34f7b803 faae2fda .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/22 20:55 upstream 440b7895c990 c0b80a55 .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/22 14:49 upstream 440b7895c990 c0b80a55 .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/21 09:42 upstream 6d36c728bc2e 63e790dd .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/19 06:17 upstream 493ffd6605b2 b31320fc .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/19 00:50 upstream 493ffd6605b2 b31320fc .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/18 23:15 upstream 493ffd6605b2 b31320fc .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/18 01:10 upstream 493ffd6605b2 94744d21 .config console log report info ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/16 05:20 upstream 493ffd6605b2 67cb024c .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/15 09:24 upstream 493ffd6605b2 67cb024c .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/15 07:20 upstream 55be6084c8e0 67cb024c .config console log report info [disk image] [vmlinux] ci-upstream-kasan-gce-root UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/15 04:07 upstream 493ffd6605b2 67cb024c .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/14 07:54 upstream 493ffd6605b2 4954e4b2 .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/09 15:10 upstream a6afa4199d3d aea5da89 .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/08 19:52 upstream 62e6e5940c0c aea5da89 .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/08 17:53 upstream e8bc52cb8df8 aea5da89 .config console log report info [disk image] [vmlinux] ci-upstream-kasan-gce-root UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/06 03:26 upstream 2bca25eaeba6 2c6543ad .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/06 00:46 upstream 2bca25eaeba6 2c6543ad .config console log report info [disk image] [vmlinux] ci2-upstream-fs UBSAN: array-index-out-of-bounds in dbNextAG
2022/11/01 09:47 linux-next 4d48f589d294 a1d8560a .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root UBSAN: array-index-out-of-bounds in dbNextAG
2022/10/21 04:15 linux-next acee3e83b493 a0fd4dab .config console log report info [disk image] [vmlinux] ci-upstream-linux-next-kasan-gce-root UBSAN: array-index-out-of-bounds in dbNextAG
2022/09/24 20:16 linux-next aaa11ce2ffc8 0042f2b4 .config console log report info ci-upstream-linux-next-kasan-gce-root UBSAN: array-index-out-of-bounds in dbNextAG
2022/11/14 07:19 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 1621b6eaebf7 3ead01ad .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: unable to handle kernel paging request in dbNextAG
2022/11/02 09:15 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 edac4fd1 .config console log report info [disk image] [vmlinux] ci-upstream-gce-arm64 BUG: unable to handle kernel paging request in dbNextAG
2022/10/25 08:54 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 45645420 .config console log report info [disk image] [vmlinux] ci-upstream-gce-arm64 BUG: unable to handle kernel paging request in dbNextAG
2022/09/26 16:11 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c194837ebb57 d59ba983 .config console log report info [disk image] [vmlinux] ci-upstream-gce-arm64 BUG: unable to handle kernel paging request in dbNextAG
* Struck through repros no longer work on HEAD.