Commit e4f7e25d authored by Matt Mullins's avatar Matt Mullins Committed by Cheng Jian
Browse files

bpf: add writable context for raw tracepoints

mainline inclusion
from mainline-v5.2-rc1
commit 9df1c28b
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I3U9MR


CVE: NA

-------------------------------------------------------------------------

This is an opt-in interface that allows a tracepoint to provide a safe
buffer that can be written from a BPF_PROG_TYPE_RAW_TRACEPOINT program.
The size of the buffer must be a compile-time constant, and is checked
before allowing a BPF program to attach to a tracepoint that uses this
feature.

The pointer to this buffer will be the first argument of tracepoints
that opt in; the pointer is valid and can be bpf_probe_read() by both
BPF_PROG_TYPE_RAW_TRACEPOINT and BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE
programs that attach to such a tracepoint, but the buffer to which it
points may only be written by the latter.

Signed-off-by: default avatarMatt Mullins <mmullins@fb.com>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Conflict:
	include/linux/bpf.h
	include/uapi/linux/bpf.h
	kernel/bpf/verifier.c
Signed-off-by: default avatarYufen Yu <yuyufen@huawei.com>
Reviewed-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent a83b988c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment