Skip to content

Commit caa4611

Browse files
committed
seccomp: allow adjtimex get time operation
Enabled adjtimex in the default profile without requiring CAP_SYS_TIME privilege. The kernel will check CAP_SYS_TIME and won't allow setting the time. Fixes: Getting the system time with ntptime returns an error in an unprivileged container To verify, inside a CentOS 7 container: yum install -y ntp ntptime # ntp_gettime() returns code 0 (OK) ntpdate -v time.nist.gov # ntpdate[84]: Can't adjust the time of day: Operation not permitted Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit 1746a19) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 2b80b7d commit caa4611

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

contrib/seccomp/seccomp_default.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
5555
"accept",
5656
"accept4",
5757
"access",
58+
"adjtimex",
5859
"alarm",
5960
"bind",
6061
"brk",
@@ -553,7 +554,6 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
553554
Names: []string{
554555
"settimeofday",
555556
"stime",
556-
"adjtimex",
557557
},
558558
Action: specs.ActAllow,
559559
Args: []specs.LinuxSeccompArg{},

0 commit comments

Comments
 (0)