syzbot


KASAN: stack-out-of-bounds Read in iov_iter_revert

Status: fixed on 2021/11/10 00:50
Subsystems: fs io-uring
[Documentation on labels]
Reported-by: syzbot+9671693590ef5aad8953@syzkaller.appspotmail.com
Fix commit: 89c2b3b74918 io_uring: reexpand under-reexpanded iters
First crash: 988d, last: 971d
Cause bisection: failed (error log, bisect log)
  
Discussions (5)
Title Replies (including bot) Last reply
[syzbot] KASAN: stack-out-of-bounds Read in iov_iter_revert 19 (22) 2022/05/08 11:43
Re: Patch "io_uring: reexpand under-reexpanded iters" has been added to the 5.14-stable tree 1 (1) 2021/09/13 10:48
Re: Patch "io_uring: reexpand under-reexpanded iters" has been added to the 5.13-stable tree 1 (1) 2021/09/13 10:47
[PATCH v3 0/2] iter revert problems 7 (7) 2021/09/04 00:57
[PATCH v2 0/2] iter revert problems 8 (8) 2021/08/23 12:28
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: stack-out-of-bounds Read in iov_iter_revert C error 26 456d 1015d 0/1 upstream: reported C repro on 2021/07/16 11:05
android-54 KASAN: stack-out-of-bounds Read in iov_iter_revert C 37 1297d 1346d 0/2 auto-obsoleted due to no activity on 2023/04/16 21:56
android-5-10 KASAN: stack-out-of-bounds Read in iov_iter_revert C error 10 761d 914d 0/2 closed as invalid on 2022/04/06 16:19
linux-4.14 KASAN: stack-out-of-bounds Read in iov_iter_revert xfs C error 8 454d 957d 0/1 upstream: reported C repro on 2021/09/12 17:39
Last patch testing requests (2)
Created Duration User Patch Repo Result
2021/08/23 00:24 18m asml.silence@gmail.com https://github.com/isilence/linux.git syztest_trunc2 OK
2021/08/12 14:30 17m asml.silence@gmail.com https://github.com/isilence/linux.git truncate OK

Sample crash report:
==================================================================
BUG: KASAN: stack-out-of-bounds in iov_iter_revert+0x179/0xa30 lib/iov_iter.c:1093
Read of size 8 at addr ffffc9000bbb6f58 by task syz-executor477/8433

CPU: 1 PID: 8433 Comm: syz-executor477 Not tainted 5.14.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1ae/0x29f lib/dump_stack.c:105
 print_address_description+0x66/0x3b0 mm/kasan/report.c:233
 __kasan_report mm/kasan/report.c:419 [inline]
 kasan_report+0x163/0x210 mm/kasan/report.c:436
 iov_iter_revert+0x179/0xa30 lib/iov_iter.c:1093
 io_write+0x8ba/0xb90 fs/io_uring.c:3459
 io_issue_sqe+0xc34/0x9530 fs/io_uring.c:6181
 __io_queue_sqe+0x1f9/0xf00 fs/io_uring.c:6464
 io_submit_sqe fs/io_uring.c:6662 [inline]
 io_submit_sqes+0x1e49/0x7d40 fs/io_uring.c:6778
 __do_sys_io_uring_enter fs/io_uring.c:9389 [inline]
 __se_sys_io_uring_enter+0x22b/0x1d30 fs/io_uring.c:9332
 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+0x44/0xae
RIP: 0033:0x43f8a9
Code: 28 c3 e8 1a 15 00 00 66 2e 0f 1f 84 00 00 00 00 00 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe645dde88 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000043f8a9
RDX: 0000000000000000 RSI: 00000000000052fe RDI: 0000000000000003
RBP: 00007ffe645ddea8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe645ddeb0
R13: 0000000000000000 R14: 00000000004ae018 R15: 0000000000400488


addr ffffc9000bbb6f58 is located in stack of task syz-executor477/8433 at offset 24 in frame:
 io_write+0x0/0xb90 arch/x86/include/asm/atomic.h:29

this frame has 3 objects:
 [32, 160) 'inline_vecs'
 [192, 200) 'iovec'
 [224, 264) '__iter'

Memory state around the buggy address:
 ffffc9000bbb6e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffc9000bbb6e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc9000bbb6f00: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00
                                                    ^
 ffffc9000bbb6f80: 00 00 00 00 00 00 00 00 00 00 00 00 f2 f2 f2 f2
 ffffc9000bbb7000: 00 f2 f2 f2 00 00 00 00 00 f3 f3 f3 f3 f3 f3 f3
==================================================================

Crashes (14):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/08/12 13:54 upstream 1746f4db5135 6972b106 .config console log report syz C ci-upstream-kasan-gce-smack-root KASAN: stack-out-of-bounds Read in iov_iter_revert
2021/08/12 13:15 upstream 1746f4db5135 6972b106 .config console log report syz C ci-upstream-kasan-gce-root KASAN: stack-out-of-bounds Read in iov_iter_revert
2021/08/29 07:46 upstream 3f5ad13cb012 be2c130d .config console log report info ci-upstream-kasan-gce-smack-root KASAN: stack-out-of-bounds Read in iov_iter_revert
2021/08/29 07:42 upstream 64b4fc45bea6 be2c130d .config console log report info ci-upstream-kasan-gce-root KASAN: stack-out-of-bounds Read in iov_iter_revert
2021/08/29 07:32 upstream 3f5ad13cb012 be2c130d .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: stack-out-of-bounds Read in iov_iter_revert
2021/08/18 18:57 upstream 614cb2751d31 a2fe1cb5 .config console log report info ci-upstream-kasan-gce-root KASAN: stack-out-of-bounds Read in iov_iter_revert
2021/08/18 18:52 upstream 614cb2751d31 a2fe1cb5 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: stack-out-of-bounds Read in iov_iter_revert
2021/08/18 18:51 upstream 614cb2751d31 a2fe1cb5 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: stack-out-of-bounds Read in iov_iter_revert
2021/08/12 14:19 upstream 1746f4db5135 6972b106 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: stack-out-of-bounds Read in iov_iter_revert
2021/08/12 12:58 upstream 1746f4db5135 6972b106 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: stack-out-of-bounds Read in iov_iter_revert
2021/08/12 12:35 upstream 1746f4db5135 6972b106 .config console log report info ci-upstream-kasan-gce-root KASAN: stack-out-of-bounds Read in iov_iter_revert
2021/08/29 07:36 linux-next 5e63226c7228 be2c130d .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: stack-out-of-bounds Read in iov_iter_revert
2021/08/18 18:51 linux-next f26c3abc432a a2fe1cb5 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: stack-out-of-bounds Read in iov_iter_revert
2021/08/12 16:06 linux-next 9b992972fb9c 6972b106 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: stack-out-of-bounds Read in iov_iter_revert
* Struck through repros no longer work on HEAD.