All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 bpf 0/3] AF_XDP Socket Creation Fixes
@ 2021-03-30 11:34 Ciara Loftus
  2021-03-30 11:34 ` [PATCH v3 bpf 1/3] libbpf: ensure umem pointer is non-NULL before dereferencing Ciara Loftus
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ciara Loftus @ 2021-03-30 11:34 UTC (permalink / raw)
  To: netdev, bpf, magnus.karlsson, bjorn, alexei.starovoitov; +Cc: Ciara Loftus

This series fixes some issues around socket creation for AF_XDP.

Patch 1 fixes a potential NULL pointer dereference in
xsk_socket__create_shared.

Patch 2 ensures that the umem passed to xsk_socket__create(_shared)
remains unchanged in event of failure.

Patch 3 makes it possible for xsk_socket__create(_shared) to
succeed even if the rx and tx XDP rings have already been set up by
introducing a new flag to struct xsk_umem.

v2->v3:
* Instead of ignoring the return values of the setsockopt calls, introduce
  a new flag to determine whether or not to call them based on the ring
  setup status as suggested by Alexei.

v1->v2:
* Simplified restoring the _save pointers as suggested by Magnus.
* Fixed the condition which determines whether to unmap umem rings
 when socket create fails.

This series applies on commit 861de02e5f3f2a104eecc5af1d248cb7bf8c5f75


Ciara Loftus (3):
  libbpf: ensure umem pointer is non-NULL before dereferencing
  libbpf: restore umem state after socket create failure
  libbpf: only create rx and tx XDP rings when necessary

 tools/lib/bpf/xsk.c | 48 +++++++++++++++++++++++++++++++--------------
 1 file changed, 33 insertions(+), 15 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-30 17:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 11:34 [PATCH v3 bpf 0/3] AF_XDP Socket Creation Fixes Ciara Loftus
2021-03-30 11:34 ` [PATCH v3 bpf 1/3] libbpf: ensure umem pointer is non-NULL before dereferencing Ciara Loftus
2021-03-30 11:34 ` [PATCH v3 bpf 2/3] libbpf: restore umem state after socket create failure Ciara Loftus
2021-03-30 15:08   ` Alexei Starovoitov
2021-03-30 17:21     ` Björn Töpel
2021-03-30 11:34 ` [PATCH v3 bpf 3/3] libbpf: only create rx and tx XDP rings when necessary Ciara Loftus
2021-03-30 17:25   ` Björn Töpel

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.