Skip to content

Set kernel.kptr_restrict=1 in the shipped sysctl drop-in - #9288

Open
fresh3nough wants to merge 1 commit into
omacom:quattrofrom
fresh3nough:fix/issue-9194-kptr-restrict
Open

Set kernel.kptr_restrict=1 in the shipped sysctl drop-in#9288
fresh3nough wants to merge 1 commit into
omacom:quattrofrom
fresh3nough:fix/issue-9194-kptr-restrict

Conversation

@fresh3nough

Copy link
Copy Markdown

Summary

Fixes #9194.

Omarchy already ships performance/network sysctls in etc/sysctl.d/99-omarchy-sysctl.conf. Arch defaults leave kernel.kptr_restrict=0, which exposes kernel addresses in /proc (e.g. /proc/kallsyms) to unprivileged users and weakens KASLR against local exploits.

Change

  • Set kernel.kptr_restrict=1 in etc/sysctl.d/99-omarchy-sysctl.conf (root still sees pointers).
  • Migration 1788139000.sh applies the drop-in at update time so existing boots do not wait for reboot.

Test plan

  • Conf contains kernel.kptr_restrict=1
  • sudo sysctl -w kernel.kptr_restrict=1 applies cleanly on GCP VM
  • ./test/shell.d/sysctl-kptr-restrict-test.sh passes
./test/shell.d/sysctl-kptr-restrict-test.sh

Hide kernel pointer addresses from unprivileged /proc readers while
leaving them visible to root. Low-risk hardening that does not change
normal desktop behaviour; existing installs pick it up via migration
without waiting for reboot.

Fixes omacom#9194

Signed-off-by: fresh3nough <anonwurcod@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider setting kernel.kptr_restrict=1 by default

1 participant