Skip to contentSkip to conversation

Fix user namespace leak

PATCH In review Alexey Gladkov 3 participants 3 messages Oct 14, 2021 – Oct 15, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix user namespace leak

Fixes 61ca2c4afd9d ("NFS: Only reference user namespace from nfs4idmap struct instead of cred")
---
 fs/nfs/nfs4idmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/nfs4idmap.c +1 -1
index 8d8aba305ecc..f331866dd418 100644
@@ -487,7 +487,7 @@ nfs_idmap_new(struct nfs_client *clp)
 err_destroy_pipe:
 	rpc_destroy_pipe_data(idmap->idmap_pipe);
 err:
-	get_user_ns(idmap->user_ns);
+	put_user_ns(idmap->user_ns);
 	kfree(idmap);
 	return error;
 }
Signature · 1 line
2.33.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Alexey Gladkov
Fixes 61ca2c4afd9d ("NFS: Only reference user namespace from nfs4idmap struct instead of cred")

nfs folks do you want to pick this up?

Quoted 17 lines
---
 fs/nfs/nfs4idmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/nfs4idmap.c +1 -1
index 8d8aba305ecc..f331866dd418 100644
@@ -487,7 +487,7 @@ nfs_idmap_new(struct nfs_client *clp)
 err_destroy_pipe:
 	rpc_destroy_pipe_data(idmap->idmap_pipe);
 err:
-	get_user_ns(idmap->user_ns);
+	put_user_ns(idmap->user_ns);
 	kfree(idmap);
 	return error;
 }
#2 lore raw
Quoted 9 lines · Eric W. Biederman
Quoted 3 lines · Alexey Gladkov
Fixes 61ca2c4afd9d ("NFS: Only reference user namespace from

nfs4idmap struct instead of cred")

nfs folks do you want to pick this up?

It is in my testing branch,

Quoted 18 lines
Quoted 18 lines

---
 fs/nfs/nfs4idmap.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/nfs4idmap.c +0 -0
index 8d8aba305ecc..f331866dd418 100644
@@ -487,7 +487,7 @@ nfs_idmap_new(struct nfs_client *clp)

 err_destroy_pipe:
        rpc_destroy_pipe_data(idmap->idmap_pipe);
 err:
-       get_user_ns(idmap->user_ns);
+       put_user_ns(idmap->user_ns);
        kfree(idmap);
        return error;
 }

Signature · 3 lines
Trond Myklebust
Linux NFS client maintainer, Hammerspace
[email protected]