ksmbd: handle smb2 query dir request for OutputBufferLength that is too small
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 16 May 2022 07:22:09 +0000 (16:22 +0900)
committerSteve French <stfrench@microsoft.com>
Sat, 21 May 2022 20:01:43 +0000 (15:01 -0500)
commit65ca7a3ffff811d6c0d4342d467c381257d566d4
tree1e446633a13fa02978e52132d0eefacaa89088ec
parentee1b0558965909872775183dc237cdf9f8eddaba
ksmbd: handle smb2 query dir request for OutputBufferLength that is too small

We found the issue that ksmbd return STATUS_NO_MORE_FILES response
even though there are still dentries that needs to be read while
file read/write test using framtest utils.
windows client send smb2 query dir request included
OutputBufferLength(128) that is too small to contain even one entry.
This patch make ksmbd immediately returns OutputBufferLength of response
as zero to client.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/ksmbd/smb2pdu.c