Page MenuHomeFreeBSD

jail: allow jails to call settimeofday() if allow.settime is enabled
ClosedPublic

Authored by ivy on Tue, Apr 15, 6:01 PM.
Tags
None
Referenced Files
F115287820: D49846.diff
Tue, Apr 22, 6:48 AM
F115261012: D49846.diff
Mon, Apr 21, 11:42 PM
Unknown Object (File)
Sun, Apr 20, 7:21 PM
Unknown Object (File)
Thu, Apr 17, 2:49 AM
Unknown Object (File)
Thu, Apr 17, 2:44 AM
Unknown Object (File)
Thu, Apr 17, 2:09 AM
Unknown Object (File)
Wed, Apr 16, 5:47 AM

Details

Reviewers
jamie
oshogbo
kevans
des
Group Reviewers
Jails
Summary

this extends the existing behaviour to allow calling settimeofday() in
addition to clock_settime(). this is required for chrony, which uses
settimeofday() to step the clock.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 63527
Build 60411: arc lint + arc unit

Event Timeline

ivy requested review of this revision.Tue, Apr 15, 6:01 PM
jamie added a reviewer: oshogbo.

It looks very basic, and is good by me. But I'm inviting Mariusz to make sure he didn't have a particular reason not to include PRIV_SETTIMEOFDAY when he added PRIV_CLOCK_SETTIME.

This revision is now accepted and ready to land.Wed, Apr 16, 7:46 PM

Seems reasonable to me. Setting the time is setting the time. They both call settime() in kern_time.c under the covers. Not even sure why they are separate privs, unless the slight difference in only being able to set one of the clocks matters. But since there are two privs, this seems fine given the jail permission granularity.

adding kevans, des (mentors) to review. i am ready to land this but i will wait for Mariusz input first.

I have missed this one. I simply looked into syscalls from ntpd.

closing this manually as it was committed as 1589eb2e8764623d1c32982b52088842519dfd11. i think phab missed this because i put <> around the Differential Revision tag in the commit message, which i'll stop doing.

In D49846#1138487, @ivy wrote:

i think phab missed this because i put <> around the Differential Revision tag in the commit message, which i'll stop doing.

You really should install freebsd-git-devtools and use git arc stage to prepare commits from phab reviews.