From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.10.y 1/4] ns: move to_ns_common() to ns_common.h
Date: Wed, 16 Sep 2026 22:18:59 -0400 [thread overview]
Message-ID: <20260917021902.3810750-1-sashal@kernel.org> (raw)
In-Reply-To: <2026091618-used-flashbulb-70ef@gregkh>
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit e3e1812f8e25ac277f5cc9249802365300c582e3 ]
Move the helper to ns_common.h where it belongs.
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Stable-dep-of: 7812d6dab069 ("bootconfig: Fix integer overflow in initrd size check")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/ns_common.h | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/include/linux/ns_common.h b/include/linux/ns_common.h
index 5fbc4000358f1..d2b9e0b4a928f 100644
--- a/include/linux/ns_common.h
+++ b/include/linux/ns_common.h
@@ -4,10 +4,30 @@
struct proc_ns_operations;
+struct cgroup_namespace;
+struct ipc_namespace;
+struct mnt_namespace;
+struct net;
+struct pid_namespace;
+struct time_namespace;
+struct user_namespace;
+struct uts_namespace;
+
struct ns_common {
atomic_long_t stashed;
const struct proc_ns_operations *ops;
unsigned int inum;
};
+#define to_ns_common(__ns) \
+ _Generic((__ns), \
+ struct cgroup_namespace *: &(__ns)->ns, \
+ struct ipc_namespace *: &(__ns)->ns, \
+ struct mnt_namespace *: &(__ns)->ns, \
+ struct net *: &(__ns)->ns, \
+ struct pid_namespace *: &(__ns)->ns, \
+ struct time_namespace *: &(__ns)->ns, \
+ struct user_namespace *: &(__ns)->ns, \
+ struct uts_namespace *: &(__ns)->ns)
+
#endif
--
2.53.0
next prev parent reply other threads:[~2026-09-17 2:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 15:15 FAILED: patch "[PATCH] bootconfig: Fix integer overflow in initrd size check" failed to apply to 5.10-stable tree gregkh
2026-09-17 2:18 ` Sasha Levin [this message]
2026-09-17 2:19 ` [PATCH 5.10.y 2/4] ns: uniformly initialize ns_common Sasha Levin
2026-09-17 2:19 ` [PATCH 5.10.y 3/4] init/main: read bootconfig header with get_unaligned_le32() Sasha Levin
2026-09-17 2:19 ` [PATCH 5.10.y 4/4] bootconfig: Fix integer overflow in initrd size check Sasha Levin
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=20260917021902.3810750-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=stable@vger.kernel.org \
/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