NFSv4: fix out path in __nfs4_get_acl_uncached
authorFedor Pchelkin <pchelkin@ispras.ru>
Tue, 25 Jul 2023 11:59:30 +0000 (14:59 +0300)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 19 Aug 2023 14:26:29 +0000 (10:26 -0400)
commitf4e89f1a6dab4c063fc1e823cc9dddc408ff40cf
tree3b21acfddd5a02c4eb60cd0eb63f9b7bfa38ce54
parent4e3733fd2b0f677faae21cf838a43faf317986d3
NFSv4: fix out path in __nfs4_get_acl_uncached

Another highly rare error case when a page allocating loop (inside
__nfs4_get_acl_uncached, this time) is not properly unwound on error.
Since pages array is allocated being uninitialized, need to free only
lower array indices. NULL checks were useful before commit 62a1573fcf84
("NFSv4 fix acl retrieval over krb5i/krb5p mounts") when the array had
been initialized to zero on stack.

Found by Linux Verification Center (linuxtesting.org).

Fixes: 62a1573fcf84 ("NFSv4 fix acl retrieval over krb5i/krb5p mounts")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs4proc.c