bpf: Avoid unnecessary audit log for CPU security mitigations
PATCH 1/1 bpf: Avoid unnecessary audit log for CPU security mitigations
Check cpu_mitigations_off() first to avoid calling capable() if it is off. This can avoid unnecessary audit log.
Fixes bc5bc309db45 ("bpf: Inherit system settings for CPU security mitigations")
Link https://lore.kernel.org/bpf/CAEf4Bza6UVUWqcWQ-66weZ-nMDr+TFU3Mtq=dumZFD-pSqU7Ow@mail.gmail.com/ open here
Suggested-by Andrii Nakryiko <[email protected]>
Signed-off-by Yafang Shao <[email protected]>
--- include/linux/bpf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/bpf.h +2 -2
@@ -2164,12 +2164,12 @@ static inline bool bpf_allow_uninit_stack(void)static inline bool bpf_bypass_spec_v1 (void ) { -return perfmon_capable () ||cpu_mitigations_off (); +return cpu_mitigations_off () ||perfmon_capable (); }static inline bool bpf_bypass_spec_v4 (void ) { -return perfmon_capable () ||cpu_mitigations_off (); +return cpu_mitigations_off () ||perfmon_capable (); }int bpf_map_new_fd (struct bpf_map *map,int flags);
Signature · 1 line
1.8.3.1
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 9 lines · On Fri, 13 Oct 2023 08:39:16 +0000 you wrote:
Check
cpu_mitigations_off()first to avoid callingcapable()if it is off. This can avoid unnecessary audit log.Fixes bc5bc309db45 ("bpf: Inherit system settings for CPU security mitigations")Link https://lore.kernel.org/bpf/CAEf4Bza6UVUWqcWQ-66weZ-nMDr+TFU3Mtq=dumZFD-pSqU7Ow@mail.gmail.com/ open hereSuggested-by Andrii Nakryiko <[email protected]>Signed-off-by Yafang Shao <[email protected]>[...]
Here is the summary with links:
- [bpf-next] bpf: Avoid unnecessary audit log for CPU security mitigations
https://git.kernel.org/bpf/bpf-next/c/236334aeec0f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html