-
201e4549
by Miroslav Lichvar at 2026-11-10T09:36:06+01:00
socket: add flag to not remove Unix socket path
Add a new flag to not call unlink() on the path of a Unix domain socket
before binding, and after binding if the connect() call failed. This
will be needed in chronyc.
-
19173cbd
by Miroslav Lichvar at 2026-11-19T11:38:08+01:00
client: fix mitigation for unsafe socket permission change
The chrony client Unix domain socket was moved to a hidden directory in
commit 90d808ed2897 ("client: mitigate unsafe permissions change on
chronyc socket") to mitigate a race with the chmod() call following
bind(). The code incorrectly assumed that the hidden path is not
revealed by the bind() call, but that is not actually the case, e.g.
on Linux other processes can read /proc/net/unix or use netlink
UNIX_DIAG_NAME. This breaks the mitigation, i.e. a compromised chronyd
process not running as root could still cause chronyc running as root to
change the permissions of an arbitrary file.
Fix the client socket opening procedure to open the directory before
bind() and use fchmodat() to safely change the socket permissions even
if the upper directory is replaced between the two calls.
To avoid the same race with unlink() called on exit or connect() error,
use the new flag disabling the removal in SCK_OpenUnixDatagramSocket(),
and keep the directory file descriptors open for unlinkat().
Add the O_DIRECTORY flag to the open() calls to avoid a hang on a named
pipe.
Fixes: 90d808ed2897 ("client: mitigate unsafe permissions change on chronyc socket")
Reported-by: Muhammad Hasnain Naeem <mhasnainnaeem111@xxxxxxxxx>
-
dcac59c3
by Miroslav Lichvar at 2026-11-19T12:00:31+01:00
configure: change default chronyc user to follow chronyd user
If a default chronyd user is specified by the --with-user option, make
that also the default user of chronyc unless a different user is set by
the --with-chronyc-user option.
-
d7cb5026
by Miroslav Lichvar at 2026-11-19T12:00:31+01:00
configure: print default chronyd and chronyc users
Print the users at the end of the configuration to make it more obvious
that the default is changed.
-
0d470e08
by Miroslav Lichvar at 2026-11-19T12:07:56+01:00
sys_linux: block links in level-2 seccomp filter
Try to prevent chronyd running with the -F 2 filter from creating
symbolic and hard links as an additional protection of the chronyc
socket handling. Block also io_uring, which can create links.
-
67f907f0
by Miroslav Lichvar at 2026-11-19T12:08:00+01:00
sys_linux: allow more PTP ioctls in seccomp filter
Allow the PTP_MASK_CLEAR_ALL and PTP_MASK_EN_SINGLE ioctls in the
seccomp filter, as these calls are not only made on start before the
seccomp filter is loaded, but also when the settings are disabled on
exit.
Reported-by: James Clark <jjc@xxxxxxxxxx>
-
372462ca
by Wojtek Wasko at 2026-11-19T13:07:28+01:00
ntp: fix monotonic correction of transmit timestamp from peer
In the interleaved mode, the remote transmit timestamp of the previous
packet is corrected for the time corrections the source accumulated
since it was captured, as reported in the F323 field. That is right for
servers, which keep their transmit timestamps in the client log, but a
peer in the symmetric active mode slews its saved transmit timestamp
together with its clock. The correction was applied twice, making the
measured delay wrong by the correction and the offset by half of it.
Such a sample is usually rejected by the delay tests, but not if the
correction is comparable to the network delay.
Don't correct the transmit timestamp of packets from active peers.
Extend the 144-monoroot test to check the delay measured by a peer when
the other peer corrects its clock.
Fixes: 2319f72b29a9 ("ntp: add client support for experimental extension field")