From: Greg KH <gregkh@linuxfoundation.org>
To: Todd Kjos <tkjos@google.com>
Cc: christian@brauner.io, arve@android.com,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
maco@google.com, joel@joelfernandes.org, kernel-team@android.com,
stable <stable@vger.kernel.org>
Subject: Re: [PATCH] binder: fix async_free_space accounting for empty parcels
Date: Tue, 21 Dec 2021 11:08:11 +0100 [thread overview]
Message-ID: <YcGnizJKAQ9pxGBY@kroah.com> (raw)
In-Reply-To: <CAHRSSExTHHOdqEnRF0g435BrO5L-X6M3pxPg3OmLz8xUWDuNKA@mail.gmail.com>
On Mon, Dec 20, 2021 at 11:06:09AM -0800, Todd Kjos wrote:
> On Mon, Dec 20, 2021 at 11:02 AM Todd Kjos <tkjos@google.com> wrote:
> >
> > In 4.13, commit 74310e06be4d ("android: binder: Move buffer out of area shared with user space")
> > fixed a kernel structure visibility issue. As part of that patch,
> > sizeof(void *) was used as the buffer size for 0-length data payloads so
> > the driver could detect abusive clients sending 0-length asynchronous
> > transactions to a server by enforcing limits on async_free_size.
> >
> > Unfortunately, on the "free" side, the accounting of async_free_space
> > did not add the sizeof(void *) back. The result was that up to 8-bytes of
> > async_free_space were leaked on every async transaction of 8-bytes or
> > less. These small transactions are uncommon, so this accounting issue
> > has gone undetected for several years.
> >
> > The fix is to use "buffer_size" (the allocated buffer size) instead of
> > "size" (the logical buffer size) when updating the async_free_space
> > during the free operation. These are the same except for this
> > corner case of asynchronous transactions with payloads < 8 bytes.
> >
> > Fixes: 74310e06be4d ("android: binder: Move buffer out of area shared with user space")
> > Signed-off-by: Todd Kjos <tkjos@google.com>
>
> I forgot to CC stable. This applies to all stable branches back to 4.14.
> Cc: stable@vger.kernel.org # 4.14+
Thanks, I've added that to the patch when committing it.
greg k-h
next prev parent reply other threads:[~2021-12-21 10:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-20 19:01 [PATCH] binder: fix async_free_space accounting for empty parcels Todd Kjos
2021-12-20 19:06 ` Todd Kjos
2021-12-21 10:08 ` Greg KH [this message]
2021-12-22 14:30 ` Martijn Coenen
2021-12-23 9:47 ` Christian Brauner
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=YcGnizJKAQ9pxGBY@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=arve@android.com \
--cc=christian@brauner.io \
--cc=devel@driverdev.osuosl.org \
--cc=joel@joelfernandes.org \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@google.com \
--cc=stable@vger.kernel.org \
--cc=tkjos@google.com \
/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