Skip to content

Commit 1746a19

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]>
1 parent 7e7545e commit 1746a19

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",
@@ -555,7 +556,6 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
555556
Names: []string{
556557
"settimeofday",
557558
"stime",
558-
"adjtimex",
559559
},
560560
Action: specs.ActAllow,
561561
Args: []specs.LinuxSeccompArg{},

0 commit comments

Comments
 (0)