All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] nfs: fix acl memory leak of posix_acl_create()
@ 2021-06-23  6:38 Gao Xiang
  2021-06-23  6:38 ` [PATCH v2 2/2] nfs: NFSv3: fix SGID bit dropped when inheriting ACLs Gao Xiang
  2021-06-24 12:51 ` [PATCH v2 1/2] nfs: fix acl memory leak of posix_acl_create() Christoph Hellwig
  0 siblings, 2 replies; 5+ messages in thread
From: Gao Xiang @ 2021-06-23  6:38 UTC (permalink / raw)
  To: linux-nfs
  Cc: LKML, Gao Xiang, Trond Myklebust, Anna Schumaker,
	Christoph Hellwig, Joseph Qi

When looking into another nfs xfstests report, I found acl and
default_acl in nfs3_proc_create() and nfs3_proc_mknod() error
paths are possibly leaked. Fix them in advance.

Fixes: 013cdf1088d7 ("nfs: use generic posix ACL infrastructure for v3 Posix ACLs")
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: Anna Schumaker <anna.schumaker@netapp.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
no change.

 fs/nfs/nfs3proc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 5c4e23abc345..2299446b3b89 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -385,7 +385,7 @@ static void nfs3_free_createdata(struct nfs3_createdata *data)
 				break;
 
 			case NFS3_CREATE_UNCHECKED:
-				goto out;
+				goto out_release_acls;
 		}
 		nfs_fattr_init(data->res.dir_attr);
 		nfs_fattr_init(data->res.fattr);
@@ -751,7 +751,7 @@ static int nfs3_proc_readdir(struct nfs_readdir_arg *nr_arg,
 		break;
 	default:
 		status = -EINVAL;
-		goto out;
+		goto out_release_acls;
 	}
 
 	d_alias = nfs3_do_create(dir, dentry, data);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-24 15:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23  6:38 [PATCH v2 1/2] nfs: fix acl memory leak of posix_acl_create() Gao Xiang
2021-06-23  6:38 ` [PATCH v2 2/2] nfs: NFSv3: fix SGID bit dropped when inheriting ACLs Gao Xiang
2021-06-24 13:13   ` Trond Myklebust
2021-06-24 15:48     ` Gao Xiang
2021-06-24 12:51 ` [PATCH v2 1/2] nfs: fix acl memory leak of posix_acl_create() Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.