From: Lee Jones <lee.jones@linaro.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org, Daniel Rosenberg <drosen@google.com>,
Dennis Cagle <d-cagle@codeaurora.org>,
Patrick Daly <pdaly@codeaurora.org>
Subject: Re: [PATCH 4.9 1/3] ion: Fix use after free during ION_IOC_ALLOC
Date: Tue, 25 Jan 2022 09:21:24 +0000 [thread overview]
Message-ID: <Ye/BFKrUP/nLSGJC@google.com> (raw)
In-Reply-To: <Ye7wcqssa5RuvwQe@kroah.com>
On Mon, 24 Jan 2022, Greg KH wrote:
> On Mon, Jan 24, 2022 at 04:12:41PM +0000, Lee Jones wrote:
> > From: Daniel Rosenberg <drosen@google.com>
> >
> > If a user happens to call ION_IOC_FREE during an ION_IOC_ALLOC
> > on the just allocated id, and the copy_to_user fails, the cleanup
> > code will attempt to free an already freed handle.
> >
> > This adds a wrapper for ion_alloc that adds an ion_handle_get to
> > avoid this.
> >
> > Signed-off-by: Daniel Rosenberg <drosen@google.com>
> > Signed-off-by: Dennis Cagle <d-cagle@codeaurora.org>
> > Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > ---
> > drivers/staging/android/ion/ion-ioctl.c | 14 +++++++++-----
> > drivers/staging/android/ion/ion.c | 15 ++++++++++++---
> > drivers/staging/android/ion/ion.h | 4 ++++
> > 3 files changed, 25 insertions(+), 8 deletions(-)
>
> What is the git commit id of this in Linus's tree (same for the other
> 2)?
They are not in Linus' tree.
These fixes only made it into Android for some reason.
> And why just 4.9? What about 4.14 and newer kernels?
The troublesome code was refactored before v4.14.
--
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2022-01-25 9:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 16:12 [PATCH 4.9 1/3] ion: Fix use after free during ION_IOC_ALLOC Lee Jones
2022-01-24 16:12 ` [PATCH 4.9 2/3] ion: Protect kref from userspace manipulation Lee Jones
2022-01-24 16:12 ` [PATCH 4.9 3/3] ion: Do not 'put' ION handle until after its final use Lee Jones
2022-01-24 18:31 ` [PATCH 4.9 1/3] ion: Fix use after free during ION_IOC_ALLOC Greg KH
2022-01-25 9:21 ` Lee Jones [this message]
2022-01-25 10:26 ` Greg KH
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=Ye/BFKrUP/nLSGJC@google.com \
--to=lee.jones@linaro.org \
--cc=d-cagle@codeaurora.org \
--cc=drosen@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=pdaly@codeaurora.org \
--cc=stable@vger.kernel.org \
/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).