From: Carlos Llamas <cmllamas@google.com>
To: Alice Ryhl <aliceryhl@google.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Arve Hjønnevåg" <arve@android.com>,
"Todd Kjos" <tkjos@android.com>,
"Christian Brauner" <brauner@kernel.org>,
kernel-team@android.com, linux-kernel@vger.kernel.org,
"Suren Baghdasaryan" <surenb@google.com>,
stable@vger.kernel.org, Sashiko <sashiko-bot@kernel.org>
Subject: Re: [PATCH v2 3/5] binder: check vma->vm_start in binder_vma_close()
Date: Tue, 1 Sep 2026 15:47:05 +0000 [thread overview]
Message-ID: <apbzeSGFM2XtZbuK@google.com> (raw)
In-Reply-To: <apabb4vGhNfcXMnY@google.com>
On Tue, Sep 01, 2026 at 09:31:27AM +0000, Alice Ryhl wrote:
> On Tue, Sep 01, 2026 at 03:04:14AM +0000, Carlos Llamas wrote:
> > Certain operations like a failed mremap() might trigger vm_ops->close()
> > on temporary mappings. To avoid tearing-down the main binder mapping on
> > these, let's verify that the VMA matches the expected starting address.
> >
> > Cc: stable@vger.kernel.org
> > Fixes: 457b9a6f09f0 ("Staging: android: add binder driver")
> > Reported-by: Sashiko <sashiko-bot@kernel.org>
> > Closes: https://sashiko.dev/#/patchset/20260831224145.169403-1-cmllamas%40google.com?part=1
> > Signed-off-by: Carlos Llamas <cmllamas@google.com>
>
> I don't quite understand this. You explicitly made sure mremap() can't
> happen to begin with, so when is this called?
The issue is mremap() first clones the old vma and then calls ->mremap()
but we return -EINVAL. So it now starts to tear-down the cloned vma and
it calls ->close() as part of it.
The idea was to avoid shutting down our IPC when this happens.
However, sashiko pointed out a second issue with a tail split. I need to
expand this check to allow the ->close() on anything within the range of
the original VMA.
I'll have to send a v3.
next prev parent reply other threads:[~2026-09-01 15:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 3:04 [PATCH v2 0/5] binder: fix issues with mremap() Carlos Llamas
2026-09-01 3:04 ` [PATCH v2 1/5] binder: set VM_DONTEXPAND Carlos Llamas
2026-09-01 3:04 ` [PATCH v2 2/5] rust_binder: " Carlos Llamas
2026-09-01 3:04 ` [PATCH v2 3/5] binder: check vma->vm_start in binder_vma_close() Carlos Llamas
2026-09-01 9:31 ` Alice Ryhl
2026-09-01 15:47 ` Carlos Llamas [this message]
2026-09-01 3:04 ` [PATCH v2 4/5] binder: reject mremap() Carlos Llamas
2026-09-01 3:04 ` [PATCH v2 5/5] rust_binder: " Carlos Llamas
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=apbzeSGFM2XtZbuK@google.com \
--to=cmllamas@google.com \
--cc=aliceryhl@google.com \
--cc=arve@android.com \
--cc=brauner@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sashiko-bot@kernel.org \
--cc=stable@vger.kernel.org \
--cc=surenb@google.com \
--cc=tkjos@android.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
all inboxes | Powered by JetHome®