@@ -3,39 +3,56 @@
33with stdenv.lib;
44
55''
6+# Auto configuration with these constraints will enable most of the
7+# important features (RAP, UDEREF, ASLR, memory sanitization).
68GRKERNSEC_CONFIG_AUTO y
79GRKERNSEC_CONFIG_DESKTOP y
8−GRKERNSEC_CONFIG_VIRT_HOST y
10+GRKERNSEC_CONFIG_PRIORITY_SECURITY y
11+
12+# We specify virt guest rather than host here, the latter deselects e.g.,
13+# paravirtualization.
14+GRKERNSEC_CONFIG_VIRT_GUEST y
15+# Note: assumes platform supports CPU-level virtualization (so no pentium 4)
916GRKERNSEC_CONFIG_VIRT_EPT y
1017GRKERNSEC_CONFIG_VIRT_KVM y
11−GRKERNSEC_CONFIG_PRIORITY_SECURITY y
1218
19+# PaX control
1320PAX_SOFTMODE y
14−
1521PAX_PT_PAX_FLAGS y
1622PAX_XATTR_PAX_FLAGS y
1723PAX_EI_PAX n
1824
19−GRKERNSEC_PROC_GID 0
25+# The bts instrumentation method is compatible with binary only modules.
26+#
27+# Note: if platform supports SMEP, we could do without this
28+PAX_KERNEXEC_PLUGIN_METHOD_BTS y
2029
21−PAX_LATENT_ENTROPY n
30+# Additional grsec hardening not implied by auto constraints
31+GRKERNSEC_IO y
2232
33+# Disable protections rendered useless by redistribution
2334GRKERNSEC_HIDESYM n
2435GRKERNSEC_RANDSTRUCT n
25−GRKERNSEC_PROC n
26−GRKERNSEC_SYSFS_RESTRICT n
27−GRKERNSEC_KMEM n
28−GRKERNSEC_MODHARDEN n
29−GRKERNSEC_NO_SIMULT_CONNECT n
3036
31−PAX_KERNEXEC_PLUGIN_METHOD_BTS y
37+# Disable protections covered by vanilla mechanisms
38+GRKERNSEC_DMESG n
39+GRKERNSEC_KMEM n
40+GRKERNSEC_PROC n
3241
33−GRKERNSEC_ACL_HIDEKERN y
34−GRKERNSEC_IO y
42+# Disable protections that are inappropriate for a general-purpose kernel
43+GRKERNSEC_NO_SIMULT_CONNECT n
3544
45+# Enable additional audititing
46+GRKERNSEC_AUDIT_MOUNT y
3647GRKERNSEC_AUDIT_PTRACE y
3748GRKERNSEC_FORKFAIL y
3849
50+# Wishlist: support trusted path execution
51+GRKERNSEC_TPE n
52+
53+# Wishlist: enable this, but breaks user initiated module loading
54+GRKERNSEC_MODHARDEN n
55+
3956GRKERNSEC_SYSCTL y
4057GRKERNSEC_SYSCTL_DISTRO y
4158GRKERNSEC_SYSCTL_ON y