mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
[fs/9p] Plug potential acl leak
In v9fs_get_acl() if __v9fs_get_acl() gets only one of the dacl/pacl we are not releasing it. Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
This commit is contained in:
parent
521cb40b0c
commit
c61fa0d6d9
1 changed files with 6 additions and 2 deletions
|
@ -71,11 +71,15 @@ int v9fs_get_acl(struct inode *inode, struct p9_fid *fid)
|
||||||
if (!IS_ERR(dacl) && !IS_ERR(pacl)) {
|
if (!IS_ERR(dacl) && !IS_ERR(pacl)) {
|
||||||
set_cached_acl(inode, ACL_TYPE_DEFAULT, dacl);
|
set_cached_acl(inode, ACL_TYPE_DEFAULT, dacl);
|
||||||
set_cached_acl(inode, ACL_TYPE_ACCESS, pacl);
|
set_cached_acl(inode, ACL_TYPE_ACCESS, pacl);
|
||||||
posix_acl_release(dacl);
|
|
||||||
posix_acl_release(pacl);
|
|
||||||
} else
|
} else
|
||||||
retval = -EIO;
|
retval = -EIO;
|
||||||
|
|
||||||
|
if (!IS_ERR(dacl))
|
||||||
|
posix_acl_release(dacl);
|
||||||
|
|
||||||
|
if (!IS_ERR(pacl))
|
||||||
|
posix_acl_release(pacl);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue