public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Tiffany Yang <ynaffit@google.com>
Cc: linux-kernel@vger.kernel.org, kernel-team@android.com,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Todd Kjos" <tkjos@android.com>,
	"Martijn Coenen" <maco@android.com>,
	"Joel Fernandes" <joelagnelf@nvidia.com>,
	"Christian Brauner" <brauner@kernel.org>,
	"Carlos Llamas" <cmllamas@google.com>,
	"Suren Baghdasaryan" <surenb@google.com>,
	"Brendan Higgins" <brendan.higgins@linux.dev>,
	"David Gow" <davidgow@google.com>, "Rae Moar" <rmoar@google.com>,
	linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com
Subject: Re: [PATCH v4 2/6] binder: Store lru freelist in binder_alloc
Date: Wed, 16 Jul 2025 23:23:56 -0700	[thread overview]
Message-ID: <202507162323.8A11B97@keescook> (raw)
In-Reply-To: <20250717011011.3365074-3-ynaffit@google.com>

On Wed, Jul 16, 2025 at 06:10:05PM -0700, Tiffany Yang wrote:
> Store a pointer to the free pages list that the binder allocator should
> use for a process inside of struct binder_alloc. This change allows
> binder allocator code to be tested and debugged deterministically while
> a system is using binder; i.e., without interfering with other binder
> processes and independently of the shrinker. This is necessary to
> convert the current binder_alloc_selftest into a kunit test that does
> not rely on hijacking an existing binder_proc to run.
> 
> A binder process's binder_alloc->freelist should not be changed after
> it is initialized. A sole exception is the process that runs the
> existing binder_alloc selftest. Its freelist can be temporarily replaced
> for the duration of the test because it runs as a single thread before
> any pages can be added to the global binder freelist, and the test frees
> every page it allocates before dropping the binder_selftest_lock. This
> exception allows the existing selftest to be used to check for
> regressions, but it will be dropped when the binder_alloc tests are
> converted to kunit in a subsequent patch in this series.
> 
> Acked-by: Carlos Llamas <cmllamas@google.com>
> Signed-off-by: Tiffany Yang <ynaffit@google.com>

Reviewed-by: Kees Cook <kees@kernel.org>

-- 
Kees Cook

  reply	other threads:[~2025-07-17  6:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17  1:10 [PATCH v4 0/6] binder: Set up KUnit tests for alloc Tiffany Yang
2025-07-17  1:10 ` [PATCH v4 1/6] binder: Fix selftest page indexing Tiffany Yang
2025-07-17  6:23   ` Kees Cook
2025-07-17  1:10 ` [PATCH v4 2/6] binder: Store lru freelist in binder_alloc Tiffany Yang
2025-07-17  6:23   ` Kees Cook [this message]
2025-07-17  1:10 ` [PATCH v4 3/6] kunit: test: Export kunit_attach_mm() Tiffany Yang
2025-07-17  1:10 ` [PATCH v4 4/6] binder: Scaffolding for binder_alloc KUnit tests Tiffany Yang
2025-07-17  1:10 ` [PATCH v4 5/6] binder: Convert binder_alloc selftests to KUnit Tiffany Yang
2025-07-17  6:33   ` Kees Cook
2025-07-17  1:10 ` [PATCH v4 6/6] binder: encapsulate individual alloc test cases Tiffany Yang
2025-07-17  6:32   ` Kees Cook
2025-07-17  7:34     ` Kees Cook
2025-07-17 14:41 ` [PATCH v4 0/6] binder: Set up KUnit tests for alloc Greg Kroah-Hartman
2025-07-21 16:22 ` Joel Fernandes

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=202507162323.8A11B97@keescook \
    --to=kees@kernel.org \
    --cc=arve@android.com \
    --cc=brauner@kernel.org \
    --cc=brendan.higgins@linux.dev \
    --cc=cmllamas@google.com \
    --cc=davidgow@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joelagnelf@nvidia.com \
    --cc=kernel-team@android.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=maco@android.com \
    --cc=rmoar@google.com \
    --cc=surenb@google.com \
    --cc=tkjos@android.com \
    --cc=ynaffit@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