]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Aug 2023 14:23:09 +0000 (16:23 +0200)
commit8a64aadc29ba0df0ad926f32d3c8d4cddf7184e9
tree7bd17930798497f8e71ad4a5d5303b96b780285b
parentc6aecc29d29eeda6b963f1a5ea0adae2e9fd7c3d
NFSv4: fix out path in __nfs4_get_acl_uncached

[ Upstream commit f4e89f1a6dab4c063fc1e823cc9dddc408ff40cf ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs4proc.c