summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd
AgeCommit message (Collapse)Author
2015-11-24Cache values from getpwnam() done at initialization, which need to beTheo de Raadt
used by the constraint processes setup later (chroot, setuid...) [late getpwnam discovered during a further audit] ok millert
2015-11-20use RMS for jitter. we're linking with enough libraries that libm is tiny.Ted Unangst
ok deraadt
2015-11-19Simplify all instances of get_string() and get_data() using malloc() andmmcc
strndup(). ok millert@
2015-11-17fix memory leak; from David CARLIERTheo de Raadt
2015-10-31fully revert some parts introduced with the original server rtable support,Christian Weisgerber
so servers with numeric IP addresses won't be skipped; ok reyk@
2015-10-30drop unused define; ok reyk@Christian Weisgerber
2015-10-30Remove support for sending status reports to syslog on SIGINFO;Reyk Floeter
we have ntpctl now and ntpd doesn't need redundant/obsolete features. Pointed out by naddy@, with input from zhuk@ (SIGINFO doesn't need SIG_IGN) OK deraadt@
2015-10-25the DNS process was not discarding & redirecting stdin/out/err toTheo de Raadt
/dev/null. copy the code from the ntp engine.
2015-10-23Rather than re-opening the driftfile to write, keep it open; rewindingTheo de Raadt
and coping with error conditions... that lets us avoid a pledge "wpath". Putting it all together, this lets the master ntpd pledge "stdio rpath inet settime proc id". It works like this: "rpath" to load the certificates, "proc" to create constraint processes, "id" to chroot and lock the constraint processes into a jail, then "inet" to open a https session. "settime" is used by the master to manage the system time when the ntp-speaking engine instructs the master. with help from naddy
2015-10-23Allowing upstream servers of ntp being in multiple routing tables isPeter Hessler
non-sensical. The dns lookups happened in the process routing table (usually '0'), which is very likely to have different results from the other routing domains. If you do depend on having this behaviour, you'll need to use pf to cross the rtable boundary. "listen on * rtable X" is still supported. Users of "server * rtable X" will need to switch to launching ntpd with "route -T X exec /usr/sbin/ntpd" OK deraadt@
2015-10-12Move execution of the constraints from the ntp to the parent process.Reyk Floeter
This helps the ntp process to a) give a better pledge(2) and to b) keep the promise of "saving the world again... on time" by removing the delays that have been introduced by expensive constraint forks. The new design offers better privsep but introduces a few more imsgs and runs a little bit more code in the privileged parent. The privileged code is minimal, carefully checked, and does not attempt to "parse" any contents; the forked constraints instantly drop all privileges and pledge to "stdio inet". OK beck@ deraadt@
2015-10-10pledge "dns rw" is not a reliable pattern. This means malloc() and otherTheo de Raadt
types of functions (perhaps required by 'stdio' or 'libevent' will not become available unless DNS suceeds. Replace it with "stdio dns".
2015-10-09the ntp engine can run with "stdio inet proc". For many reasons,Theo de Raadt
including fork/exec cost, it would be better if constraints were forked from the master process, which would then tell the ntp engine. That would increase accuracy and security. Lots of conversations with reyk and bcook
2015-10-09Once the constraint engine process is running, it only needsTheo de Raadt
"stdio inet". It took weeks to get to this point...
2015-10-09Change all tame callers to namechange to pledge(2).Theo de Raadt
2015-10-05this process deserves -fstack-protector-allTheo de Raadt
2015-10-03the ntp dns process only needs tame "dns rw" to operate. at least,Theo de Raadt
that's the case after kernel code got fixed to handle inet6 for dns...
2015-10-03In the ntpctl(1) case, after it has connect()'d to ntpd we can tame "stdio"Theo de Raadt
since that is all it will do till termination.
2015-09-10fix type and return check for tls_read/write.Bob Beck
jontly with jsing@
2015-09-10fix after libtls api changesBob Beck
ok jsing@
2015-09-09Fix memory leak in error path when max length exceeded.Todd C. Miller
From Michael McConville
2015-08-28Xr ntpctl; from Rob PierceTheo de Raadt
2015-08-14When checking whether we should scan the sensors again use <= ratherTodd C. Miller
than < for the comparison. Otherwise, if we don't do enough work in the loop to advance the clock (for instance if the network is down) we may end up calling poll() multiple times with no timeout, racking up CPU time for no real reason. OK bcook@
2015-07-18Handle short writes and TLS_{READ,WRITE}_AGAIN around tls_write().Alexander Bluhm
input doug@; OK beck@
2015-07-18prevent the tls constraint state machine from getting hung on STATE_INVALIDBrent Cook
patch from Mikolaj Kucharski ok deraadt@
2015-07-18replace _PATH_DEVNULL with "/dev/null", assume it will not moveBrent Cook
ok deraadt@ phessler@ claudio@
2015-07-18replace bzero with memsetBrent Cook
ok phessler@ deraadt@
2015-05-28detect crashes from constraint sub-processes, instead of ignoring them.Theo de Raadt
if this happens, we want to tear down all of ntpd, so that people will report it, any such bug can be found, and fixed. ok bcook
2015-05-25only scan sensors if they are configuredTheo de Raadt
ok bcook
2015-05-21No need to call tzset() and log_init() in the forked constraintReyk Floeter
handler. It is run in a chroot, so tzset() wouldn't even succeed to open the zone file. Found with tame. OK deraadt@
2015-05-20Remove hotplug(4) sensor support: the code has been disabled byReyk Floeter
henning@ 9 years ago because of an issue with the /dev/hotplug device - it does not support multiple readers opening it. Nobody ever cared enough to fix it so it is time to sent the dead code to the Attic. OK henning@ (feeling sad about it), mpi@ and others
2015-05-19Get the rdomain from the newly exposed ifi_rdomain field in if_dataReyk Floeter
instead of calling the SIOCGIFRDOMAIN ioctl for every single address. OK deraadt@
2015-05-18Currently, after 4 failed constraint checks, we suspect the constraintReyk Floeter
of being wrong, not the NTP responses, reset it and query it from all the constraint servers all over again. This is turned out to be a bit aggressive because it could get triggered with just a few bad NTP peers in a larger pool. To avoid constant reconnections, scale the error margin with the number of resolved NTP peers using peer_cnt * 4. This way a single or a few outliers in a NTP pool cannot trigger reconnecting to the constraint servers immediately. More NTP peers, less reason to mistrust the constraint. Found by dtucker@ OK deraadt@
2015-05-18Simplify example constraints URL to reduce load on the server side.Darren Tucker
ok henning@, reyk@
2015-05-17When resolving the "constraint" (singular), store all returned IPReyk Floeter
addresses and try one after another until the connection succeeded - based on the existing mechanism of "server". "constraint" previously only tried to connect to the first returned address, aborted and skipped the constraint on failure. In difference to "constraints" (plural), it still only connects to one address at a time and not to all of them at once. Pointed out by rpe@ OK rpe@ deraadt@
2015-04-21fix a memory leak if tls_read() fails. ok henning@Jonathan Gray
2015-03-28Avoid overflow on 32-bit time_t systems converting timeval to NTP time.Brent Cook
Original fix from Romuald Delavergne. ok henning@
2015-03-26do not encourage random uppercasing;Jason McIntyre
2015-03-24instead of routing SIGHUP thru sighdlr_dns() which then ignores it,Henning Brauer
ignore it directly. no functional change. Rafael Neves rafaelneves at gmail
2015-03-14remove unused 'cause' string when checking child statusBrent Cook
ok deraadt@
2015-03-14mention TLS HTTPS here also; ok bcookTheo de Raadt
2015-03-11-s is not optional, sadly;Jason McIntyre
while here i've reformatted the page to stop kidding that -s is 4 options; original issue kind of spotted by adam thompson, though note i am not fixing the issue he complained about (i'll address that mail in a minute);
2015-03-02remove unused variableBrent Cook
ok reyk@
2015-02-22Rename tls_config_insecure_noverifyhost() toJoel Sing
tls_config_insecure_noverifyname(), so that it is more accurate and keeps inline with the distinction between DNS hostname and server name. Requested by tedu@ during s2k15.
2015-02-22Set the TLS ciphers to "compat" mode, restoring the previous behaviour.Joel Sing
2015-02-17Fix library ordering on the link line for the sake of static arches. It's, inMiod Vallat
that order, tls, crypto, ssl.
2015-02-16some fixes from max fillinger, tweaked a little by myself;Jason McIntyre
ok reyk
2015-02-16Fix example, syntax is "constraint from www.example.com" (with "from").Reyk Floeter
Reported by Stefan Wollny.
2015-02-12Allow constraints URL without leading path (eg. "https://www.openbsd.org").Reyk Floeter
Fixes segfault on configuration load time, as reported by Donovan Watteau.
2015-02-12Use ntpd's deferred DNS resolving for constraints as well. ThisReyk Floeter
allows to get constraint addresses even if network/DNS is not available at startup (or system boot). thumbs up & OK henning@