From: Greg KH <greg@kroah.com>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: stable <stable@vger.kernel.org>,
Seth Jennings <sjenning@redhat.com>,
Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH stable] pipe: iovec: Fix memory corruption when retrying atomic copy as non-atomic
Date: Thu, 25 Jun 2015 21:20:47 -0700 [thread overview]
Message-ID: <20150626042047.GA32451@kroah.com> (raw)
In-Reply-To: <1434489811.4279.7.camel@decadent.org.uk>
On Tue, Jun 16, 2015 at 10:23:31PM +0100, Ben Hutchings wrote:
> pipe_iov_copy_{from,to}_user() may be tried twice with the same iovec,
> the first time atomically and the second time not. The second attempt
> needs to continue from the iovec position, pipe buffer offset and
> remaining length where the first attempt failed, but currently the
> pipe buffer offset and remaining length are reset. This will corrupt
> the piped data (possibly also leading to an information leak between
> processes) and may also corrupt kernel memory.
>
> This was fixed upstream by commits f0d1bec9d58d ("new helper:
> copy_page_from_iter()") and 637b58c2887e ("switch pipe_read() to
> copy_page_to_iter()"), but those aren't suitable for stable.
>
> So 3.14.y and all earlier branches need a different fix. I extracted
> the fix made by Seth Jennings for RHEL and have attached versions for
> 2.6.32.y and 3.2.y (tested) and 3.14.y (untested, just resolved a
> conflict there). One or other of these should work for the other
> maintained branches.
Many thanks for these, now applied to 3.14 and 3.10-stable.
greg k-h
next prev parent reply other threads:[~2015-06-26 5:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-16 21:23 [PATCH stable] pipe: iovec: Fix memory corruption when retrying atomic copy as non-atomic Ben Hutchings
2015-06-26 4:20 ` Greg KH [this message]
2015-06-29 18:53 ` Kamal Mostafa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150626042047.GA32451@kroah.com \
--to=greg@kroah.com \
--cc=ben@decadent.org.uk \
--cc=sjenning@redhat.com \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).