Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
libbpftune: only send events to active tuners
Roger reported a segmentation fault in tcp_buffer_tuner. Examining the
state of the tuner we were handling an event when in manual (i.e. off)
state.  The event handler for a tuner should only be called if the tuner
is active.

Reported by: Roger Knobbe (https://github.com/rknobbe)
Signed-off-by: Alan Maguire <[email protected]>
  • Loading branch information
alan-maguire committed Nov 25, 2024
commit 2c530fd99bba0721d86a644214e255e98d6a3d9d
4 changes: 3 additions & 1 deletion src/libbpftune.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,9 @@ static int bpftune_ringbuf_event_read(void *ctx, void *data, size_t size)
event->netns_cookie,
event->netns_cookie && event->netns_cookie != global_netns_cookie ?
"non-global netns" : "global netns");
tuner->event_handler(tuner, event, ctx);
/* only send events to active tuners */
if (tuner->state == BPFTUNE_ACTIVE)
tuner->event_handler(tuner, event, ctx);

return 0;
}
Expand Down