Skip to content

Commit bfe616d

Browse files
committed
Recommended_Settings: Add CONFIG_SLAB_BUCKETS and CONFIG_PROC_MEM_NO_FORCE
Signed-off-by: Kees Cook <[email protected]>
1 parent 77d1ab7 commit bfe616d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Recommended_Settings.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ CONFIG_STACKPROTECTOR_STRONG=y
3939
CONFIG_STRICT_DEVMEM=y
4040
CONFIG_IO_STRICT_DEVMEM=y
4141
42+
# Do not allow manipulation of read-only memory through /proc/$pid/mem.
43+
# See also "proc_mem.force_override" sysctl below.
44+
CONFIG_PROC_MEM_NO_FORCE=y
45+
4246
# Provides some protections against SYN flooding.
4347
CONFIG_SYN_COOKIES=y
4448
@@ -87,6 +91,7 @@ CONFIG_HARDENED_USERCOPY=y
8791
# Randomize allocator freelists, harden metadata.
8892
CONFIG_SLAB_FREELIST_RANDOM=y
8993
CONFIG_SLAB_FREELIST_HARDENED=y
94+
CONFIG_SLAB_BUCKETS=y
9095
CONFIG_RANDOM_KMALLOC_CACHES=y
9196
9297
# Make cross-slab heap attacks not as trivial when object sizes are the same. (Same as slab_nomerge boot param.)
@@ -530,6 +535,10 @@ kernel.oops_limit = 1
530535
# Turn on BPF JIT hardening, if the JIT is enabled.
531536
net.core.bpf_jit_harden = 2
532537
538+
# Disable bypassing of read-only permissions via /proc/$pid/mem.
539+
# To allow ptrace to do it (gdb, etc), use "...=ptrace".
540+
proc_mem.force_override=never
541+
533542
# Disable dangerous userfaultfd usage.
534543
vm.unprivileged_userfaultfd = 0
535544

0 commit comments

Comments
 (0)