bpf: Protect probed address based on kptr_restrict setting
authorYafang Shao <laoar.shao@gmail.com>
Sun, 9 Jul 2023 02:56:24 +0000 (02:56 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 12 Jul 2023 03:07:51 +0000 (20:07 -0700)
commitf1a414537ecc18b5882a57045ce3e4a11e528290
treec930faa2d8c5ff46525cfccf2a109597080d1a07
parentedd7f49bb884139af9069dcf59d9f89f1f4ddf3f
bpf: Protect probed address based on kptr_restrict setting

The probed address can be accessed by userspace through querying the task
file descriptor (fd). However, it is crucial to adhere to the kptr_restrict
setting and refrain from exposing the address if it is not permitted.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20230709025630.3735-5-laoar.shao@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/trace/trace_kprobe.c