-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpf: Remove bpf_probe_write_user() warning message #4712
bpf: Remove bpf_probe_write_user() warning message #4712
Conversation
Upstream branch: c8d02b5 |
Upstream branch: c8d02b5 |
45ed3d8
to
1f05bfe
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=912778 expired. Closing PR. |
Upstream branch: c8d02b5 |
1f05bfe
to
3a0461e
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=912831 expired. Closing PR. |
Upstream branch: c8d02b5 |
3a0461e
to
44ffa90
Compare
Upstream branch: c8d02b5 |
44ffa90
to
c35ddf3
Compare
The warning message for bpf_probe_write_user() was introduced in 96ae522 ("bpf: Add bpf_probe_write_user BPF helper to be called in tracers"), with the following in the commit message: Given this feature is meant for experiments, and it has a risk of crashing the system, and running programs, we print a warning on when a proglet that attempts to use this helper is installed, along with the pid and process name. After 8 years since 96ae522, bpf_probe_write_user() has found successful applications beyond experiments [1, 2], with no other good alternatives. Despite its intended purpose for "experiments", that doesn't stop Hyrum's law, and there are likely many more users depending on this helper: "[..] it does not matter what you promise [..] all observable behaviors of your system will be depended on by somebody." The ominous "helper that may corrupt user memory!" has offered no real benefit, and has been found to lead to confusion where the system administrator is loading programs with valid use cases. As such, remove the warning message. Link: https://lore.kernel.org/lkml/[email protected]/ [1] Link: https://lore.kernel.org/r/lkml/CAAn3qOUMD81-vxLLfep0H6rRd74ho2VaekdL4HjKq+Y1t9KdXQ@mail.gmail.com/ [2] Link: https://lore.kernel.org/all/CAEf4Bzb4D_=zuJrg3PawMOW3KqF8JvJm9SwF81_XHR2+u5hkUg@mail.gmail.com/ Signed-off-by: Marco Elver <[email protected]> Acked-by: Jiri Olsa <[email protected]> Acked-by: Daniel Borkmann <[email protected]>
…_proto() With bpf_get_probe_write_proto() no longer printing a message, we can avoid it being a special case with its own permission check. Refactor bpf_tracing_func_proto() similar to bpf_base_func_proto() to have a section conditional on bpf_token_capable(CAP_SYS_ADMIN), where the proto for bpf_probe_write_user() is returned. Finally, remove the unnecessary bpf_get_probe_write_proto(). This simplifies the code, and adding additional CAP_SYS_ADMIN-only helpers in future avoids duplicating the same CAP_SYS_ADMIN check. Suggested-by: Andrii Nakryiko <[email protected]> Signed-off-by: Marco Elver <[email protected]> Acked-by: Jiri Olsa <[email protected]> Acked-by: Daniel Borkmann <[email protected]>
Upstream branch: c8d02b5 |
c35ddf3
to
a25c18d
Compare
321b972
to
dd18309
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=913255 irrelevant now. Closing PR. |
Pull request for series with
subject: bpf: Remove bpf_probe_write_user() warning message
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=912778