Skip to content

Commit 152baa4

Browse files
bpf: Remove bpf_probe_write_user() warning message
JIRA: https://issues.redhat.com/browse/RHEL-78201 commit b28573e Author: Marco Elver <elver@google.com> Date: Fri Nov 29 09:59:33 2024 +0100 bpf: Remove bpf_probe_write_user() warning message 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/20240404190146.1898103-1-elver@google.com/ [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 <elver@google.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/r/20241129090040.2690691-1-elver@google.com Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
1 parent abd6f59 commit 152baa4

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

kernel/trace/bpf_trace.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,6 @@ static const struct bpf_func_proto *bpf_get_probe_write_proto(void)
362362
if (!capable(CAP_SYS_ADMIN))
363363
return NULL;
364364

365-
pr_warn_ratelimited("%s[%d] is installing a program with bpf_probe_write_user helper that may corrupt user memory!",
366-
current->comm, task_pid_nr(current));
367-
368365
return &bpf_probe_write_user_proto;
369366
}
370367

0 commit comments

Comments
 (0)