linux/kernel/trace
Gianluca Borello eb33f2cca4 bpf: remove explicit handling of 0 for arg2 in bpf_probe_read
Commit 9c019e2bc4 ("bpf: change helper bpf_probe_read arg2 type to
ARG_CONST_SIZE_OR_ZERO") changed arg2 type to ARG_CONST_SIZE_OR_ZERO to
simplify writing bpf programs by taking advantage of the new semantics
introduced for ARG_CONST_SIZE_OR_ZERO which allows <!NULL, 0> arguments.

In order to prevent the helper from actually passing a NULL pointer to
probe_kernel_read, which can happen when <NULL, 0> is passed to the helper,
the commit also introduced an explicit check against size == 0.

After the recent introduction of the ARG_PTR_TO_MEM_OR_NULL type,
bpf_probe_read can not receive a pair of <NULL, 0> arguments anymore, thus
the check is not needed anymore and can be removed, since probe_kernel_read
can correctly handle a <!NULL, 0> call. This also fixes the semantics of
the helper before it gets officially released and bpf programs start
relying on this check.

Fixes: 9c019e2bc4 ("bpf: change helper bpf_probe_read arg2 type to ARG_CONST_SIZE_OR_ZERO")
Signed-off-by: Gianluca Borello <g.borello@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2017-11-22 21:40:54 +01:00
..
blktrace.c blktrace: fix unlocked registration of tracepoints 2017-11-10 19:53:25 -07:00
bpf_trace.c bpf: remove explicit handling of 0 for arg2 in bpf_probe_read 2017-11-22 21:40:54 +01:00
ftrace.c Tracing updates for 4.15: 2017-11-17 14:58:01 -08:00
Kconfig Tracing updates for 4.15: 2017-11-17 14:58:01 -08:00
Makefile Tracing updates for 4.15: 2017-11-17 14:58:01 -08:00
power-traces.c
ring_buffer_benchmark.c
ring_buffer.c Tracing updates for 4.15: 2017-11-17 14:58:01 -08:00
rpm-traces.c
trace_benchmark.c
trace_benchmark.h
trace_branch.c
trace_clock.c
trace_entries.h
trace_event_perf.c
trace_events_filter_test.h
trace_events_filter.c
trace_events_hist.c
trace_events_trigger.c
trace_events.c
trace_export.c
trace_functions_graph.c
trace_functions.c
trace_hwlat.c
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c Tracing updates for 4.15: 2017-11-17 14:58:01 -08:00
trace_mmiotrace.c
trace_nop.c
trace_output.c
trace_output.h
trace_printk.c
trace_probe.c
trace_probe.h bpf: Revert bpf_overrid_function() helper changes. 2017-11-11 18:24:55 +09:00
trace_sched_switch.c
trace_sched_wakeup.c Merge branch 'linus' into sched/core, to pick up fixes 2017-11-08 10:17:15 +01:00
trace_selftest_dynamic.c
trace_selftest.c Tracing updates for 4.15: 2017-11-17 14:58:01 -08:00
trace_seq.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_syscalls.c Tracing updates for 4.15: 2017-11-17 14:58:01 -08:00
trace_uprobe.c Tracing updates for 4.15: 2017-11-17 14:58:01 -08:00
trace.c
trace.h Tracing updates for 4.15: 2017-11-17 14:58:01 -08:00
tracing_map.c
tracing_map.h Tracing updates for 4.15: 2017-11-17 14:58:01 -08:00