[lvc-project] [PATCH] smb: remove redundant DACL check in smb_check_perm_dacl

a.velichayshiy at ispras.ru a.velichayshiy at ispras.ru
Mon Dec 1 21:56:09 MSK 2025


Добрый день, только сейчас заметил, что нумерация строк не та, поэтому 
вот обновлённое описание:
Problem Analysis:
1. Permanently false condition: The check `if (!pdacl->num_aces)` at 
lines 1311-1312 inside the `FILE_MAXIMAL_ACCESS_LE` block can never 
execute because when `pdacl->num_aces == 0`, the function already jumps 
to `err_out` in the earlier DACL validation check at lines 1285-1292.

2. Logical contradiction: The code contains conflicting semantics for 
empty DACL handling:
    - First check (lines 1285-1292): Empty DACL → access denied → goto 
err_out
    - Second check (lines 1311-1312): Empty DACL → grant 
GENERIC_ALL_FLAGS
    This creates unreachable code and semantic inconsistency.

Solution:
Remove the unreachable code block as the most concise solution with no 
functional impact.



More information about the lvc-project mailing list