sysctl.conf: Turn on hard- and symlink protection

Message ID 9cccdcf4-463e-306b-a535-3a8e9a88f46e@ipfire.org
State Accepted
Commit 29a8992b7228771fb2cfc68679596598fb01105a
Headers
Series sysctl.conf: Turn on hard- and symlink protection |

Commit Message

Peter Müller Jan. 23, 2020, 9:28 p.m. UTC
  Cc: Michael Tremer <michael.tremer@ipfire.org>
Cc: Arne Fitzenreiter <arne_f@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 config/etc/sysctl.conf | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Michael Tremer Jan. 23, 2020, 10:27 p.m. UTC | #1
Acked-by: Michael Tremer <michael.tremer@ipfire.org>

> On 23 Jan 2020, at 21:28, Peter Müller <peter.mueller@ipfire.org> wrote:
> 
> Cc: Michael Tremer <michael.tremer@ipfire.org>
> Cc: Arne Fitzenreiter <arne_f@ipfire.org>
> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
> ---
> config/etc/sysctl.conf | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/config/etc/sysctl.conf b/config/etc/sysctl.conf
> index d11e53c88..7e7ebee44 100644
> --- a/config/etc/sysctl.conf
> +++ b/config/etc/sysctl.conf
> @@ -45,6 +45,10 @@ kernel.kptr_restrict = 2
> # Avoid kernel memory address exposures via dmesg.
> kernel.dmesg_restrict = 1
> 
> +# Turn on hard- and symlink protection
> +fs.protected_symlinks = 1
> +fs.protected_hardlinks = 1
> +
> # Minimal preemption granularity for CPU-bound tasks:
> # (default: 1 msec#  (1 + ilog(ncpus)), units: nanoseconds)
> kernel.sched_min_granularity_ns = 10000000
> -- 
> 2.16.4
  

Patch

diff --git a/config/etc/sysctl.conf b/config/etc/sysctl.conf
index d11e53c88..7e7ebee44 100644
--- a/config/etc/sysctl.conf
+++ b/config/etc/sysctl.conf
@@ -45,6 +45,10 @@  kernel.kptr_restrict = 2
 # Avoid kernel memory address exposures via dmesg.
 kernel.dmesg_restrict = 1
 
+# Turn on hard- and symlink protection
+fs.protected_symlinks = 1
+fs.protected_hardlinks = 1
+
 # Minimal preemption granularity for CPU-bound tasks:
 # (default: 1 msec#  (1 + ilog(ncpus)), units: nanoseconds)
 kernel.sched_min_granularity_ns = 10000000