Skip to content

Commit df64ab2

Browse files
Marios Makassikisnamjaejeon
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 <mmakassikis@freebox.fr> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
1 parent a4dfaff commit df64ab2

1 file changed

Lines changed: 2 additions & 17 deletions

File tree

smb2pdu.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6002,23 +6002,8 @@ static int smb2_get_info_sec(struct ksmbd_work *work,
60026002
ksmbd_debug(SMB, "Unsupported addition info: 0x%x)\n",
60036003
addition_info);
60046004

6005-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 0, 0)
6006-
pntsd = kmalloc_obj(struct smb_ntsd, KSMBD_DEFAULT_GFP);
6007-
#else
6008-
pntsd = kmalloc(sizeof(struct smb_ntsd), KSMBD_DEFAULT_GFP);
6009-
#endif
6010-
if (!pntsd)
6011-
return -ENOMEM;
6012-
6013-
pntsd->revision = cpu_to_le16(1);
6014-
pntsd->type = cpu_to_le16(SELF_RELATIVE | DACL_PROTECTED);
6015-
pntsd->osidoffset = 0;
6016-
pntsd->gsidoffset = 0;
6017-
pntsd->sacloffset = 0;
6018-
pntsd->dacloffset = 0;
6019-
6020-
secdesclen = sizeof(struct smb_ntsd);
6021-
goto iov_pin;
6005+
rsp->hdr.Status = STATUS_NOT_SUPPORTED;
6006+
return -EINVAL;
60226007
}
60236008

60246009
if (work->next_smb2_rcv_hdr_off) {

0 commit comments

Comments
 (0)