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: <aMHoje4qJsao2wkU@laps>
Date: Wed, 10 Sep 2025 17:07:25 -0400
From: Sasha Levin <sashal@...nel.org>
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 14/32] net: use ns_common_init()

On Wed, Sep 10, 2025 at 04:36:59PM +0200, Christian Brauner wrote:
>@@ -573,6 +588,7 @@ struct net *copy_net_ns(unsigned long flags,
>
> 	if (rv < 0) {
> put_userns:
>+		ns_free_inum(&net->ns);

I've ended up looking at this patch because of Jan's earlier comment about a
different issue in this patch.

Aren't we double-freeing net->ns here if setup_net() failed?

setup_net() can call ops_undo_list() on failure, which will
ns_free_inum(&net->ns) once, and then we do it again in the put_userns error
handling label.

-- 
Thanks,
Sasha

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ