linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vfs: fix uninitialized flags in splice_to_pipe()
@ 2017-02-16 16:49 Miklos Szeredi
  2017-02-20  9:20 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Miklos Szeredi @ 2017-02-16 16:49 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, linux-kernel, Linus Torvalds

From: Miklos Szeredi <mszeredi@redhat.com>

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 <mszeredi@redhat.com>
Cc: <stable@vger.kernel.org> # 2.6.17+
---
 fs/splice.c |    1 +
 1 file changed, 1 insertion(+)

--- a/fs/splice.c
+++ b/fs/splice.c
@@ -204,6 +204,7 @@ ssize_t splice_to_pipe(struct pipe_inode
 		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++;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] vfs: fix uninitialized flags in splice_to_pipe()
  2017-02-16 16:49 [PATCH] vfs: fix uninitialized flags in splice_to_pipe() Miklos Szeredi
@ 2017-02-20  9:20 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2017-02-20  9:20 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: Al Viro, linux-fsdevel, linux-kernel, Linus Torvalds

On Thu, Feb 16, 2017 at 05:49:02PM +0100, Miklos Szeredi wrote:
> From: Miklos Szeredi <mszeredi@redhat.com>
> 
> 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.

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-20  9:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-16 16:49 [PATCH] vfs: fix uninitialized flags in splice_to_pipe() Miklos Szeredi
2017-02-20  9:20 ` Christoph Hellwig

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).