Skip to content

Commit fa1f91a

Browse files
committed
moved ldisc_autoload and unprivileged_userfaultfd; updated comments
1 parent 810d887 commit fa1f91a

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

sysctl.conf

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
# Author: K4YT3X
33
# Contributor: IceCodeNew
44
# Contributor: HorlogeSkynet
5+
# Contributor: shenzhui007
6+
# Contributor: HorlogeSkynet
57
# Date Created: October 5, 2020
6-
# Last Updated: October 15, 2021
8+
# Last Updated: August 4, 2022
79

810
# Licensed under the GNU General Public License Version 3 (GNU GPL v3),
911
# available at: https://www.gnu.org/licenses/gpl-3.0.txt
10-
# (C) 2020-2021 K4YT3X
12+
# (C) 2020-2022 K4YT3X
1113

1214
# Multiple sources have been consulted while writing this configuration
1315
# file (e.g., nixCraft's sysctl.conf). Sources are not cited since this
@@ -69,6 +71,9 @@ kernel.perf_event_paranoid = 3
6971
kernel.perf_cpu_time_max_percent = 1
7072
kernel.perf_event_max_sample_rate = 1
7173

74+
# prevent unprivileged attackers from loading vulnerable line disciplines with the TIOCSETD ioctl
75+
dev.tty.ldisc_autoload = 0
76+
7277
########## File System ##########
7378

7479
# disallow core dumping by SUID/SGID programs
@@ -114,6 +119,10 @@ vm.mmap_min_addr = 65536
114119
vm.mmap_rnd_bits=32
115120
vm.mmap_rnd_compat_bits=16
116121

122+
# prevent unprivileged users from accessing userfaultfd
123+
# restricts syscall to the privileged users or the CAP_SYS_PTRACE capability
124+
vm.unprivileged_userfaultfd = 0
125+
117126
########## Networking ##########
118127

119128
# increase the maximum length of processor input queues
@@ -288,10 +297,3 @@ net.ipv6.conf.all.accept_source_route = 0
288297
#net.ipv6.icmp.echo_ignore_all = 1
289298
#net.ipv6.icmp.echo_ignore_anycast = 1
290299
#net.ipv6.icmp.echo_ignore_multicast = 1
291-
292-
293-
# prevent unprivileged attackers from loading vulnerable line disciplines with the TIOCSETD ioctl
294-
dev.tty.ldisc_autoload = 0
295-
296-
# disable syscall to the CAP_SYS_PTRACE capability
297-
vm.unprivileged_userfaultfd = 0

0 commit comments

Comments
 (0)