Skip to content

Commit f81ce26

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 2ee65d8 commit f81ce26

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

contrib/seccomp/seccomp_default.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
346346
"sync_file_range",
347347
"syncfs",
348348
"sysinfo",
349-
"syslog",
350349
"tee",
351350
"tgkill",
352351
"time",
@@ -493,6 +492,7 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
493492
"setdomainname",
494493
"sethostname",
495494
"setns",
495+
"syslog",
496496
"umount",
497497
"umount2",
498498
"unshare",
@@ -564,6 +564,12 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
564564
Action: specs.ActAllow,
565565
Args: []specs.LinuxSeccompArg{},
566566
})
567+
case "CAP_SYSLOG":
568+
s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
569+
Names: []string{"syslog"},
570+
Action: specs.ActAllow,
571+
Args: []specs.LinuxSeccompArg{},
572+
})
567573
}
568574
}
569575

0 commit comments

Comments
 (0)