lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190227175406.GM10616@sasha-vm>
Date:   Wed, 27 Feb 2019 12:54:06 -0500
From:   Sasha Levin <sashal@...nel.org>
To:     Pavel Shilovskiy <pshilov@...rosoft.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>,
        Steven French <Steven.French@...rosoft.com>,
        "linux-cifs@...r.kernel.org" <linux-cifs@...r.kernel.org>
Subject: Re: [PATCH AUTOSEL 4.20 65/77] CIFS: Do not assume one credit for
 async responses

On Fri, Feb 15, 2019 at 08:10:47PM +0000, Pavel Shilovskiy wrote:
>чт, 14 февр. 2019 г. в 18:40, Sasha Levin <sashal@...nel.org>:
>>
>> From: Pavel Shilovsky <pshilov@...rosoft.com>
>>
>> [ Upstream commit 0fd1d37b0501efc6e295f56ab55cdaff784aa50c ]
>>
>> If we don't receive a response we can't assume that the server
>> granted one credit. Assume zero credits in such cases.
>>
>> Signed-off-by: Pavel Shilovsky <pshilov@...rosoft.com>
>> Reviewed-by: Ronnie Sahlberg <lsahlber@...hat.com>
>> Signed-off-by: Steve French <stfrench@...rosoft.com>
>> Signed-off-by: Sasha Levin <sashal@...nel.org>
>> ---
>>  fs/cifs/smb2pdu.c | 15 +++++++++++----
>>  1 file changed, 11 insertions(+), 4 deletions(-)
>>
>> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
>> index d1ae7cdb236d..3c44c51310c4 100644
>> --- a/fs/cifs/smb2pdu.c
>> +++ b/fs/cifs/smb2pdu.c
>> @@ -2834,9 +2834,10 @@ smb2_echo_callback(struct mid_q_entry *mid)
>>  {
>>         struct TCP_Server_Info *server = mid->callback_data;
>>         struct smb2_echo_rsp *rsp = (struct smb2_echo_rsp *)mid->resp_buf;
>> -       unsigned int credits_received = 1;
>> +       unsigned int credits_received = 0;
>>
>> -       if (mid->mid_state == MID_RESPONSE_RECEIVED)
>> +       if (mid->mid_state == MID_RESPONSE_RECEIVED
>> +           || mid->mid_state == MID_RESPONSE_MALFORMED)
>>                 credits_received = le16_to_cpu(rsp->sync_hdr.CreditRequest);
>>
>>         DeleteMidQEntry(mid);
>> @@ -3093,7 +3094,7 @@ smb2_readv_callback(struct mid_q_entry *mid)
>>         struct TCP_Server_Info *server = tcon->ses->server;
>>         struct smb2_sync_hdr *shdr =
>>                                 (struct smb2_sync_hdr *)rdata->iov[0].iov_base;
>> -       unsigned int credits_received = 1;
>> +       unsigned int credits_received = 0;
>>         struct smb_rqst rqst = { .rq_iov = rdata->iov,
>>                                  .rq_nvec = 2,
>>                                  .rq_pages = rdata->pages,
>> @@ -3132,6 +3133,9 @@ smb2_readv_callback(struct mid_q_entry *mid)
>>                 task_io_account_read(rdata->got_bytes);
>>                 cifs_stats_bytes_read(tcon, rdata->got_bytes);
>>                 break;
>> +       case MID_RESPONSE_MALFORMED:
>> +               credits_received = le16_to_cpu(shdr->CreditRequest);
>> +               /* fall through */
>>         default:
>>                 if (rdata->result != -ENODATA)
>>                         rdata->result = -EIO;
>> @@ -3325,7 +3329,7 @@ smb2_writev_callback(struct mid_q_entry *mid)
>>         struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink);
>>         unsigned int written;
>>         struct smb2_write_rsp *rsp = (struct smb2_write_rsp *)mid->resp_buf;
>> -       unsigned int credits_received = 1;
>> +       unsigned int credits_received = 0;
>>
>>         switch (mid->mid_state) {
>>         case MID_RESPONSE_RECEIVED:
>> @@ -3353,6 +3357,9 @@ smb2_writev_callback(struct mid_q_entry *mid)
>>         case MID_RETRY_NEEDED:
>>                 wdata->result = -EAGAIN;
>>                 break;
>> +       case MID_RESPONSE_MALFORMED:
>> +               credits_received = le16_to_cpu(rsp->sync_hdr.CreditRequest);
>> +               /* fall through */
>>         default:
>>                 wdata->result = -EIO;
>>                 break;
>> --
>> 2.19.1
>>
>
>Can you also apply the following patch to 4.20.y and 4.19.y, please?
>
>https://patchwork.ozlabs.org/patch/1030180/

I'll queue it up for the next cycle as it has dependencies on stable@
commits that didn't make it in yet and I don't want to mess up with
Greg's flow. Thanks you!

--
Thanks,
Sasha

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ