nixos/hardened profile: disable legacy virtual syscalls
This eliminates a theoretical risk of ASLR bypass due to the fixed address mapping used by the legacy vsyscall mechanism. Modern glibc use vdso(7) instead so there is no loss of functionality, but some programs may fail to run in this configuration. Programs that fail to run because vsyscall has been disabled will be logged to dmesg. For background on virtual syscalls see https://lwn.net/Articles/446528/ Closes https://github.com/NixOS/nixpkgs/pull/25289
This commit is contained in:
parent
f1c7d5a6ba
commit
63433537ce
1 changed files with 5 additions and 0 deletions
|
@ -10,6 +10,11 @@ with lib;
|
||||||
|
|
||||||
security.apparmor.enable = mkDefault true;
|
security.apparmor.enable = mkDefault true;
|
||||||
|
|
||||||
|
boot.kernelParams = [
|
||||||
|
# Disable legacy virtual syscalls
|
||||||
|
"vsyscall=none"
|
||||||
|
];
|
||||||
|
|
||||||
# Restrict ptrace() usage to processes with a pre-defined relationship
|
# Restrict ptrace() usage to processes with a pre-defined relationship
|
||||||
# (e.g., parent/child)
|
# (e.g., parent/child)
|
||||||
boot.kernel.sysctl."kernel.yama.ptrace_scope" = mkOverride 500 1;
|
boot.kernel.sysctl."kernel.yama.ptrace_scope" = mkOverride 500 1;
|
||||||
|
|
Loading…
Reference in a new issue