Re: [PATCH 14/32] net: use ns_common_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux