]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ksmbd: remove redundant DACL check in smb_check_perm_dacl
authorAlexey Velichayshiy <a.velichayshiy@ispras.ru>
Wed, 10 Dec 2025 13:51:33 +0000 (16:51 +0300)
committerSteve French <stfrench@microsoft.com>
Mon, 15 Dec 2025 00:35:56 +0000 (18:35 -0600)
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>
fs/smb/server/smbacl.c

index 5aa7a66334d93d4002800a198982463a825dff07..05598d994a686624fc00f8f60165082661ba5d3f 100644 (file)
@@ -1307,9 +1307,6 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
                        granted |= le32_to_cpu(ace->access_req);
                        ace = (struct smb_ace *)((char *)ace + le16_to_cpu(ace->size));
                }
-
-               if (!pdacl->num_aces)
-                       granted = GENERIC_ALL_FLAGS;
        }
 
        if (!uid)