]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: free ppace array on error in parse_dacl
authorFedor Pchelkin <pchelkin@ispras.ru>
Tue, 9 Jan 2024 14:14:44 +0000 (17:14 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Jan 2024 10:50:10 +0000 (11:50 +0100)
commite377a3346f7e9d28d64814ad22a50d18e53942dc
treeaed8aad6708402b10d6add82667480fd09f43b0a
parent09d84f37f8412fbb2bd73447bbecb68310e4b378
ksmbd: free ppace array on error in parse_dacl

commit 8cf9bedfc3c47d24bb0de386f808f925dc52863e upstream.

The ppace array is not freed if one of the init_acl_state() calls inside
parse_dacl() fails. At the moment the function may fail only due to the
memory allocation errors so it's highly unlikely in this case but
nevertheless a fix is needed.

Move ppace allocation after the init_acl_state() calls with proper error
handling.

Found by Linux Verification Center (linuxtesting.org).

Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/server/smbacl.c