lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <altaotwhserbakcnhlenmma5o7o7j6yhy3gcaqwxdaf7sotlz5@qzsiiyu5s4ah>
Date: Mon, 15 Sep 2025 14:59:28 +0200
From: Jan Kara <jack@...e.cz>
To: Christian Brauner <brauner@...nel.org>
Cc: Jan Kara <jack@...e.cz>, Amir Goldstein <amir73il@...il.com>, 
	linux-fsdevel@...r.kernel.org, Josef Bacik <josef@...icpanda.com>, 
	Jeff Layton <jlayton@...nel.org>, Mike Yuan <me@...dnzj.com>, 
	Zbigniew Jędrzejewski-Szmek <zbyszek@...waw.pl>, Lennart Poettering <mzxreary@...inter.de>, 
	Daan De Meyer <daan.j.demeyer@...il.com>, Aleksa Sarai <cyphar@...har.com>, 
	Alexander Viro <viro@...iv.linux.org.uk>, Jens Axboe <axboe@...nel.dk>, Tejun Heo <tj@...nel.org>, 
	Johannes Weiner <hannes@...xchg.org>, Michal Koutný <mkoutny@...e.com>, 
	Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, 
	Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, 
	Chuck Lever <chuck.lever@...cle.com>, linux-nfs@...r.kernel.org, linux-kselftest@...r.kernel.org, 
	linux-block@...r.kernel.org, linux-kernel@...r.kernel.org, cgroups@...r.kernel.org, 
	netdev@...r.kernel.org
Subject: Re: [PATCH v2 25/33] uts: support ns lookup

On Fri 12-09-25 13:52:48, Christian Brauner wrote:
> Support the generic ns lookup infrastructure to support file handles for
> namespaces.
> 
> Signed-off-by: Christian Brauner <brauner@...nel.org>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  kernel/utsname.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/utsname.c b/kernel/utsname.c
> index 02037010b378..64155417ae0c 100644
> --- a/kernel/utsname.c
> +++ b/kernel/utsname.c
> @@ -13,6 +13,7 @@
>  #include <linux/cred.h>
>  #include <linux/user_namespace.h>
>  #include <linux/proc_ns.h>
> +#include <linux/nstree.h>
>  #include <linux/sched/task.h>
>  
>  static struct kmem_cache *uts_ns_cache __ro_after_init;
> @@ -58,6 +59,7 @@ static struct uts_namespace *clone_uts_ns(struct user_namespace *user_ns,
>  	memcpy(&ns->name, &old_ns->name, sizeof(ns->name));
>  	ns->user_ns = get_user_ns(user_ns);
>  	up_read(&uts_sem);
> +	ns_tree_add(ns);
>  	return ns;
>  
>  fail_free:
> @@ -93,10 +95,12 @@ struct uts_namespace *copy_utsname(unsigned long flags,
>  
>  void free_uts_ns(struct uts_namespace *ns)
>  {
> +	ns_tree_remove(ns);
>  	dec_uts_namespaces(ns->ucounts);
>  	put_user_ns(ns->user_ns);
>  	ns_free_inum(&ns->ns);
> -	kmem_cache_free(uts_ns_cache, ns);
> +	/* Concurrent nstree traversal depends on a grace period. */
> +	kfree_rcu(ns, ns.ns_rcu);
>  }
>  
>  static inline struct uts_namespace *to_uts_ns(struct ns_common *ns)
> @@ -162,4 +166,5 @@ void __init uts_ns_init(void)
>  			offsetof(struct uts_namespace, name),
>  			sizeof_field(struct uts_namespace, name),
>  			NULL);
> +	ns_tree_add(&init_uts_ns);
>  }
> 
> -- 
> 2.47.3
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ