Thread (3 messages) flat view 3 messages, 3 authors, 2022-03-09

Re: [PATCH net v2] xdp: xdp_mem_allocator can be NULL in trace_mem_connect().

From: Toke Høiland-Jørgensen <hidden>
Date: 2022-03-09 21:52:23
Also in: bpf

Sebastian Andrzej Siewior [off-list ref] writes:
Since the commit mentioned below __xdp_reg_mem_model() can return a NULL
pointer. This pointer is dereferenced in trace_mem_connect() which leads
to segfault.

The trace points (mem_connect + mem_disconnect) were put in place to
pair connect/disconnect using the IDs. The ID is only assigned if
__xdp_reg_mem_model() does not return NULL. That connect trace point is
of no use if there is no ID.

Skip that connect trace point if xdp_alloc is NULL.

[ Toke Høiland-Jørgensen delivered the reasoning for skipping the trace
  point ]

Fixes: 4a48ef70b93b8 ("xdp: Allow registering memory model without rxq reference")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
With Steven's fix:

Acked-by: Toke Høiland-Jørgensen <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help