Skip to content

Commit 5a81e6a

Browse files
Miklos Szereditorvalds
authored andcommitted
vfs: fix uninitialized flags in splice_to_pipe()
Flags (PIPE_BUF_FLAG_PACKET, PIPE_BUF_FLAG_GIFT) could remain on the unused part of the pipe ring buffer. Previously splice_to_pipe() left the flags value alone, which could result in incorrect behavior. Uninitialized flags appears to have been there from the introduction of the splice syscall. Signed-off-by: Miklos Szeredi <[email protected]> Cc: <[email protected]> # 2.6.17+ Signed-off-by: Linus Torvalds <[email protected]>
1 parent 58f6eae commit 5a81e6a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/splice.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
204204
buf->len = spd->partial[page_nr].len;
205205
buf->private = spd->partial[page_nr].private;
206206
buf->ops = spd->ops;
207+
buf->flags = 0;
207208

208209
pipe->nrbufs++;
209210
page_nr++;

0 commit comments

Comments
 (0)