Skip to content
MediumOS hardeningBLWK-KERNEL-007

perf_event_paranoid allows unprivileged kernel profiling ​

What this means ​

kernel.perf_event_paranoid is ‹perf event paranoid›, below 2 — the perf_event_open() syscall is a documented side-channel and kernel-address-disclosure vector, and several real privilege-escalation exploits have used it once accessible to unprivileged users.

How to fix it ​

Set kernel.perf_event_paranoid=2 (or higher) via /etc/sysctl.d/ and run sysctl --system.

Check it yourself ​

Run a scan and look for BLWK-KERNEL-007 in the results:

sh
bulwark scan

Installed the standalone CLI package instead of the app? The command is bulwarkctl.

How Bulwark decides

Bulwark reads sysctl_kernel and reports this check when:

text
perf_event_paranoid < 2

If a value can't be read, Bulwark reports the check as undetermined rather than passing it. View the rule source.

References ​

  • CIS Benchmark 1.5.5

Released under the Apache License 2.0.