* [syzbot] [btrfs?] KMSAN: uninit-value in iov_iter_alignment_iovec
@ 2024-06-12 15:00 syzbot
2024-07-21 19:12 ` [syzbot] [PATCH] btrfs: Change iov_iter_alignment_iovec to check iovec count before accesses an iovec syzbot
0 siblings, 1 reply; 3+ messages in thread
From: syzbot @ 2024-06-12 15:00 UTC (permalink / raw)
To: clm, dsterba, josef, linux-btrfs, linux-kernel, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 614da38e2f7a Merge tag 'hid-for-linus-2024051401' of git:/..
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=166b7286980000
kernel config: https://syzkaller.appspot.com/x/.config?x=f5d2cbf33633f507
dashboard link: https://syzkaller.appspot.com/bug?extid=f2a9c06bfaa027217ebb
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=113f7f16980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11698dce980000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/89eafb874b71/disk-614da38e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/356000512ad9/vmlinux-614da38e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/839c73939115/bzImage-614da38e.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/b8b22127e3de/mount_2.gz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f2a9c06bfaa027217ebb@syzkaller.appspotmail.com
=====================================================
BUG: KMSAN: uninit-value in iov_iter_alignment_iovec+0x1a8/0x470 lib/iov_iter.c:788
iov_iter_alignment_iovec+0x1a8/0x470 lib/iov_iter.c:788
iov_iter_alignment+0x1aa/0x290 lib/iov_iter.c:833
check_direct_IO fs/btrfs/file.c:1452 [inline]
check_direct_read fs/btrfs/file.c:3736 [inline]
btrfs_direct_read fs/btrfs/file.c:3765 [inline]
btrfs_file_read_iter+0x46f/0xc70 fs/btrfs/file.c:3826
call_read_iter include/linux/fs.h:2114 [inline]
aio_read+0x4b3/0x690 fs/aio.c:1611
io_submit_one+0x2809/0x3280 fs/aio.c:2061
__do_sys_io_submit fs/aio.c:2120 [inline]
__se_sys_io_submit+0x275/0x700 fs/aio.c:2090
__x64_sys_io_submit+0x96/0xe0 fs/aio.c:2090
x64_sys_call+0x3620/0x3b50 arch/x86/include/generated/asm/syscalls_64.h:210
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Local variable inline_vecs created at:
aio_read+0x4c/0x690 fs/aio.c:1592
io_submit_one+0x2809/0x3280 fs/aio.c:2061
CPU: 1 PID: 5053 Comm: syz-executor335 Not tainted 6.9.0-syzkaller-02707-g614da38e2f7a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
=====================================================
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [syzbot] [PATCH] btrfs: Change iov_iter_alignment_iovec to check iovec count before accesses an iovec
2024-06-12 15:00 [syzbot] [btrfs?] KMSAN: uninit-value in iov_iter_alignment_iovec syzbot
@ 2024-07-21 19:12 ` syzbot
0 siblings, 0 replies; 3+ messages in thread
From: syzbot @ 2024-07-21 19:12 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: [PATCH] btrfs: Change iov_iter_alignment_iovec to check iovec count before accesses an iovec
Author: dennis.lamerice@gmail.com
#syz test
Signed-off-by: Dennis Lam <dennis.lamerice@gmail.com>
---
lib/iov_iter.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 4a6a9f419bd7..2d82ecf1b622 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -783,7 +783,7 @@ static unsigned long iov_iter_alignment_iovec(const struct iov_iter *i)
size_t size = i->count;
size_t skip = i->iov_offset;
- do {
+ while(size) {
size_t len = iov->iov_len - skip;
if (len) {
res |= (unsigned long)iov->iov_base + skip;
@@ -794,7 +794,7 @@ static unsigned long iov_iter_alignment_iovec(const struct iov_iter *i)
}
iov++;
skip = 0;
- } while (size);
+ }
return res;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
[parent not found: <20240721190930.45876-2-dennis.lamerice@gmail.com>]
end of thread, other threads:[~2024-07-21 19:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-12 15:00 [syzbot] [btrfs?] KMSAN: uninit-value in iov_iter_alignment_iovec syzbot
2024-07-21 19:12 ` [syzbot] [PATCH] btrfs: Change iov_iter_alignment_iovec to check iovec count before accesses an iovec syzbot
[not found] <20240721190930.45876-2-dennis.lamerice@gmail.com>
2024-07-21 19:53 ` [syzbot] [btrfs?] KMSAN: uninit-value in iov_iter_alignment_iovec syzbot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox