bpf: Print a warning only if writing to unprivileged_bpf_disabled.
PATCH 1/1 bpf: Print a warning only if writing to unprivileged_bpf_disabled.
Only print the warning message if you are writing to "/proc/sys/kernel/unprivileged_bpf_disabled".
The kernel may print an annoying warning when you read "/proc/sys/kernel/unprivileged_bpf_disabled" saying
WARNING: Unprivileged eBPF is enabled with eIBRS on, data leaks possible via Spectre v2 BHB attacks!
However, this message is only meaningful when the feature is disabled or enabled.
--- kernel/bpf/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/bpf/syscall.c +2 -1
@@ -5380,7 +5380,8 @@ static int bpf_unpriv_handler(struct ctl_table *table, int write, *(int *)table->data = unpriv_enable; } -unpriv_ebpf_notify (unpriv_enable); +if (write) +unpriv_ebpf_notify (unpriv_enable);return ret; }
Signature · 1 line
2.34.1
Quoted 6 lines · Kui-Feng Lee
Only print the warning message if you are writing to "
/proc/sys/kernel/unprivileged_bpf_disabled".The kernel may print an annoying warning when you read "
/proc/sys/kernel/unprivileged_bpf_disabled" saying
Quoted 7 lines
WARNING: Unprivileged eBPF is enabled with eIBRS on, data leaks possible via Spectre v2 BHB attacks!
However, this message is only meaningful when the feature is disabled or enabled.
Signed-off-by Kui-Feng Lee <[email protected]>
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Quoted 10 lines · On Tue, 2 May 2023 11:14:18 -0700 you wrote:
Only print the warning message if you are writing to "
/proc/sys/kernel/unprivileged_bpf_disabled".The kernel may print an annoying warning when you read "
/proc/sys/kernel/unprivileged_bpf_disabled" sayingWARNING: Unprivileged eBPF is enabled with eIBRS on, data leaks possible via Spectre v2 BHB attacks!
[...]
Here is the summary with links:
- [bpf-next] bpf: Print a warning only if writing to unprivileged_bpf_disabled.
https://git.kernel.org/bpf/bpf-next/c/fedf99200ab0
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html