mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Bill Wendling <morbo@google.com>
Cc: "Bradley Morgan" <brads@mainlining.org>,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	"Christian Brauner" <brauner@kernel.org>,
	"Aleksa Sarai" <cyphar@cyphar.com>, "Jan Kara" <jack@suse.cz>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Nicolas Schier" <nsc@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Douglas Anderson" <dianders@chromium.org>,
	"Anand Moon" <linux.amoon@gmail.com>,
	"Oleg Nesterov" <oleg@redhat.com>,
	codemender-patching+linux@google.com,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH v4 2/2] userns: Add KUnit test suite for uid_gid_map
Date: Fri, 4 Sep 2026 16:41:43 -0700	[thread overview]
Message-ID: <202609041634.6429DB8@keescook> (raw)
In-Reply-To: <20260826220041.4075333-2-morbo@google.com>

On Wed, Aug 26, 2026 at 10:00:35PM +0000, Bill Wendling wrote:
> Add a KUnit test suite to verify the insertion and sorting of mappings
> in struct uid_gid_map. This test suite validates both base extent
> insertion (<= 5 mappings) and extended extent insertion (> 5 mappings,
> which triggers the allocation of the forward and reverse pointers).
> 
> This is especially useful for verifying that the __counted_by_ptr
> attribute added to 'forward' and 'reverse' pointers works correctly
> without causing any runtime bounds-checking panics or traps.
> 
> Assisted-by: Gemini:3.1-pro-preview
> Signed-off-by: Bill Wendling <morbo@google.com>

Various style nit-picks as dictated by
Documentation/dev-tools/kunit/style.rst

(We may need to teach Sashiko about KUnit style?)

> kernel/user_namespace_kunit.c | 92 +++++++++++++++++++++++++++++++++++

Like below's naming, this should be named after the suite, and in the
tests/ subdir (even when #included), so it should be:
kernel/tests/user_ns_map_kunit.c

> +config USER_NAMESPACE_KUNIT_TEST

The suite and Kconfig should match, so this should be
USER_NS_MAP_KUNIT_TEST

> +	bool "Test user namespace map insertion" if !KUNIT_ALL_TESTS
> +	depends on KUNIT=y
> +	default KUNIT_ALL_TESTS

I think you need a "depends on USER_NS" ?

> +static struct kunit_suite user_ns_map_test_suite = {
> +	.name = "user_ns_map",
> +	.test_cases = user_ns_map_test_cases,
> +};


-Kees

-- 
Kees Cook

      parent reply	other threads:[~2026-09-04 23:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-23 12:51 [PATCH 0/2] Add __counted_by_ptr attribute to struct uid_gid_map Bill Wendling
2026-08-23 12:51 ` [PATCH 1/2] userns: " Bill Wendling
2026-08-23 13:50   ` Bradley Morgan
2026-08-23 14:52   ` Oleg Nesterov
2026-08-26 22:05     ` Bill Wendling
2026-08-24 19:18   ` Gustavo A. R. Silva
2026-08-23 12:51 ` [PATCH 2/2] userns: Add KUnit test suite for uid_gid_map Bill Wendling
2026-08-23 12:53   ` Bill Wendling
2026-08-26 20:43     ` [PATCH v3 " Bill Wendling
2026-08-26 21:21       ` Bradley Morgan
2026-08-26 22:04         ` Bill Wendling
2026-08-23 13:48   ` [PATCH " Bradley Morgan
2026-08-26 20:37     ` Bill Wendling
2026-08-24  6:13   ` Thomas Weißschuh
2026-08-26 20:40     ` Bill Wendling
2026-08-27 13:25       ` Thomas Weißschuh
2026-08-26 22:00 ` [PATCH v4 1/2] userns: Add __counted_by_ptr attribute to struct uid_gid_map Bill Wendling
2026-08-26 22:00   ` [PATCH v4 2/2] userns: Add KUnit test suite for uid_gid_map Bill Wendling
2026-08-26 22:27     ` Bradley Morgan
2026-08-27 13:36     ` Thomas Weißschuh
2026-08-27 19:27       ` Bill Wendling
2026-08-31  9:22         ` Thomas Weißschuh
2026-09-03 20:21           ` Bill Wendling
2026-09-04  8:02             ` Thomas Weißschuh
2026-09-04 20:37               ` Bill Wendling
2026-09-04 23:34                 ` Kees Cook
2026-09-04 23:41     ` Kees Cook [this message]

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=202609041634.6429DB8@keescook \
    --to=kees@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=brads@mainlining.org \
    --cc=brauner@kernel.org \
    --cc=codemender-patching+linux@google.com \
    --cc=cyphar@cyphar.com \
    --cc=dianders@chromium.org \
    --cc=gary@garyguo.net \
    --cc=gustavoars@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux.amoon@gmail.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=oleg@redhat.com \
    --cc=tglx@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    /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®