All of lore.kernel.org
 help / color / mirror / Atom feed
From: Atul Gupta <atul.gupta@chelsio.com>
To: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org
Cc: gustavo@embeddedor.com, dan.carpenter@oracle.com,
	netdev@vger.kernel.org, davem@davemloft.net,
	atul.gupta@chelsio.com
Subject: [PATCH 3/5] crypto: chtls: dereference null variable
Date: Mon, 14 May 2018 16:30:57 +0530	[thread overview]
Message-ID: <1526295659-29839-4-git-send-email-atul.gupta@chelsio.com> (raw)
In-Reply-To: <1526295659-29839-1-git-send-email-atul.gupta@chelsio.com>

skb dereferenced before check in sendpage

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
---
 drivers/crypto/chelsio/chtls/chtls_io.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c b/drivers/crypto/chelsio/chtls/chtls_io.c
index a4c7d2d..85ddc07 100644
--- a/drivers/crypto/chelsio/chtls/chtls_io.c
+++ b/drivers/crypto/chelsio/chtls/chtls_io.c
@@ -1230,9 +1230,8 @@ int chtls_sendpage(struct sock *sk, struct page *page,
 		struct sk_buff *skb = skb_peek_tail(&csk->txq);
 		int copy, i;
 
-		copy = mss - skb->len;
 		if (!skb || (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND) ||
-		    copy <= 0) {
+		    (copy = mss - skb->len) <= 0) {
 new_buf:
 			if (!csk_mem_free(cdev, sk))
 				goto wait_for_sndbuf;
-- 
1.8.3.1

  parent reply	other threads:[~2018-05-14 11:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 11:00 [PATCH 0/5] build warnings cleanup Atul Gupta
2018-05-14 11:00 ` [PATCH 1/5] crypto:chtls: key len correction Atul Gupta
2018-05-14 11:00 ` [PATCH 2/5] crypto: chtls: wait for memory sendmsg, sendpage Atul Gupta
2018-05-14 11:29   ` Dan Carpenter
2018-05-14 14:04   ` kbuild test robot
2018-05-14 11:00 ` Atul Gupta [this message]
2018-05-14 11:00 ` [PATCH 4/5] crypto: chtls: kbuild warnings Atul Gupta
2018-05-14 11:00 ` [PATCH 5/5] crypto: chtls: free beyond end rspq_skb_cache Atul Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1526295659-29839-4-git-send-email-atul.gupta@chelsio.com \
    --to=atul.gupta@chelsio.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=gustavo@embeddedor.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.