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 <cmlla...@google.com> > Signed-off-by: Tiffany Yang <ynaf...@google.com>
Reviewed-by: Kees Cook <k...@kernel.org> -- Kees Cook