[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_CAE2ED8ECCF07BB66D902CB16CA894F8EA0A@qq.com>
Date: Thu, 23 May 2024 22:13:00 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+d2125fcb6aa8c4276fd2@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [fs?] general protection fault in iter_file_splice_write
please test null ptr in iter_file_splice_write
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 33e02dc69afb
diff --git a/fs/splice.c b/fs/splice.c
index 60aed8de21f8..2881e9a7e491 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -751,10 +751,19 @@ iter_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
/* dismiss the fully eaten buffers, adjust the partial one */
tail = pipe->tail;
- while (ret) {
+ n = 0;
+ while (ret > 0 && n < nbufs) {
struct pipe_buffer *buf = &pipe->bufs[tail & mask];
+ n++;
+ if (!buf->len) {
+ tail++;
+ continue;
+ }
if (ret >= buf->len) {
+ printk("ret: %ld, nbufs: %d, buf:%p, buf len: %u, m: %u, t: %u,ring size: %u, t&m: %u, n:%d, %s\n",
+ ret, nbufs, buf, buf->len, mask, tail, pipe->ring_size, tail & mask, n, __func__);
ret -= buf->len;
+ printk("ret: %ld, %s\n", ret, __func__);
buf->len = 0;
pipe_buf_release(pipe, buf);
tail++;
Powered by blists - more mailing lists