All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Jann Horn <jannh@google.com>, Boris Pismenny <borisp@nvidia.com>,
	John Fastabend <john.fastabend@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>
Cc: David Howells <dhowells@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] tls: fix NULL deref on tls_sw_splice_eof() with empty record
Date: Sun, 26 Nov 2023 15:56:46 -0800	[thread overview]
Message-ID: <6563db3e1d1ef_68d9b208cf@john.notmuch> (raw)
In-Reply-To: <CAG48ez3dn7CAfTmfziBUd_aFfcM1LOYsUuYrKykZAvTv=AAodg@mail.gmail.com>

Jann Horn wrote:
> On Wed, Nov 22, 2023 at 10:44 PM Jann Horn <jannh@google.com> wrote:
> > syzkaller discovered that if tls_sw_splice_eof() is executed as part of
> > sendfile() when the plaintext/ciphertext sk_msg are empty, the send path
> > gets confused because the empty ciphertext buffer does not have enough
> > space for the encryption overhead. This causes tls_push_record() to go on
> > the `split = true` path (which is only supposed to be used when interacting
> > with an attached BPF program), and then get further confused and hit the
> > tls_merge_open_record() path, which then assumes that there must be at
> > least one populated buffer element, leading to a NULL deref.
> 
> Ah, and in case you're looking for the corresponding syzkaller report,
> you can find that at
> <https://lore.kernel.org/all/000000000000347a250608e8a4d1@google.com/T/>.

I'm a bit slow, but looks good to me as well. Thanks a lot.

Acked-by: John Fastabend <john.fastabend@gmail.com>

  reply	other threads:[~2023-11-26 23:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 21:44 [PATCH net] tls: fix NULL deref on tls_sw_splice_eof() with empty record Jann Horn
2023-11-22 21:58 ` Jann Horn
2023-11-26 23:56   ` John Fastabend [this message]
2023-11-23 17:00 ` patchwork-bot+netdevbpf
2023-11-27  9:04 ` David Howells
2023-11-27 13:10   ` Jann Horn

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=6563db3e1d1ef_68d9b208cf@john.notmuch \
    --to=john.fastabend@gmail.com \
    --cc=borisp@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=jannh@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@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.