Skip to content

Commit 5efb579

Browse files
Marios Makassikissmfrench
authored andcommitted
smb: server: stop sending fake security descriptors
in smb2_get_info_sec, a dummy security descriptor (SD) is returned if the requested information is not supported. the code is currently wrong, as DACL_PROTECTED is set in the type field, but there is no DACL is present. instead of faking a security, report a STATUS_NOT_SUPPORTED error. this seems to fix a "Error 0x80090006: Invalid Signature" on file transfers with Windows 11 clients (25H2, build 26200.8246). capturing traffic shows that the client is sending a GET_INFO/SEC_INFO request, with the additional_info field set to 0x20 (ATTRIBUTE_SECURITY_INFORMATION). Returning an empty SD (with only SELF_RELATIVE set) does not fix the error. Signed-off-by: Marios Makassikis <[email protected]> Acked-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent b0da97c commit 5efb579

1 file changed

Lines changed: 2 additions & 15 deletions

File tree

fs/smb/server/smb2pdu.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5746,20 +5746,8 @@ static int smb2_get_info_sec(struct ksmbd_work *work,
57465746
ksmbd_debug(SMB, "Unsupported addition info: 0x%x)\n",
57475747
addition_info);
57485748

5749-
pntsd = kzalloc(ALIGN(sizeof(struct smb_ntsd), 8),
5750-
KSMBD_DEFAULT_GFP);
5751-
if (!pntsd)
5752-
return -ENOMEM;
5753-
5754-
pntsd->revision = cpu_to_le16(1);
5755-
pntsd->type = cpu_to_le16(SELF_RELATIVE | DACL_PROTECTED);
5756-
pntsd->osidoffset = 0;
5757-
pntsd->gsidoffset = 0;
5758-
pntsd->sacloffset = 0;
5759-
pntsd->dacloffset = 0;
5760-
5761-
secdesclen = sizeof(struct smb_ntsd);
5762-
goto iov_pin;
5749+
rsp->hdr.Status = STATUS_NOT_SUPPORTED;
5750+
return -EINVAL;
57635751
}
57645752

57655753
if (work->next_smb2_rcv_hdr_off) {
@@ -5826,7 +5814,6 @@ static int smb2_get_info_sec(struct ksmbd_work *work,
58265814
if (rc)
58275815
goto err_out;
58285816

5829-
iov_pin:
58305817
rsp->OutputBufferLength = cpu_to_le32(secdesclen);
58315818
rc = buffer_check_err(le32_to_cpu(req->OutputBufferLength),
58325819
rsp, work->response_buf);

0 commit comments

Comments
 (0)