summaryrefslogtreecommitdiffstats
path: root/kernel/taskstats.c
diff options
context:
space:
mode:
authorToke Høiland-Jørgensen <toke@redhat.com>2020-09-25 23:25:00 +0200
committerAlexei Starovoitov <ast@kernel.org>2020-09-28 17:08:07 -0700
commit1af9270e908cd50a4f5d815c9b6f794c7d57ed07 (patch)
tree74df99b5438c997caf6158e6a7e8afcc1e903e46 /kernel/taskstats.c
parent84a20d8e8795b45e3f1673648d43b4cf0f594359 (diff)
bpf: disallow attaching modify_return tracing functions to other BPF programs
From the checks and commit messages for modify_return, it seems it was never the intention that it should be possible to attach a tracing program with expected_attach_type == BPF_MODIFY_RETURN to another BPF program. However, check_attach_modify_return() will only look at the function name, so if the target function starts with "security_", the attach will be allowed even for bpf2bpf attachment. Fix this oversight by also blocking the modification if a target program is supplied. Fixes: 18644cec714a ("bpf: Fix use-after-free in fmod_ret check") Fixes: 6ba43b761c41 ("bpf: Attachment verification for BPF_MODIFY_RETURN") Acked-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/taskstats.c')
0 files changed, 0 insertions, 0 deletions