]> git.ipfire.org Git - thirdparty/chrony.git/commit
doc: deprecate SHM refclocks in favor of SOCK
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 12 Jan 2023 14:23:21 +0000 (15:23 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 12 Jan 2023 15:23:15 +0000 (16:23 +0100)
commitbbeec7361c339090cbca0356b83a4131f9b4502a
tree6684514de8fbbe4ecafd5003322d1768db588a78
parent6fba5a4a7fbe785849c0ec759e18bce0b7e234e4
doc: deprecate SHM refclocks in favor of SOCK

The NTP SHM refclock protocol has the following properties:

- the memory segments have a predictable key (first segment 0x4e545030)
- it's expected to work in any order of starting chronyd and the program
  providing samples to chronyd, i.e. both the consumer and producer need
  to be able to create the segment
- the producer and consumer generally don't know under which user is
  the other side running (e.g. gpsd can create the segment as root and
  also as nobody after it drops root privileges)
- there is no authentication of data provided via SHM
- there is no way to restart the protocol

This makes it difficult for chronyd to ensure it is receiving
measurements from the process that the admin expects it to and not some
other process that managed to create the segment before it was started.
It's up to the admin to configure the system so that chronyd or the
producer is started before untrusted applications or users can create
the segment, or at least verify at some point later that the segment was
created with the expected owner and permissions.

There doesn't seem to be a backward-compatible fix of the protocol. Even
if one side could detect the segment had a wrong owner or permissions,
it wouldn't be able to tell the other side to reattach after recreating
the segment with the expected owner and permissions, if it still had the
permissions to do that.

The protocol would need to specify which side is responsible for
creating the segment and the start order would need to strictly follow
that.

As gpsd (likely the most common refclock source for chronyd) now
supports in the latest version SOCK even for message-based timing,
update the man page and FAQ to deprecate SHM in favor of SOCK.
doc/chrony.conf.adoc
doc/faq.adoc