]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 May 2020 17:15:52 +0000 (19:15 +0200)
commit4d6df332cf7c19118f3aafee8c7aa55a8feeac8e
treef792413e648c2c69194348f90bb3053825c0aaa6
parentdc4a3585daefe9b188bfc467d27d10477f45d670
nfs: Fix potential posix_acl refcnt leak in nfs3_set_acl

commit 7648f939cb919b9d15c21fff8cd9eba908d595dc upstream.

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: b7fa0554cf1b ("[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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs3acl.c