Edward Adam Davis
6996d43b14
jfs: fix array-index-out-of-bounds in diNewExt
...
[ Upstream commit 49f9637aafa6e63ba686c13cb8549bf5e6920402 ]
[Syz report]
UBSAN: array-index-out-of-bounds in fs/jfs/jfs_imap.c:2360:2
index -878706688 is out of range for type 'struct iagctl[128]'
CPU: 1 PID: 5065 Comm: syz-executor282 Not tainted 6.7.0-rc4-syzkaller-00009-gbee0e7762ad2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
ubsan_epilogue lib/ubsan.c:217 [inline]
__ubsan_handle_out_of_bounds+0x11c/0x150 lib/ubsan.c:348
diNewExt+0x3cf3/0x4000 fs/jfs/jfs_imap.c:2360
diAllocExt fs/jfs/jfs_imap.c:1949 [inline]
diAllocAG+0xbe8/0x1e50 fs/jfs/jfs_imap.c:1666
diAlloc+0x1d3/0x1760 fs/jfs/jfs_imap.c:1587
ialloc+0x8f/0x900 fs/jfs/jfs_inode.c:56
jfs_mkdir+0x1c5/0xb90 fs/jfs/namei.c:225
vfs_mkdir+0x2f1/0x4b0 fs/namei.c:4106
do_mkdirat+0x264/0x3a0 fs/namei.c:4129
__do_sys_mkdir fs/namei.c:4149 [inline]
__se_sys_mkdir fs/namei.c:4147 [inline]
__x64_sys_mkdir+0x6e/0x80 fs/namei.c:4147
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7fcb7e6a0b57
Code: ff ff 77 07 31 c0 c3 0f 1f 40 00 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 b8 53 00 00 00 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:00007ffd83023038 EFLAGS: 00000286 ORIG_RAX: 0000000000000053
RAX: ffffffffffffffda RBX: 00000000ffffffff RCX: 00007fcb7e6a0b57
RDX: 00000000000a1020 RSI: 00000000000001ff RDI: 0000000020000140
RBP: 0000000020000140 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000286 R12: 00007ffd830230d0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
[Analysis]
When the agstart is too large, it can cause agno overflow.
[Fix]
After obtaining agno, if the value is invalid, exit the subsequent process.
Reported-and-tested-by: syzbot+553d90297e6d2f50dbc7@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
Modified the test from agno > MAXAG to agno >= MAXAG based on linux-next
report by kernel test robot (Dan Carpenter).
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-05 20:14:16 +00:00
..
2023-11-28 17:19:46 +00:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2024-02-05 20:14:16 +00:00
2023-08-28 11:39:14 -07:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2024-01-31 16:19:10 -08:00
2023-08-29 14:25:26 -07:00
2024-01-25 15:35:44 -08:00
2023-08-28 09:31:32 -07:00
2023-07-13 10:28:05 +02:00
2023-08-28 11:04:18 -07:00
2023-05-23 19:46:09 -07:00
2024-01-20 11:51:37 +01:00
2023-08-28 10:17:14 -07:00
2024-01-31 16:18:54 -08:00
2023-12-03 07:33:03 +01:00
2024-01-25 15:35:15 -08:00
2023-08-29 20:21:42 -07:00
2024-02-05 20:14:16 +00:00
2023-11-28 17:19:44 +00:00
2023-08-29 17:45:22 -04:00
2023-12-08 08:52:19 +01:00
2024-01-31 16:18:49 -08:00
2024-01-25 15:35:37 -08:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2024-01-31 16:19:01 -08:00
2023-12-20 17:01:52 +01:00
2024-01-25 15:35:17 -08:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2023-07-24 10:30:00 +02:00
2023-08-29 20:21:42 -07:00
2023-11-28 17:20:05 +00:00
2023-10-19 09:41:36 -07:00
2023-08-29 20:21:42 -07:00
2024-01-20 11:51:43 +01:00
2023-07-24 10:30:01 +02:00
2024-02-05 20:14:16 +00:00
2024-01-25 15:35:41 -08:00
2023-08-29 17:45:22 -04:00
2023-08-29 20:21:42 -07:00
2023-09-18 12:03:46 -07:00
2024-01-25 15:35:18 -08:00
2024-01-31 16:19:06 -08:00
2023-12-13 18:45:22 +01:00
2023-08-31 12:07:34 -05:00
2023-10-19 16:19:20 +02:00
2023-08-29 20:21:42 -07:00
2023-10-19 09:10:18 -07:00
2023-08-31 15:18:15 -07:00
2023-08-29 20:21:42 -07:00
2023-07-24 10:30:03 +02:00
2023-08-11 09:04:57 +02:00
2023-12-03 07:33:03 +01:00
2023-11-28 17:19:57 +00:00
2024-02-05 20:14:16 +00:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2023-11-28 17:20:04 +00:00
2023-07-24 10:30:04 +02:00
2023-09-11 14:07:46 +02:00
2023-08-29 20:21:42 -07:00
2024-01-31 16:19:13 -08:00
2023-07-24 10:30:05 +02:00
2023-06-15 13:37:53 +02:00
2023-08-29 20:21:42 -07:00
2023-12-20 17:02:00 +01:00
2024-01-31 16:18:56 -08:00
2023-08-30 12:10:50 -07:00
2023-08-29 20:21:42 -07:00
2023-08-28 09:31:32 -07:00
2023-08-20 10:33:43 -07:00
2024-01-31 16:19:07 -08:00
2023-08-28 11:59:52 -07:00
2023-09-20 14:22:01 +02:00
2023-08-28 10:17:14 -07:00
2023-08-11 09:04:57 +02:00
2023-09-29 17:20:45 -07:00
2023-06-28 20:35:21 -07:00
2023-07-13 10:28:04 +02:00
2023-09-25 08:55:00 -07:00
2023-05-15 09:42:01 +02:00
2023-06-26 09:50:21 -07:00
2023-05-17 09:16:59 +02:00
2024-01-10 17:16:53 +01:00
2023-08-19 13:41:11 +02:00
2023-06-28 10:28:11 -07:00
2023-08-18 10:12:11 -07:00
2023-07-11 11:41:34 +02:00
2023-07-26 14:56:07 +02:00
2024-01-31 16:19:06 -08:00
2023-07-10 14:36:11 +02:00
2023-06-12 10:43:45 +02:00
2023-08-08 19:36:51 +02:00
2023-08-28 10:17:14 -07:00
2023-10-12 18:53:36 +03:00
2023-08-21 13:46:25 -07:00
2023-11-20 11:58:52 +01:00
2023-08-14 18:48:02 +02:00
2023-12-03 07:33:03 +01:00
2023-08-29 20:21:42 -07:00
2024-01-31 16:18:54 -08:00
2023-08-29 20:21:42 -07:00
2023-08-23 14:17:43 -07:00
2023-08-19 12:12:12 +02:00
2024-01-05 15:19:40 +01:00
2023-08-31 15:32:18 -07:00
2023-08-02 09:13:09 -06:00
2024-01-31 16:18:57 -08:00
2024-01-25 15:35:17 -08:00
2023-07-13 10:28:04 +02:00
2023-12-20 17:01:51 +01:00
2024-01-31 16:19:09 -08:00
2023-05-19 04:30:22 +02:00
2023-05-19 04:30:22 +02:00
2023-07-13 10:28:04 +02:00
2023-05-24 08:42:16 -06:00
2023-08-15 08:32:45 +02:00
2023-08-06 15:08:35 +02:00
2023-05-24 11:03:59 +02:00
2023-08-29 14:25:26 -07:00
2023-07-13 10:28:04 +02:00
2023-12-03 07:33:03 +01:00
2023-05-17 15:20:17 +02:00
2023-08-31 12:47:15 +02:00
2023-05-23 21:43:26 -07:00
2023-08-24 16:20:27 -07:00
2023-08-22 10:57:46 +02:00