tracing/probes: Ensure the uprobe buffer size is bigger than event size
Masami Hiramatsu (Google)
maintainerPATCH 1/1 tracing/probes: Ensure the uprobe buffer size is bigger than event size
From: Masami Hiramatsu (Google) <[email protected]>
Add BUILD_BUG_ON() to ensure the uprobe per-CPU working buffer size is bigger than the event size.
Signed-off-by Masami Hiramatsu (Google) <[email protected]>
--- kernel/trace/trace_uprobe.c | 1 + 1 file changed, 1 insertion(+)
kernel/trace/trace_uprobe.c +1 -0
@@ -979,6 +979,7 @@ static struct uprobe_cpu_buffer *prepare_uprobe_buffer(struct trace_uprobe *tu, ucb =uprobe_buffer_get (); ucb->dsize = tu->tp.size + dsize; +BUILD_BUG_ON (MAX_UCB_BUFFER_SIZE <MAX_PROBE_EVENT_SIZE );if (WARN_ON_ONCE (ucb->dsize >MAX_UCB_BUFFER_SIZE )) { ucb->dsize =MAX_UCB_BUFFER_SIZE ; dsize =MAX_UCB_BUFFER_SIZE - tu->tp.size;