mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-07 01:45:18 +02:00
ksmbd: the buffer of smb2 query dir response has at least 1 byte
commitce61b605a0
upstream. When STATUS_NO_MORE_FILES status is set to smb2 query dir response, ->StructureSize is set to 9, which mean buffer has 1 byte. This issue occurs because ->Buffer[1] in smb2_query_directory_rsp to flex-array. Fixes:eb3e28c1e8
("smb3: Replace smb2pdu 1-element arrays with flex-arrays") Cc: stable@vger.kernel.org # v6.1+ Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
76df3a1970
commit
09982d418a
|
@ -4406,7 +4406,8 @@ int smb2_query_dir(struct ksmbd_work *work)
|
|||
rsp->OutputBufferLength = cpu_to_le32(0);
|
||||
rsp->Buffer[0] = 0;
|
||||
rc = ksmbd_iov_pin_rsp(work, (void *)rsp,
|
||||
sizeof(struct smb2_query_directory_rsp));
|
||||
offsetof(struct smb2_query_directory_rsp, Buffer)
|
||||
+ 1);
|
||||
if (rc)
|
||||
goto err_out;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user