Skip to content

Commit e71eccb

Browse files
committed
seccomp: move the syslog syscall to be gated by CAP_SYS_ADMIN or CAP_SYSLOG
This call is what is used to implement `dmesg` to get kernel messages about the host. This can leak substantial information about the host. It is normally available to unprivileged users on the host, unless the sysctl `kernel.dmesg_restrict = 1` is set, but this is not set by standard on the majority of distributions. Blocking this to restrict leaks about the configuration seems correct. Relates to moby/moby#37897 "docker exposes dmesg to containers by default" See also https://googleprojectzero.blogspot.com/2018/09/a-cache-invalidation-bug-in-linux.html Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit 267a0cf) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 881db9b commit e71eccb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

contrib/seccomp/seccomp_default.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
344344
"sync_file_range",
345345
"syncfs",
346346
"sysinfo",
347-
"syslog",
348347
"tee",
349348
"tgkill",
350349
"time",
@@ -491,6 +490,7 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
491490
"setdomainname",
492491
"sethostname",
493492
"setns",
493+
"syslog",
494494
"umount",
495495
"umount2",
496496
"unshare",
@@ -562,6 +562,12 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
562562
Action: specs.ActAllow,
563563
Args: []specs.LinuxSeccompArg{},
564564
})
565+
case "CAP_SYSLOG":
566+
s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
567+
Names: []string{"syslog"},
568+
Action: specs.ActAllow,
569+
Args: []specs.LinuxSeccompArg{},
570+
})
565571
}
566572
}
567573

0 commit comments

Comments
 (0)