]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
loadpin: Implement custom proc_handler for enforce
authorJoel Granados <joel.granados@kernel.org>
Fri, 5 Dec 2025 08:43:11 +0000 (09:43 +0100)
committerJoel Granados <joel.granados@kernel.org>
Mon, 5 Jan 2026 12:45:19 +0000 (13:45 +0100)
commita2564d0688db20a1ee1660f45d7823075feb12a7
treeda078da3dd0fa12329896e1ce2c3c6ac78bdf426
parentb22d81fb683f22304f017b1b1674e6937bdd6d49
loadpin: Implement custom proc_handler for enforce

Add a new static variable (loadpin_root_writable) to keep the
write-ability state of enforce. Remove set_sysctl and const qualify
loadpin_sysctl_table (moves into .rodata) as there is no longer need to
change the value of extra1. The new proc_handler_loadpin returns -EINVAL
when loadpin_root_writable is false and the kernel var (enforce) is
being written. The old way of modifying the write-ability of enforce
stays in loadpin_check and is still set by calling sb_is_writable.

Signed-off-by: Joel Granados <joel.granados@kernel.org>
security/loadpin/loadpin.c