Skip to content

Commit 4304c81

Browse files
committed
tracing/probes: Ensure the uprobe buffer size is bigger than event size
Add BUILD_BUG_ON() to ensure the uprobe per-CPU working buffer size is bigger than the event size. Link: https://lore.kernel.org/all/177849383209.8038.1902170479780501237.stgit@devnote2/ Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
1 parent 85e0f27 commit 4304c81

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

kernel/trace/trace_uprobe.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@ static struct uprobe_cpu_buffer *prepare_uprobe_buffer(struct trace_uprobe *tu,
979979
ucb = uprobe_buffer_get();
980980
ucb->dsize = tu->tp.size + dsize;
981981

982+
BUILD_BUG_ON(MAX_UCB_BUFFER_SIZE < MAX_PROBE_EVENT_SIZE);
982983
if (WARN_ON_ONCE(ucb->dsize > MAX_UCB_BUFFER_SIZE)) {
983984
ucb->dsize = MAX_UCB_BUFFER_SIZE;
984985
dsize = MAX_UCB_BUFFER_SIZE - tu->tp.size;

0 commit comments

Comments
 (0)