提交 d0c60a4e 编写于 作者: G Gao Xiang 提交者: Yang Yingliang

nfs: fix acl memory leak of posix_acl_create()

stable inclusion
from linux-4.19.198
commit 0704f617040c397ae73c1f88f3956787ec5d6529

--------------------------------

[ Upstream commit 1fcb6fcd ]

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: 013cdf10 ("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: NGao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 ed4d96b0
...@@ -350,7 +350,7 @@ nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, ...@@ -350,7 +350,7 @@ nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
break; break;
case NFS3_CREATE_UNCHECKED: case NFS3_CREATE_UNCHECKED:
goto out; goto out_release_acls;
} }
nfs_fattr_init(data->res.dir_attr); nfs_fattr_init(data->res.dir_attr);
nfs_fattr_init(data->res.fattr); nfs_fattr_init(data->res.fattr);
...@@ -717,7 +717,7 @@ nfs3_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr, ...@@ -717,7 +717,7 @@ nfs3_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
break; break;
default: default:
status = -EINVAL; status = -EINVAL;
goto out; goto out_release_acls;
} }
d_alias = nfs3_do_create(dir, dentry, data); d_alias = nfs3_do_create(dir, dentry, data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册