diff options
| author | Abdifatah Suruur <suruurism@gmail.com> | 2026-10-22 06:53:14 +0300 |
|---|---|---|
| committer | Paulo Alcantara <pc@manguebit.org> | 2026-10-23 12:26:02 -0300 |
| commit | 4d8930afa3446041358a7db33e7b23a0bb9459b5 (patch) | |
| tree | 5240063f9b772895cd8019a580871beb071ab48c /tools/perf/scripts/python | |
| parent | 73cc469b0ff7551f8537ea919709973e6dc4f514 (diff) | |
| download | linux-4d8930afa3446041358a7db33e7b23a0bb9459b5.tar.gz linux-4d8930afa3446041358a7db33e7b23a0bb9459b5.zip | |
smb: client: reject short SESSION_SETUP responses
smb2_check_message() accepts frames shorter than struct smb2_pdu when
the SMB2 status is non-zero, before the minimum-PDU check added by
b4694f269e66d. A 64-byte STATUS_MORE_PROCESSING_REQUIRED SESSION_SETUP
response is therefore accepted even though it cannot contain the
SecurityBufferOffset and SecurityBufferLength fields.
The parser then reads those fields from stale bytes left in the reused
receive buffer by an earlier frame. With a long stale
SecurityBufferLength, decode_ntlmssp_challenge() copies up to about
64 KB from beyond the receive object and sends the data back to the
server in the NTLMv2 AUTHENTICATE target info.
Reject short MPR SESSION_SETUP responses before the short-error path,
and validate SecurityBufferOffset + SecurityBufferLength against the
received response length before decoding the challenge.
The ordering bypass is not new: the short-error early return predates
b4694f269e66d, and the unvalidated SecurityBufferLength read predates
the 2016 raw NTLMSSP split in 166cea4dc3a4, so all supported stable
trees are affected. Reproduced on 6.6.87.2; the path is unchanged on
mainline.
Fixes: 5478f9ba9a34 ("CIFS: Add session setup/logoff capability for SMB2")
Cc: stable@vger.kernel.org
Signed-off-by: Abdifatah Suruur <suruurism@gmail.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
