bpf: change helper bpf_probe_read arg2 type to ARG_CONST_SIZE_OR_ZERO
authorYonghong Song <yhs@fb.com>
Sun, 12 Nov 2017 22:49:10 +0000 (14:49 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Nov 2017 07:20:03 +0000 (16:20 +0900)
commit9c019e2bc4b2bd8223c8c0d4b6962478b479834d
tree638dfe307de950e1e4101cedc34dfd82ee3dd4e1
parent9fd29c08e52023252f0480ab8f6906a1ecc9a8d5
bpf: change helper bpf_probe_read arg2 type to ARG_CONST_SIZE_OR_ZERO

The helper bpf_probe_read arg2 type is changed
from ARG_CONST_SIZE to ARG_CONST_SIZE_OR_ZERO to permit
size-0 buffer. Together with newer ARG_CONST_SIZE_OR_ZERO
semantics which allows non-NULL buffer with size 0,
this allows simpler bpf programs with verifier acceptance.
The previous commit which changes ARG_CONST_SIZE_OR_ZERO semantics
has details on examples.

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/trace/bpf_trace.c