linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.20 62/77] cifs: fix memory leak of an allocated cifs_ntsd structure
       [not found] <20190215020855.176727-1-sashal@kernel.org>
@ 2019-02-15  2:08 ` Sasha Levin
  2019-02-15  2:08 ` [PATCH AUTOSEL 4.20 65/77] CIFS: Do not assume one credit for async responses Sasha Levin
  2019-02-15  2:08 ` [PATCH AUTOSEL 4.20 66/77] CIFS: Fix mounts if the client is low on credits Sasha Levin
  2 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2019-02-15  2:08 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Colin Ian King, Steve French, Sasha Levin, linux-cifs

From: Colin Ian King <colin.king@canonical.com>

[ Upstream commit 73aaf920cc72024c4a4460cfa46d56e5014172f3 ]

The call to SMB2_queary_acl can allocate memory to pntsd and also
return a failure via a call to SMB2_query_acl (and then query_info).
This occurs when query_info allocates the structure and then in
query_info the call to smb2_validate_and_copy_iov fails. Currently the
failure just returns without kfree'ing pntsd hence causing a memory
leak.

Currently, *data is allocated if it's not already pointing to a buffer,
so it needs to be kfree'd only if was allocated in query_info, so the
fix adds an allocated flag to track this.  Also set *dlen to zero on
an error just to be safe since *data is kfree'd.

Also set errno to -ENOMEM if the allocation of *data fails.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Dan Carpener <dan.carpenter@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/cifs/smb2pdu.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index c393ac255af7..d1ae7cdb236d 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2714,6 +2714,7 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon,
 	int resp_buftype = CIFS_NO_BUFFER;
 	struct cifs_ses *ses = tcon->ses;
 	int flags = 0;
+	bool allocated = false;
 
 	cifs_dbg(FYI, "Query Info\n");
 
@@ -2753,14 +2754,21 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon,
 					"Error %d allocating memory for acl\n",
 					rc);
 				*dlen = 0;
+				rc = -ENOMEM;
 				goto qinf_exit;
 			}
+			allocated = true;
 		}
 	}
 
 	rc = smb2_validate_and_copy_iov(le16_to_cpu(rsp->OutputBufferOffset),
 					le32_to_cpu(rsp->OutputBufferLength),
 					&rsp_iov, min_len, *data);
+	if (rc && allocated) {
+		kfree(*data);
+		*data = NULL;
+		*dlen = 0;
+	}
 
 qinf_exit:
 	SMB2_query_info_free(&rqst);
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH AUTOSEL 4.20 65/77] CIFS: Do not assume one credit for async responses
       [not found] <20190215020855.176727-1-sashal@kernel.org>
  2019-02-15  2:08 ` [PATCH AUTOSEL 4.20 62/77] cifs: fix memory leak of an allocated cifs_ntsd structure Sasha Levin
@ 2019-02-15  2:08 ` Sasha Levin
  2019-02-15 20:10   ` Pavel Shilovskiy
  2019-02-15  2:08 ` [PATCH AUTOSEL 4.20 66/77] CIFS: Fix mounts if the client is low on credits Sasha Levin
  2 siblings, 1 reply; 6+ messages in thread
From: Sasha Levin @ 2019-02-15  2:08 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Pavel Shilovsky, Steve French, Sasha Levin, linux-cifs

From: Pavel Shilovsky <pshilov@microsoft.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@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH AUTOSEL 4.20 66/77] CIFS: Fix mounts if the client is low on credits
       [not found] <20190215020855.176727-1-sashal@kernel.org>
  2019-02-15  2:08 ` [PATCH AUTOSEL 4.20 62/77] cifs: fix memory leak of an allocated cifs_ntsd structure Sasha Levin
  2019-02-15  2:08 ` [PATCH AUTOSEL 4.20 65/77] CIFS: Do not assume one credit for async responses Sasha Levin
@ 2019-02-15  2:08 ` Sasha Levin
  2 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2019-02-15  2:08 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Pavel Shilovsky, Steve French, Sasha Levin, linux-cifs

From: Pavel Shilovsky <pshilov@microsoft.com>

[ Upstream commit 6a9cbdd1ceca1dc2359ddf082efe61b97c3e752b ]

If the server doesn't grant us at least 3 credits during the mount
we won't be able to complete it because query path info operation
requires 3 credits. Use the cached file handle if possible to allow
the mount to succeed.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/cifs/smb2inode.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
index a8999f930b22..057d2034209f 100644
--- a/fs/cifs/smb2inode.c
+++ b/fs/cifs/smb2inode.c
@@ -294,6 +294,8 @@ smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,
 	int rc;
 	struct smb2_file_all_info *smb2_data;
 	__u32 create_options = 0;
+	struct cifs_fid fid;
+	bool no_cached_open = tcon->nohandlecache;
 
 	*adjust_tz = false;
 	*symlink = false;
@@ -302,6 +304,21 @@ smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,
 			    GFP_KERNEL);
 	if (smb2_data == NULL)
 		return -ENOMEM;
+
+	/* If it is a root and its handle is cached then use it */
+	if (!strlen(full_path) && !no_cached_open) {
+		rc = open_shroot(xid, tcon, &fid);
+		if (rc)
+			goto out;
+		rc = SMB2_query_info(xid, tcon, fid.persistent_fid,
+				     fid.volatile_fid, smb2_data);
+		close_shroot(&tcon->crfid);
+		if (rc)
+			goto out;
+		move_smb2_info_to_cifs(data, smb2_data);
+		goto out;
+	}
+
 	if (backup_cred(cifs_sb))
 		create_options |= CREATE_OPEN_BACKUP_INTENT;
 
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [PATCH AUTOSEL 4.20 65/77] CIFS: Do not assume one credit for async responses
  2019-02-15  2:08 ` [PATCH AUTOSEL 4.20 65/77] CIFS: Do not assume one credit for async responses Sasha Levin
@ 2019-02-15 20:10   ` Pavel Shilovskiy
  2019-02-27 17:54     ` Sasha Levin
  0 siblings, 1 reply; 6+ messages in thread
From: Pavel Shilovskiy @ 2019-02-15 20:10 UTC (permalink / raw)
  To: Sasha Levin, linux-kernel, stable; +Cc: Steven French, linux-cifs

чт, 14 февр. 2019 г. в 18:40, Sasha Levin <sashal@kernel.org>:
>
> From: Pavel Shilovsky <pshilov@microsoft.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@microsoft.com>
> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
> Signed-off-by: Steve French <stfrench@microsoft.com>
> Signed-off-by: Sasha Levin <sashal@kernel.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/

Best regards,
Pavel Shilovsky


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH AUTOSEL 4.20 65/77] CIFS: Do not assume one credit for async responses
  2019-02-15 20:10   ` Pavel Shilovskiy
@ 2019-02-27 17:54     ` Sasha Levin
  2019-02-27 19:39       ` Pavel Shilovsky
  0 siblings, 1 reply; 6+ messages in thread
From: Sasha Levin @ 2019-02-27 17:54 UTC (permalink / raw)
  To: Pavel Shilovskiy; +Cc: linux-kernel, stable, Steven French, linux-cifs

On Fri, Feb 15, 2019 at 08:10:47PM +0000, Pavel Shilovskiy wrote:
>чт, 14 февр. 2019 г. в 18:40, Sasha Levin <sashal@kernel.org>:
>>
>> From: Pavel Shilovsky <pshilov@microsoft.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@microsoft.com>
>> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
>> Signed-off-by: Steve French <stfrench@microsoft.com>
>> Signed-off-by: Sasha Levin <sashal@kernel.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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH AUTOSEL 4.20 65/77] CIFS: Do not assume one credit for async responses
  2019-02-27 17:54     ` Sasha Levin
@ 2019-02-27 19:39       ` Pavel Shilovsky
  0 siblings, 0 replies; 6+ messages in thread
From: Pavel Shilovsky @ 2019-02-27 19:39 UTC (permalink / raw)
  To: Sasha Levin
  Cc: Pavel Shilovskiy, linux-kernel, stable, Steven French, linux-cifs

ср, 27 февр. 2019 г. в 09:54, Sasha Levin <sashal@kernel.org>:
>
> On Fri, Feb 15, 2019 at 08:10:47PM +0000, Pavel Shilovskiy wrote:
> >чт, 14 февр. 2019 г. в 18:40, Sasha Levin <sashal@kernel.org>:
> >>
> >> From: Pavel Shilovsky <pshilov@microsoft.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@microsoft.com>
> >> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
> >> Signed-off-by: Steve French <stfrench@microsoft.com>
> >> Signed-off-by: Sasha Levin <sashal@kernel.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!

It seems that this one has already been merged to 4.20.11:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.20.y&id=7cb453e5a88169b2a5cec1e00778fc969efd1a77

So, between those two stable kernels only 4.19 doesn't have the patch.

--
Best regards,
Pavel Shilovsky

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-02-27 19:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190215020855.176727-1-sashal@kernel.org>
2019-02-15  2:08 ` [PATCH AUTOSEL 4.20 62/77] cifs: fix memory leak of an allocated cifs_ntsd structure Sasha Levin
2019-02-15  2:08 ` [PATCH AUTOSEL 4.20 65/77] CIFS: Do not assume one credit for async responses Sasha Levin
2019-02-15 20:10   ` Pavel Shilovskiy
2019-02-27 17:54     ` Sasha Levin
2019-02-27 19:39       ` Pavel Shilovsky
2019-02-15  2:08 ` [PATCH AUTOSEL 4.20 66/77] CIFS: Fix mounts if the client is low on credits Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).