Skip to content

Conversation

@miklosszegedi
Copy link

Signed-off-by: Miklos Szegedi [email protected]

- What I did
Fixes #33126 . Enabled getting the time without CAP_SYS_TIME

- How I did it
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.

- How to verify it
docker run -t -i centos:7
yum install -y ntp
ntptime
Returns: ntp_gettime() returns code 0 (OK)
ntpdate -v time.nist.gov
Returns: ntpdate[84]: Can't adjust the time of day: Operation not permitted

- Description for the changelog

Whitelisting adjtimex get time operation and requiring CAP_SYS_TIME only in case of adjustment

@tonistiigi
Copy link
Member

@szegedim run go generate ./profiles/seccomp/ as well

@thaJeztah thaJeztah added the status/failing-ci Indicates that the PR in its current state fails the test suite label May 29, 2017
@miklosszegedi miklosszegedi force-pushed the 33126-whitelist-adjtimex branch from 2a5076d to 2db0531 Compare June 2, 2017 18:52
@miklosszegedi
Copy link
Author

@tonistiigi I updated the patch.

@miklosszegedi
Copy link
Author

The issues seem to be environment related.

@tonistiigi tonistiigi added rebuild/experimental and removed status/failing-ci Indicates that the PR in its current state fails the test suite labels Jun 2, 2017
@tonistiigi
Copy link
Member

@justincormack PTAL

@runcom
Copy link
Member

runcom commented Jun 3, 2017

LGTM

@GordonTheTurtle GordonTheTurtle added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Jun 16, 2017
@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "33126-whitelist-adjtimex" [email protected]:szegedim/moby.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354184424
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

@justincormack
Copy link
Contributor

justincormack commented Jun 16, 2017 via email

@thaJeztah
Copy link
Member

@szegedim can you rebase to get rid of the merge commit? That should also fix the DCO sign-off failure

@miklosszegedi miklosszegedi force-pushed the 33126-whitelist-adjtimex branch from fa8ca20 to 2db0531 Compare June 16, 2017 19:46
@GordonTheTurtle GordonTheTurtle removed the dco/no Automatically set by a bot when one of the commits lacks proper signature label Jun 16, 2017
@miklosszegedi
Copy link
Author

I do not have permissions to merge. Could you do that?

@tonistiigi
Copy link
Member

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting the system time with ntptime returns an error in an unprivileged container

7 participants