Skip to content

Commit fe5f6bf

Browse files
committed
Fix ringbuf reserve size mismatch in uprobe_finish_op
bpf_ringbuf_reserve() was using sizeof(struct op_v) but the code copies a struct client_op_v into the reserved buffer. With the acting[] array expansion this became a detectable OOB write caught by the BPF verifier. Signed-off-by: Seyeong Kim <seyeong.kim@canonical.com>
1 parent ae72814 commit fe5f6bf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/radostrace.bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ int uprobe_finish_op(struct pt_regs *ctx) {
320320
opv->finish_stamp = bpf_ktime_get_boot_ns();
321321
opv->pid = get_pid();
322322
// submit to ringbuf
323-
struct client_op_v *e = bpf_ringbuf_reserve(&rb, sizeof(struct op_v), 0);
323+
struct client_op_v *e = bpf_ringbuf_reserve(&rb, sizeof(struct client_op_v), 0);
324324
if (NULL == e) {
325325
return 0;
326326
}

0 commit comments

Comments
 (0)