]> www.infradead.org Git - nvme.git/commit
pidfs: handle kernels without namespaces cleanly
authorChristian Brauner <brauner@kernel.org>
Mon, 22 Jul 2024 13:13:54 +0000 (15:13 +0200)
committerChristian Brauner <brauner@kernel.org>
Wed, 24 Jul 2024 08:53:13 +0000 (10:53 +0200)
commit9b3e15046437d0e647e1f29ac955e2a3eb94b675
treed9f8829cc52cd6db19b6eb5b591f7dac4208c09d
parentf60d38cb02d03f39576f9c7ad13652babded2410
pidfs: handle kernels without namespaces cleanly

The nsproxy structure contains nearly all of the namespaces associated
with a task. When a given namespace type is not supported by this kernel
the rules whether the corresponding pointer in struct nsproxy is NULL or
always init_<ns_type>_ns differ per namespace. Ideally, that wouldn't be
the case and for all namespace types we'd always set it to
init_<ns_type>_ns when the corresponding namespace type isn't supported.

Make sure we handle all namespaces where the pointer in struct nsproxy
can be NULL when the namespace type isn't supported.

Link: https://lore.kernel.org/r/20240722-work-pidfs-e6a83030f63e@brauner
Fixes: 5b08bd408534 ("pidfs: allow retrieval of namespace file descriptors") # mainline only
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/pidfs.c