Linux filesystem development
 help / color / mirror / Atom feed
From: Bradley Morgan <bradley.morgan@linux.dev>
To: ndokutovich@gmail.com
Cc: brauner@kernel.org, jack@suse.cz, jlayton@kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, viro@zeniv.linux.org.uk
Subject: Re: [PATCH 0/2] listns(): validate the reserved spare2 field
Date: Sat, 28 Nov 2026 15:44:07 +0000	[thread overview]
Message-ID: <2DE3E250-2C87-4816-B96F-CD951F02BD6E@linux.dev> (raw)
In-Reply-To: <20261128140623.19-1-ndokutovich@gmail.com>

On 28 November 2026 14:06:21 GMT, Nikolai Dokutovich
<ndokutovich@gmail.com> wrote:
>copy_ns_id_req() rejects a non-zero @spare but not @spare2, although
>struct ns_id_req documents both as reserved.  Validate @spare2 the same
>way, and extend the error-case selftest to cover it instead of only
>@spare.
>
>Nikolai Dokutovich (2):
>  nstree: reject a non-zero spare2 in the listns() request
>  selftests/namespaces: check that listns() rejects a non-zero spare2

Had a nice read through, thanks for the tests, for the whole series, let's
put,

Reviewed-by: Bradley Morgan <bradley.morgan@linux.dev>

Also, a nice question, since I tend to be a bit ^Winsane^W

Is this bug a edge case? Most bugs found nowadays in the kernel are edge
cases, but they would still need to be merged, because again, it's still a
case that can be reached.

My question to you, is could this bug be actually reached? Like, would a
future caller set spare2 as non zero? would the driver maintainer for
example be silly enough to set non zero spare2, probably knowing the
consequences (if they understood the code), well, if they didn't, it'd be
their problem, no?

I had a look at some callers, mostly selftests, and they all patch up this
correctly, so this wouldn't be reachable RIGHT now. I added my tag because
we will have to account for the future callers silliness (adding non zero
spare2)...



>
> kernel/nstree.c                                  |  2 +-
> tools/testing/selftests/namespaces/listns_test.c | 11 +++++++++++
> 2 files changed, 12 insertions(+), 1 deletion(-)
>
>

--- Thanks!

  parent reply	other threads:[~2026-11-28 15:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28 14:06 [PATCH 0/2] listns(): validate the reserved spare2 field Nikolai Dokutovich
2026-11-28 14:06 ` [PATCH 1/2] nstree: reject a non-zero spare2 in the listns() request Nikolai Dokutovich
2026-11-28 14:06 ` [PATCH 2/2] selftests/namespaces: check that listns() rejects a non-zero spare2 Nikolai Dokutovich
2026-11-28 15:44 ` Bradley Morgan [this message]
2026-11-28 15:49   ` [PATCH 0/2] listns(): validate the reserved spare2 field Bradley Morgan

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=2DE3E250-2C87-4816-B96F-CD951F02BD6E@linux.dev \
    --to=bradley.morgan@linux.dev \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ndokutovich@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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