]> git.baikalelectronics.ru Git - kernel.git/commit
nfs: Fix potential posix_acl refcnt leak in nfs3_set_acl
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 20 Apr 2020 13:51:47 +0000 (15:51 +0200)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 20 Apr 2020 13:58:59 +0000 (09:58 -0400)
commita08ed0e9becf63b9db38256b0cb905dbb661dd3c
treea1196b12fb041ebbd52c97123087e617b33a6a70
parent5a71c4761fdbf136e0ae8e4745c36a5bd9b6e44a
nfs: Fix potential posix_acl refcnt leak in nfs3_set_acl

nfs3_set_acl keeps track of the acl it allocated locally to determine if an acl
needs to be released at the end.  This results in a memory leak when the
function allocates an acl as well as a default acl.  Fix by releasing acls
that differ from the acl originally passed into nfs3_set_acl.

Fixes: 272e101513c4 ("[PATCH] NFS: Add support for NFSv3 ACLs")
Reported-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs3acl.c