Thread (88 messages) 88 messages, 6 authors, 2025-10-29

Re: [PATCH v3 11/70] ns: add active reference count

From: Simon Horman <horms@kernel.org>
Date: 2025-10-28 10:30:13
Also in: bpf, cgroups, linux-fsdevel, lkml

On Fri, Oct 24, 2025 at 12:52:40PM +0200, Christian Brauner wrote:

...
quoted hunk ↗ jump to hunk
diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
...
+void get_cred_namespaces(struct task_struct *tsk)
+{
+	ns_ref_active_get(tsk->real_cred->user_ns);
Hi Christian,

real_cred is protected by RCU, but this code doesn't seem to take
that into account. Or, at least Sparse doesn't think so:

.../nsproxy.c:264:9: error: no generic selection for 'struct user_namespace *const [noderef] __rcu user_ns'
.../nsproxy.c:264:9: warning: dereference of noderef expression
+}
+
+void exit_cred_namespaces(struct task_struct *tsk)
+{
+	ns_ref_active_put(tsk->real_cred->user_ns);
Likewise here.
+}
+
 int exec_task_namespaces(void)
 {
 	struct task_struct *tsk = current;
...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help