Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ksmbd: remove redundant DACL check in smb_check_perm_dacl

A zero value of pdacl->num_aces is already handled at the start of
smb_check_perm_dacl() so the second check is useless.

Drop the unreachable code block, no functional impact intended.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Alexey Velichayshiy <a.velichayshiy@ispras.ru>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

Alexey Velichayshiy and committed by
Steve French
8dd2e58b 0446356e

-3
-3
fs/smb/server/smbacl.c
··· 1307 1307 granted |= le32_to_cpu(ace->access_req); 1308 1308 ace = (struct smb_ace *)((char *)ace + le16_to_cpu(ace->size)); 1309 1309 } 1310 - 1311 - if (!pdacl->num_aces) 1312 - granted = GENERIC_ALL_FLAGS; 1313 1310 } 1314 1311 1315 1312 if (!uid)