bpf: Add a ARG_PTR_TO_CONST_STR argument type
authorFlorent Revest <revest@chromium.org>
Mon, 19 Apr 2021 15:52:39 +0000 (17:52 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 19 Apr 2021 22:27:36 +0000 (15:27 -0700)
commitfff13c4bb646ef849fd74ced87eef54340d28c21
tree7ddabbda08e03363ebfccaa83d5c0a1786732d79
parentd9c9e4db186ab4d81f84e6f22b225d333b9424e3
bpf: Add a ARG_PTR_TO_CONST_STR argument type

This type provides the guarantee that an argument is going to be a const
pointer to somewhere in a read-only map value. It also checks that this
pointer is followed by a zero character before the end of the map value.

Signed-off-by: Florent Revest <revest@chromium.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210419155243.1632274-3-revest@chromium.org
include/linux/bpf.h
kernel/bpf/verifier.c