Skip to content

Commit

Permalink
vfs: fix uninitialized flags in splice_to_pipe()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Miklos Szeredi authored and torvalds committed Feb 16, 2017
1 parent 58f6eae commit 5a81e6a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
buf->len = spd->partial[page_nr].len;
buf->private = spd->partial[page_nr].private;
buf->ops = spd->ops;
buf->flags = 0;

pipe->nrbufs++;
page_nr++;
Expand Down

0 comments on commit 5a81e6a

Please sign in to comment.