All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kamal Mostafa <kamal@canonical.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: Mon, 29 Jun 2015 11:53:23 -0700	[thread overview]
Message-ID: <1435604003.30753.1.camel@fourier> (raw)
In-Reply-To: <1434489811.4279.7.camel@decadent.org.uk>

On Tue, 2015-06-16 at 22:23 +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.
> 
> Ben.
> 

Thanks Ben!  Applied to 3.13-stable.

 -Kamal


      parent reply	other threads:[~2015-06-29 18:53 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
2015-06-29 18:53 ` Kamal Mostafa [this message]

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=1435604003.30753.1.camel@fourier \
    --to=kamal@canonical.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.