mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-09 19:10:45 +00:00
smb3: add credits we receive from oplock/break PDUs
Otherwise we gradually leak credits leading to potential hung session. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> CC: Stable <stable@vger.kernel.org> Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
6a9cbdd1ce
commit
2e5700bdde
@ -648,6 +648,13 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
|
||||
if (rsp->sync_hdr.Command != SMB2_OPLOCK_BREAK)
|
||||
return false;
|
||||
|
||||
if (rsp->sync_hdr.CreditRequest) {
|
||||
spin_lock(&server->req_lock);
|
||||
server->credits += le16_to_cpu(rsp->sync_hdr.CreditRequest);
|
||||
spin_unlock(&server->req_lock);
|
||||
wake_up(&server->request_q);
|
||||
}
|
||||
|
||||
if (rsp->StructureSize !=
|
||||
smb2_rsp_struct_sizes[SMB2_OPLOCK_BREAK_HE]) {
|
||||
if (le16_to_cpu(rsp->StructureSize) == 44)
|
||||
|
Loading…
Reference in New Issue
Block a user