Skip to content

Commit 76025cc

Browse files
Paulo Alcantarasmfrench
authored andcommitted
smb: client: fix parsing of SMB3.1.1 POSIX create context
The data offset for the SMB3.1.1 POSIX create context will always be 8-byte aligned so having the check 'noff + nlen >= doff' in smb2_parse_contexts() is wrong as it will lead to -EINVAL because noff + nlen == doff. Fix the sanity check to correctly handle aligned create context data. Fixes: af1689a ("smb: client: fix potential OOBs in smb2_parse_contexts()") Signed-off-by: Paulo Alcantara <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent cfb7a13 commit 76025cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/client/smb2pdu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2277,7 +2277,7 @@ int smb2_parse_contexts(struct TCP_Server_Info *server,
22772277

22782278
noff = le16_to_cpu(cc->NameOffset);
22792279
nlen = le16_to_cpu(cc->NameLength);
2280-
if (noff + nlen >= doff)
2280+
if (noff + nlen > doff)
22812281
return -EINVAL;
22822282

22832283
name = (char *)cc + noff;

0 commit comments

Comments
 (0)