mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
smb: client: harden POSIX SID length parsing
posix_info_sid_size() reads sid[1] to obtain the subauthority count,
but its existing boundary check still accepts buffers with only one
remaining byte. Require two bytes before reading sid[1] so all client
paths that reuse the helper reject truncated POSIX SIDs safely.
Fixes: 349e13ad30 ("cifs: add smb2 POSIX info level")
Cc: stable@vger.kernel.org
Reported-by: Yuan Tan <yuantan098@gmail.com>
Reported-by: Yifan Wu <yifanwucs@gmail.com>
Reported-by: Juefei Pu <tomapufckgml@gmail.com>
Reported-by: Xin Liu <bird@lzu.edu.cn>
Assisted-by: Codex:gpt-5.4
Signed-off-by: Zihan Xi <xizh2024@lzu.edu.cn>
Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
dc59e4fea9
commit
7ad2bcf244
|
|
@ -5405,7 +5405,7 @@ int posix_info_sid_size(const void *beg, const void *end)
|
|||
size_t subauth;
|
||||
int total;
|
||||
|
||||
if (beg + 1 > end)
|
||||
if (beg + 2 > end)
|
||||
return -1;
|
||||
|
||||
subauth = *(u8 *)(beg+1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user