Use it when configuring, checking or troubleshooting Kernel Hardening in Linux Security.
Kernel Hardening
Linux Kernel Hardening reduces kernel exploitation and persistence through supported mitigations, memory protections, module and debug restrictions, lockdown/verified boot relationships, secure sysctl policy, attack-surface reduction and timely kernel/firmware updates.
1. Kernel hardening: sysctls, lockdown, module signing, disable unused modules.
2. Restrict ptrace, BPF, dmesg, kptrs.
3. Keep kernel patched (livepatch).
4. Blacklist rare filesystems/protocols.
5. Use distro hardening guides.
kernel settings → reduced attack surface
Context & applicabilityCommon mistakes · platform/version boundaries
An enabled mitigation reduces a defined technique or interface under assumptions; it does not remove vulnerabilities or show kernel/runtime integrity.
Suspicious evidence: unsupported sysctl, mitigation disabled by boot flag, unsigned module path, debug interface exposed, unprivileged namespace risk, patch pending reboot, livepatch assumption or performance workaround weakens control.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
hardware/firmware boot → kernel build/config/signature → boot parameters/LSMs/lockdown → runtime mitigations and exposed interfaces → process/device activity → logs/workload → patch/reboot verification
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Kernel hardening parameter set ≠ compiled feature supported or effective.
- Mitigation enabled ≠ kernel vulnerability patched or exploitation impossible.
- Configuration file present ≠ parsed, loaded and effective runtime state.
- One allow/deny result ≠ complete DAC, privilege, LSM, firewall and application outcome.
sysctl kernel.kptr_restrict kernel.dmesg_restrict kernel.unprivileged_bpf_disabled kernel.yama.ptrace_scope— hardening sysctlscat /sys/kernel/security/lockdown— lockdown modegrep -E 'CONFIG_(STACKPROTECTOR|FORTIFY)' /boot/config-$(uname -r)— build options
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
An enabled mitigation reduces a defined technique or interface under assumptions; it does not remove vulnerabilities or show kernel/runtime integrity.
In depth
Kernel hardening restricts kernel features and settings that attackers abuse for privilege escalation, information leaks or network attacks. Most is done with sysctl parameters, boot options and module restrictions.
# /etc/sysctl.d/90-hardening.conf
kernel.kptr_restrict = 2
kernel.dmesg_restrict = 1
kernel.unprivileged_bpf_disabled = 1
kernel.yama.ptrace_scope = 1
fs.protected_symlinks = 1
fs.protected_hardlinks = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.tcp_syncookies = 1
sysctl --system
Also keep the kernel patched (live patching services reduce reboot pressure), disable unused kernel modules (install usb-storage /bin/false), and enable Secure Boot with module signing where possible. Test settings with the applications you run.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Linux Security → Kernel Hardening. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.kernel.org/security/ · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Linux Security → Kernel Hardening proof map
Fast scope, effective-state, runtime-evidence and closure boundaries for Linux Security → Kernel Hardening.
| Boundary | Establish | Does not establish |
|---|---|---|
| Scope | Exact host, role, build/kernel, identity, workload and expected control | Does not prove policy receipt or effective runtime state |
| Effective state | Resultant/loaded policy, precedence, mode, labels/rules/keys and active services/kernel controls | Configuration presence does not prove enforcement |
| Runtime evidence | Correlated events/audit, process/token/credential, packet/syscall and workload result | One event, clean status or allow/deny does not prove complete security |
| Closure | Original allowed/denied workload works, unsafe state is removed and recovery/regression pass | Commit, restart, block or compliance result alone is not closure |