ksmbd: fix credit count leakage
authorNamjae Jeon <linkinjeon@kernel.org>
Fri, 12 May 2023 14:29:12 +0000 (23:29 +0900)
committerSteve French <stfrench@microsoft.com>
Sat, 27 May 2023 01:27:46 +0000 (20:27 -0500)
commit84c5aa47925a1f40d698b6a6a2bf67e99617433d
tree638999f4ab2e1c7597566d0605f7bd2875e5cbb6
parentdf14afeed2e6c1bbadef7d2f9c46887bbd6d8d94
ksmbd: fix credit count leakage

This patch fix the failure from smb2.credits.single_req_credits_granted
test. When client send 8192 credit request, ksmbd return 8191 credit
granted. ksmbd should give maximum possible credits that must be granted
within the range of not exceeding the max credit to client.

Cc: stable@vger.kernel.org
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/smb2pdu.c