]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
ksmbd: fix outstanding credits related bugs
authorHyunchul Lee <hyc.lee@gmail.com>
Fri, 20 May 2022 05:35:47 +0000 (14:35 +0900)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:25:24 +0000 (09:25 +0200)
commitc5c27f50c525d40db5cf9cfd48d312a2383943fb
treee1b5ae7b69dbf34f8f78ca3bfdffe7ac59835673
parent1ac6f54bc9c1e6209307c2f91eef6f775d53bf9b
ksmbd: fix outstanding credits related bugs

BugLink: https://bugs.launchpad.net/bugs/1981864
commit 376b9133826865568167b4091ef92a68c4622b87 upstream.

outstanding credits must be initialized to 0,
because it means the sum of credits consumed by
in-flight requests.
And outstanding credits must be compared with
total credits in smb2_validate_credit_charge(),
because total credits are the sum of credits
granted by ksmbd.

This patch fix the following error,
while frametest with Windows clients:

Limits exceeding the maximum allowable outstanding requests,
given : 128, pending : 8065

Fixes: b589f5db6d4a ("ksmbd: limits exceeding the maximum allowable outstanding requests")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Reported-by: Yufan Chen <wiz.chen@gmail.com>
Tested-by: Yufan Chen <wiz.chen@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/ksmbd/connection.c
fs/ksmbd/smb2misc.c
fs/ksmbd/smb_common.c