do not expose kernel address spaces even to privileged users

Message ID 378c6d50-9d3e-3783-7fa3-80c762463695@link38.eu
State Accepted
Commit d5fe33228311d47490536bee370297a7c735f9d6
Headers
Series do not expose kernel address spaces even to privileged users |

Commit Message

Peter Müller Aug. 17, 2018, 1:29 a.m. UTC
  Change this setting from 1 to 2 so kernel addresses are not
displayed even if a user has CAPS_SYSLOG privileges.

See also:
- https://lwn.net/Articles/420403/
- https://tails.boum.org/contribute/design/kernel_hardening/

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
---
 config/etc/sysctl.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/config/etc/sysctl.conf b/config/etc/sysctl.conf
index 011c4287e..345f8f52a 100644
--- a/config/etc/sysctl.conf
+++ b/config/etc/sysctl.conf
@@ -44,7 +44,7 @@  net.bridge.bridge-nf-call-iptables = 0
 net.bridge.bridge-nf-call-arptables = 0
 
 # Try to keep kernel address exposures out of various /proc files (kallsyms, modules, etc).
-kernel.kptr_restrict = 1
+kernel.kptr_restrict = 2
 
 # Avoid kernel memory address exposures via dmesg.
 kernel.dmesg_restrict = 1