public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Atul Gupta <atul.gupta@chelsio.com>
Cc: davejwatson@fb.com, davem@davemloft.net,
	herbert@gondor.apana.org.au, sd@queasysnail.net,
	sbrivio@redhat.com, linux-crypto@vger.kernel.org,
	netdev@vger.kernel.org, ganeshgr@chelsio.com, sd@queasysnail.net,
	sbrivio@redhat.com, linux-crypto@vger.kernel.org,
	netdev@vger.kernel.org, ganeshgr@chelsio.com, kbuild-all@01.org
Subject: Re: [PATCH v11 crypto 01/12] tls: support for Inline tls record (fwd)
Date: Sun, 18 Mar 2018 17:01:34 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1803181700230.2420@hadrien> (raw)


ctx is dereferenced on line 258 but has been freed on line 229.

julia

---------- Forwarded message ----------
Date: Sun, 18 Mar 2018 18:05:25 +0800
From: kbuild test robot <fengguang.wu@intel.com>
To: kbuild@01.org
Cc: Julia Lawall <julia.lawall@lip6.fr>
Subject: Re: [PATCH v11 crypto 01/12] tls: support for Inline tls record

CC: kbuild-all@01.org
In-Reply-To: <1521214661-28928-1-git-send-email-atul.gupta@chelsio.com>
References: <1521214661-28928-1-git-send-email-atul.gupta@chelsio.com>
TO: Atul Gupta <atul.gupta@chelsio.com>
CC: davejwatson@fb.com, davem@davemloft.net, herbert@gondor.apana.org.au, sd@queasysnail.net, sbrivio@redhat.com, linux-crypto@vger.kernel.org, netdev@vger.kernel.org, ganeshgr@chelsio.com
CC: sd@queasysnail.net, sbrivio@redhat.com, linux-crypto@vger.kernel.org, netdev@vger.kernel.org, ganeshgr@chelsio.com

Hi Atul,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on v4.16-rc4]
[cannot apply to next-20180316]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Atul-Gupta/tls-support-for-Inline-tls-record/20180318-162840
:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago

>> net/tls/tls_main.c:258:5-8: ERROR: reference preceded by free on line 229

# https://github.com/0day-ci/linux/commit/be47378786b9d9874dfc3ab57504565275c7b3ff
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout be47378786b9d9874dfc3ab57504565275c7b3ff
vim +258 net/tls/tls_main.c

3c4d75591 Dave Watson   2017-06-14  218
3c4d75591 Dave Watson   2017-06-14  219  static void tls_sk_proto_close(struct sock *sk, long timeout)
3c4d75591 Dave Watson   2017-06-14  220  {
3c4d75591 Dave Watson   2017-06-14  221  	struct tls_context *ctx = tls_get_ctx(sk);
3c4d75591 Dave Watson   2017-06-14  222  	long timeo = sock_sndtimeo(sk, 0);
3c4d75591 Dave Watson   2017-06-14  223  	void (*sk_proto_close)(struct sock *sk, long timeout);
3c4d75591 Dave Watson   2017-06-14  224
3c4d75591 Dave Watson   2017-06-14  225  	lock_sock(sk);
ff45d820a Ilya Lesokhin 2017-11-13  226  	sk_proto_close = ctx->sk_proto_close;
ff45d820a Ilya Lesokhin 2017-11-13  227
ff45d820a Ilya Lesokhin 2017-11-13  228  	if (ctx->tx_conf == TLS_BASE_TX) {
ff45d820a Ilya Lesokhin 2017-11-13 @229  		kfree(ctx);
ff45d820a Ilya Lesokhin 2017-11-13  230  		goto skip_tx_cleanup;
ff45d820a Ilya Lesokhin 2017-11-13  231  	}
3c4d75591 Dave Watson   2017-06-14  232
3c4d75591 Dave Watson   2017-06-14  233  	if (!tls_complete_pending_work(sk, ctx, 0, &timeo))
3c4d75591 Dave Watson   2017-06-14  234  		tls_handle_open_record(sk, 0);
3c4d75591 Dave Watson   2017-06-14  235
3c4d75591 Dave Watson   2017-06-14  236  	if (ctx->partially_sent_record) {
3c4d75591 Dave Watson   2017-06-14  237  		struct scatterlist *sg = ctx->partially_sent_record;
3c4d75591 Dave Watson   2017-06-14  238
3c4d75591 Dave Watson   2017-06-14  239  		while (1) {
3c4d75591 Dave Watson   2017-06-14  240  			put_page(sg_page(sg));
3c4d75591 Dave Watson   2017-06-14  241  			sk_mem_uncharge(sk, sg->length);
3c4d75591 Dave Watson   2017-06-14  242
3c4d75591 Dave Watson   2017-06-14  243  			if (sg_is_last(sg))
3c4d75591 Dave Watson   2017-06-14  244  				break;
3c4d75591 Dave Watson   2017-06-14  245  			sg++;
3c4d75591 Dave Watson   2017-06-14  246  		}
3c4d75591 Dave Watson   2017-06-14  247  	}
ff45d820a Ilya Lesokhin 2017-11-13  248
3c4d75591 Dave Watson   2017-06-14  249  	kfree(ctx->rec_seq);
3c4d75591 Dave Watson   2017-06-14  250  	kfree(ctx->iv);
3c4d75591 Dave Watson   2017-06-14  251
ff45d820a Ilya Lesokhin 2017-11-13  252  	if (ctx->tx_conf == TLS_SW_TX)
ff45d820a Ilya Lesokhin 2017-11-13  253  		tls_sw_free_tx_resources(sk);
3c4d75591 Dave Watson   2017-06-14  254
ff45d820a Ilya Lesokhin 2017-11-13  255  skip_tx_cleanup:
3c4d75591 Dave Watson   2017-06-14  256  	release_sock(sk);
3c4d75591 Dave Watson   2017-06-14  257  	sk_proto_close(sk, timeout);
be4737878 Atul Gupta    2018-03-16 @258  	if (ctx->tx_conf == TLS_HW_RECORD)
be4737878 Atul Gupta    2018-03-16  259  		kfree(ctx);
3c4d75591 Dave Watson   2017-06-14  260  }
3c4d75591 Dave Watson   2017-06-14  261

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

                 reply	other threads:[~2018-03-18 16:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=alpine.DEB.2.20.1803181700230.2420@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=atul.gupta@chelsio.com \
    --cc=davejwatson@fb.com \
    --cc=davem@davemloft.net \
    --cc=ganeshgr@chelsio.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kbuild-all@01.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sbrivio@redhat.com \
    --cc=sd@queasysnail.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox