All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sabrina Dubroca <sd@queasysnail.net>
To: Chuck Lever <cel@kernel.org>
Cc: john.fastabend@gmail.com, kuba@kernel.org,
	netdev@vger.kernel.org, kernel-tls-handshake@lists.linux.dev,
	Chuck Lever <chuck.lever@oracle.com>,
	Hannes Reinecke <hare@suse.de>,
	Alistair Francis <alistair.francis@wdc.com>
Subject: Re: [PATCH net-next v7 2/5] tls: Fix dangling skb pointer in tls_sw_read_sock()
Date: Mon, 30 Mar 2026 14:17:07 +0200	[thread overview]
Message-ID: <acppwzU7-TgWbd5f@krikkit> (raw)
In-Reply-To: <20260328-tls-read-sock-v7-2-15678415dfc1@oracle.com>

2026-03-28, 11:17:09 -0400, Chuck Lever wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
> 
> Per ISO/IEC 9899:2011 section 6.2.4p2, a pointer value becomes
> indeterminate when the object it points to reaches the end of its
> lifetime; Annex J.2 classifies the use of such a value as undefined
> behavior. In tls_sw_read_sock(), consume_skb(skb) in the
> fully-consumed path frees the skb, but the "do { } while (skb)"
> loop condition then evaluates that freed pointer. Although the
> value is never dereferenced -- the loop either continues and
> overwrites skb, or exits -- any future change that adds a
> dereference between consume_skb() and the loop condition would
> produce a silent use-after-free.
> 
> Fixes: 662fbcec32f4 ("net/tls: implement ->read_sock()")
> Reviewed-by: Hannes Reinecke <hare@suse.de>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
>  net/tls/tls_sw.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>

-- 
Sabrina

  reply	other threads:[~2026-03-30 12:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-28 15:17 [PATCH net-next v7 0/5] TLS read_sock performance scalability Chuck Lever
2026-03-28 15:17 ` [PATCH net-next v7 1/5] tls: Abort the connection on decrypt failure Chuck Lever
2026-03-28 15:17 ` [PATCH net-next v7 2/5] tls: Fix dangling skb pointer in tls_sw_read_sock() Chuck Lever
2026-03-30 12:17   ` Sabrina Dubroca [this message]
2026-03-28 15:17 ` [PATCH net-next v7 3/5] tls: Factor tls_strp_msg_release() from tls_strp_msg_done() Chuck Lever
2026-03-30 12:21   ` Sabrina Dubroca
2026-03-28 15:17 ` [PATCH net-next v7 4/5] tls: Suppress spurious saved_data_ready on all receive paths Chuck Lever
2026-03-30 14:43   ` Sabrina Dubroca
2026-03-31  2:06     ` Chuck Lever
2026-03-28 15:17 ` [PATCH net-next v7 5/5] tls: Flush backlog before waiting for a new record Chuck Lever
2026-04-22 16:41 ` [PATCH net-next v7 0/5] TLS read_sock performance scalability Chuck Lever
2026-04-23  2:08   ` Jakub Kicinski
2026-04-25 20:15     ` Chuck Lever
2026-04-26 23:55       ` Jakub Kicinski

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=acppwzU7-TgWbd5f@krikkit \
    --to=sd@queasysnail.net \
    --cc=alistair.francis@wdc.com \
    --cc=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=hare@suse.de \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-tls-handshake@lists.linux.dev \
    --cc=kuba@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.