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 <github@gone.nl>
This commit is contained in:
parent
7e7545e556
commit
1746a195e9
@ -55,6 +55,7 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
|
|||||||
"accept",
|
"accept",
|
||||||
"accept4",
|
"accept4",
|
||||||
"access",
|
"access",
|
||||||
|
"adjtimex",
|
||||||
"alarm",
|
"alarm",
|
||||||
"bind",
|
"bind",
|
||||||
"brk",
|
"brk",
|
||||||
@ -555,7 +556,6 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
|
|||||||
Names: []string{
|
Names: []string{
|
||||||
"settimeofday",
|
"settimeofday",
|
||||||
"stime",
|
"stime",
|
||||||
"adjtimex",
|
|
||||||
},
|
},
|
||||||
Action: specs.ActAllow,
|
Action: specs.ActAllow,
|
||||||
Args: []specs.LinuxSeccompArg{},
|
Args: []specs.LinuxSeccompArg{},
|
||||||
|
Loading…
Reference in New Issue
Block a user