* [syzbot] [fs?] general protection fault in iter_file_splice_write
@ 2024-05-20 8:06 syzbot
2024-05-24 5:35 ` [PATCH] netfs: if extracting pages from user iterator fails return 0 Lizhi Xu
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: syzbot @ 2024-05-20 8:06 UTC (permalink / raw)
To: brauner, jack, linux-fsdevel, linux-kernel, syzkaller-bugs, viro
Hello,
syzbot found the following issue on:
HEAD commit: 33e02dc69afb Merge tag 'sound-6.10-rc1' of git://git.kerne..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13ad18d0980000
kernel config: https://syzkaller.appspot.com/x/.config?x=25544a2faf4bae65
dashboard link: https://syzkaller.appspot.com/bug?extid=d2125fcb6aa8c4276fd2
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1526a8dc980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14f53ae4980000
Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/7bc7510fe41f/non_bootable_disk-33e02dc6.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/573c88ac3233/vmlinux-33e02dc6.xz
kernel image: https://storage.googleapis.com/syzbot-assets/760a52b9a00a/bzImage-33e02dc6.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d2125fcb6aa8c4276fd2@syzkaller.appspotmail.com
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 3 PID: 5196 Comm: syz-executor259 Not tainted 6.9.0-syzkaller-07370-g33e02dc69afb #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:pipe_buf_release include/linux/pipe_fs_i.h:219 [inline]
RIP: 0010:iter_file_splice_write+0xa24/0x10b0 fs/splice.c:759
Code: 00 48 89 fa 48 c1 ea 03 80 3c 1a 00 0f 85 b1 04 00 00 4d 8b 65 10 49 c7 45 10 00 00 00 00 49 8d 7c 24 08 48 89 fa 48 c1 ea 03 <80> 3c 1a 00 0f 85 1a 05 00 00 49 8b 54 24 08 4c 89 ee 4c 89 ff 83
RSP: 0018:ffffc900031b7930 EFLAGS: 00010202
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: ffffffff8209a1a8
RDX: 0000000000000001 RSI: ffffffff8209a06c RDI: 0000000000000008
RBP: 000000000000003d R08: 0000000000000006 R09: 0000000000000000
R10: 7fffffffffffefff R11: 0000000000000001 R12: 0000000000000000
R13: ffff888026d5a208 R14: 7fffffffffffefff R15: ffff88801e5c5800
FS: 00007f78cdfc16c0(0000) GS:ffff88806b300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f78ce0454d0 CR3: 0000000019dc8000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
do_splice_from fs/splice.c:941 [inline]
direct_splice_actor+0x19b/0x6d0 fs/splice.c:1164
splice_direct_to_actor+0x346/0xa40 fs/splice.c:1108
do_splice_direct_actor fs/splice.c:1207 [inline]
do_splice_direct+0x17e/0x250 fs/splice.c:1233
do_sendfile+0xaa8/0xdb0 fs/read_write.c:1295
__do_sys_sendfile64 fs/read_write.c:1362 [inline]
__se_sys_sendfile64 fs/read_write.c:1348 [inline]
__x64_sys_sendfile64+0x1da/0x220 fs/read_write.c:1348
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f78ce009d09
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f78cdfc1168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f78ce091328 RCX: 00007f78ce009d09
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000004
RBP: 00007f78ce091320 R08: 00007f78cdfc16c0 R09: 0000000000000000
R10: 0000000100000000 R11: 0000000000000246 R12: 00007f78ce09132c
R13: 0000000000000006 R14: 00007ffe98369ff0 R15: 00007ffe9836a0d8
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:pipe_buf_release include/linux/pipe_fs_i.h:219 [inline]
RIP: 0010:iter_file_splice_write+0xa24/0x10b0 fs/splice.c:759
Code: 00 48 89 fa 48 c1 ea 03 80 3c 1a 00 0f 85 b1 04 00 00 4d 8b 65 10 49 c7 45 10 00 00 00 00 49 8d 7c 24 08 48 89 fa 48 c1 ea 03 <80> 3c 1a 00 0f 85 1a 05 00 00 49 8b 54 24 08 4c 89 ee 4c 89 ff 83
RSP: 0018:ffffc900031b7930 EFLAGS: 00010202
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: ffffffff8209a1a8
RDX: 0000000000000001 RSI: ffffffff8209a06c RDI: 0000000000000008
RBP: 000000000000003d R08: 0000000000000006 R09: 0000000000000000
R10: 7fffffffffffefff R11: 0000000000000001 R12: 0000000000000000
R13: ffff888026d5a208 R14: 7fffffffffffefff R15: ffff88801e5c5800
FS: 00007f78cdfc16c0(0000) GS:ffff88806b200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f78ce05d0d8 CR3: 0000000019dc8000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 00 48 89 add %cl,-0x77(%rax)
3: fa cli
4: 48 c1 ea 03 shr $0x3,%rdx
8: 80 3c 1a 00 cmpb $0x0,(%rdx,%rbx,1)
c: 0f 85 b1 04 00 00 jne 0x4c3
12: 4d 8b 65 10 mov 0x10(%r13),%r12
16: 49 c7 45 10 00 00 00 movq $0x0,0x10(%r13)
1d: 00
1e: 49 8d 7c 24 08 lea 0x8(%r12),%rdi
23: 48 89 fa mov %rdi,%rdx
26: 48 c1 ea 03 shr $0x3,%rdx
* 2a: 80 3c 1a 00 cmpb $0x0,(%rdx,%rbx,1) <-- trapping instruction
2e: 0f 85 1a 05 00 00 jne 0x54e
34: 49 8b 54 24 08 mov 0x8(%r12),%rdx
39: 4c 89 ee mov %r13,%rsi
3c: 4c 89 ff mov %r15,%rdi
3f: 83 .byte 0x83
---
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] 5+ messages in thread* [PATCH] netfs: if extracting pages from user iterator fails return 0
2024-05-20 8:06 [syzbot] [fs?] general protection fault in iter_file_splice_write syzbot
@ 2024-05-24 5:35 ` Lizhi Xu
2024-08-11 22:43 ` [syzbot] [fs?] general protection fault in iter_file_splice_write syzbot
2025-09-23 19:59 ` syzbot
2 siblings, 0 replies; 5+ messages in thread
From: Lizhi Xu @ 2024-05-24 5:35 UTC (permalink / raw)
To: syzbot+d2125fcb6aa8c4276fd2
Cc: brauner, jack, linux-fsdevel, linux-kernel, syzkaller-bugs, viro
When extracting the pages from a user iterator fails, netfs_extract_user_iter()
will return 0, this situation will result in an abnormal and oversized return
value for netfs_unbuffered_writer_locked() (for example, 9223372036854775807).
Therefore, when the number of extracted pages is 0, set ret to 0 and jump to out.
Reported-and-tested-by: syzbot+d2125fcb6aa8c4276fd2@syzkaller.appspotmail.com
Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
---
fs/netfs/direct_write.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/netfs/direct_write.c b/fs/netfs/direct_write.c
index 608ba6416919..d74761fb1876 100644
--- a/fs/netfs/direct_write.c
+++ b/fs/netfs/direct_write.c
@@ -69,7 +69,7 @@ static ssize_t netfs_unbuffered_write_iter_locked(struct kiocb *iocb, struct iov
*/
if (async || user_backed_iter(iter)) {
n = netfs_extract_user_iter(iter, len, &wreq->iter, 0);
- if (n < 0) {
+ if (n <= 0) {
ret = n;
goto out;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [syzbot] [fs?] general protection fault in iter_file_splice_write
2024-05-20 8:06 [syzbot] [fs?] general protection fault in iter_file_splice_write syzbot
2024-05-24 5:35 ` [PATCH] netfs: if extracting pages from user iterator fails return 0 Lizhi Xu
@ 2024-08-11 22:43 ` syzbot
2025-09-23 19:59 ` syzbot
2 siblings, 0 replies; 5+ messages in thread
From: syzbot @ 2024-08-11 22:43 UTC (permalink / raw)
To: asmadeus, brauner, dhowells, eadavis, ericvh, jack, jlayton,
linux-afs, linux-fsdevel, linux-kernel, linux_oss, lizhi.xu,
lucho, marc.dionne, netfs, syzkaller-bugs, v9fs, viro
syzbot has bisected this issue to:
commit 2df86547b23dabcd02ab000a24ed7813606c269f
Author: David Howells <dhowells@redhat.com>
Date: Fri Mar 8 12:36:05 2024 +0000
netfs: Cut over to using new writeback code
bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=148b014b980000
start commit: 5189dafa4cf9 Merge tag 'nfsd-6.11-1' of git://git.kernel.o..
git tree: upstream
final oops: https://syzkaller.appspot.com/x/report.txt?x=168b014b980000
console output: https://syzkaller.appspot.com/x/log.txt?x=128b014b980000
kernel config: https://syzkaller.appspot.com/x/.config?x=e8a2eef9745ade09
dashboard link: https://syzkaller.appspot.com/bug?extid=d2125fcb6aa8c4276fd2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16828c5d980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=103c7805980000
Reported-by: syzbot+d2125fcb6aa8c4276fd2@syzkaller.appspotmail.com
Fixes: 2df86547b23d ("netfs: Cut over to using new writeback code")
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [syzbot] [fs?] general protection fault in iter_file_splice_write
2024-05-20 8:06 [syzbot] [fs?] general protection fault in iter_file_splice_write syzbot
2024-05-24 5:35 ` [PATCH] netfs: if extracting pages from user iterator fails return 0 Lizhi Xu
2024-08-11 22:43 ` [syzbot] [fs?] general protection fault in iter_file_splice_write syzbot
@ 2025-09-23 19:59 ` syzbot
2025-09-25 12:47 ` David Howells
2 siblings, 1 reply; 5+ messages in thread
From: syzbot @ 2025-09-23 19:59 UTC (permalink / raw)
To: asmadeus, brauner, danielyangkang, dhowells, eadavis, ericvh,
jack, jlayton, linux-afs, linux-fsdevel, linux-kernel, linux_oss,
lizhi.xu, lucho, marc.dionne, netfs, pc, syzkaller-bugs, v9fs,
viro
syzbot suspects this issue was fixed by commit:
commit a3de58b12ce074ec05b8741fa28d62ccb1070468
Author: David Howells <dhowells@redhat.com>
Date: Thu Aug 14 21:45:50 2025 +0000
netfs: Fix unbuffered write error handling
bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=162dc142580000
start commit: 5189dafa4cf9 Merge tag 'nfsd-6.11-1' of git://git.kernel.o..
git tree: upstream
kernel config: https://syzkaller.appspot.com/x/.config?x=e8a2eef9745ade09
dashboard link: https://syzkaller.appspot.com/bug?extid=d2125fcb6aa8c4276fd2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16828c5d980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=103c7805980000
If the result looks correct, please mark the issue as fixed by replying with:
#syz fix: netfs: Fix unbuffered write error handling
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [syzbot] [fs?] general protection fault in iter_file_splice_write
2025-09-23 19:59 ` syzbot
@ 2025-09-25 12:47 ` David Howells
0 siblings, 0 replies; 5+ messages in thread
From: David Howells @ 2025-09-25 12:47 UTC (permalink / raw)
To: syzbot
Cc: dhowells, asmadeus, brauner, danielyangkang, eadavis, ericvh,
jack, jlayton, linux-afs, linux-fsdevel, linux-kernel, linux_oss,
lizhi.xu, lucho, marc.dionne, netfs, pc, syzkaller-bugs, v9fs,
viro
#syz fix: netfs: Fix unbuffered write error handling
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-09-25 12:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-20 8:06 [syzbot] [fs?] general protection fault in iter_file_splice_write syzbot
2024-05-24 5:35 ` [PATCH] netfs: if extracting pages from user iterator fails return 0 Lizhi Xu
2024-08-11 22:43 ` [syzbot] [fs?] general protection fault in iter_file_splice_write syzbot
2025-09-23 19:59 ` syzbot
2025-09-25 12:47 ` David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).