diff options
author | Florent Revest <revest@chromium.org> | 2021-04-19 17:52:39 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-04-19 15:27:36 -0700 |
commit | fff13c4bb646ef849fd74ced87eef54340d28c21 (patch) | |
tree | 7ddabbda08e03363ebfccaa83d5c0a1786732d79 /include/linux/bpf.h | |
parent | d9c9e4db186ab4d81f84e6f22b225d333b9424e3 (diff) | |
download | lwn-fff13c4bb646ef849fd74ced87eef54340d28c21.tar.gz lwn-fff13c4bb646ef849fd74ced87eef54340d28c21.zip |
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
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r-- | include/linux/bpf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 77d1d8c65b81..c160526fc8bf 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -309,6 +309,7 @@ enum bpf_arg_type { ARG_PTR_TO_PERCPU_BTF_ID, /* pointer to in-kernel percpu type */ ARG_PTR_TO_FUNC, /* pointer to a bpf program function */ ARG_PTR_TO_STACK_OR_NULL, /* pointer to stack or NULL */ + ARG_PTR_TO_CONST_STR, /* pointer to a null terminated read-only string */ __BPF_ARG_TYPE_MAX, }; |