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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Oct 2022 08:12:57 +0000 (10:12 +0200)
commit3c8cfcaa2d9a2424005261bbcb5283831c38a05a
tree8b51cf485cd11c9adc37ed8c7e907973d7b6ad1e
parent8754fa5dbc6ef47ca81c2493a157a4dcfe2d6069
ksmbd: handle smb2 query dir request for OutputBufferLength that is too small

[ Upstream commit 65ca7a3ffff811d6c0d4342d467c381257d566d4 ]

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>
Stable-dep-of: 88541cb414b7 ("ksmbd: fix incorrect handling of iterate_dir")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ksmbd/smb2pdu.c