bpf: sanitize bpf tracepoint access
during bpf program loading remember the last byte of ctx access and at the time of attaching the program to tracepoint check that the program doesn't access bytes beyond defined in tracepoint fields This also disallows access to __dynamic_array fields, but can be relaxed in the future. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
9940d67c93
commit
32bbe0078a
@@ -569,6 +569,7 @@ extern int trace_define_field(struct trace_event_call *call, const char *type,
|
||||
int is_signed, int filter_type);
|
||||
extern int trace_add_event_call(struct trace_event_call *call);
|
||||
extern int trace_remove_event_call(struct trace_event_call *call);
|
||||
extern int trace_event_get_offsets(struct trace_event_call *call);
|
||||
|
||||
#define is_signed_type(type) (((type)(-1)) < (type)1)
|
||||
|
||||
|
Reference in New Issue
Block a user