bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Jonathan Lemon <jonathan.lemon@gmail.com>
Cc: "Magnus Karlsson" <magnus.karlsson@intel.com>,
	"Björn Töpel" <bjorn.topel@intel.com>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Network Development" <netdev@vger.kernel.org>,
	kal.conley@dectris.com, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf] xsk: fix registration of Rx-only sockets
Date: Wed, 23 Oct 2019 20:22:58 -0700	[thread overview]
Message-ID: <CAADnVQ+t6ThJM_hfm9JvCApXdYfJLFNGdDd0ykBf-czvHeDAGQ@mail.gmail.com> (raw)
In-Reply-To: <B551C016-76AE-46D3-B2F5-15AFF9073735@gmail.com>

On Wed, Oct 23, 2019 at 4:03 PM Jonathan Lemon <jonathan.lemon@gmail.com> wrote:
>
> On 21 Oct 2019, at 1:16, Magnus Karlsson wrote:
>
> > Having Rx-only AF_XDP sockets can potentially lead to a crash in the
> > system by a NULL pointer dereference in xsk_umem_consume_tx(). This
> > function iterates through a list of all sockets tied to a umem and
> > checks if there are any packets to send on the Tx ring. Rx-only
> > sockets do not have a Tx ring, so this will cause a NULL pointer
> > dereference. This will happen if you have registered one or more
> > Rx-only sockets to a umem and the driver is checking the Tx ring even
> > on Rx, or if the XDP_SHARED_UMEM mode is used and there is a mix of
> > Rx-only and other sockets tied to the same umem.
> >
> > Fixed by only putting sockets with a Tx component on the list that
> > xsk_umem_consume_tx() iterates over.
>
> A future improvement might be renaming umem->xsk_list to umem->xsk_tx_list
> or similar, in order to make it clear that the list is only used on the
> TX path.
>
> >
> > Fixes: ac98d8aab61b ("xsk: wire upp Tx zero-copy functions")
> > Reported-by: Kal Cutter Conley <kal.conley@dectris.com>
> > Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
>
> Acked-by: Jonathan Lemon <jonathan.lemon@gmail.com>

Applied. Thanks

  reply	other threads:[~2019-10-24  3:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21  8:16 [PATCH bpf] xsk: fix registration of Rx-only sockets Magnus Karlsson
2019-10-23 23:03 ` Jonathan Lemon
2019-10-24  3:22   ` Alexei Starovoitov [this message]
2019-10-24 12:53   ` Magnus Karlsson
2019-10-24 15:19     ` Alexei Starovoitov

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=CAADnVQ+t6ThJM_hfm9JvCApXdYfJLFNGdDd0ykBf-czvHeDAGQ@mail.gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jonathan.lemon@gmail.com \
    --cc=kal.conley@dectris.com \
    --cc=magnus.karlsson@intel.com \
    --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 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).