Compare commits

...
214 Commits
Author SHA1 Message Date
Gordon Tetlow 12b769ed36 Add UPDATING entries and bump version.
Approved by:	so
2020-01-28 18:58:37 +00:00
Gordon Tetlow aa28411abc Fix kernel stack data disclosure
Reported by:	Ilja Van Sprundel
Approved by:	so
Security:	FreeBSD-SA-20:03.thrmisc
Security:	CVE-2019-15875
2020-01-28 18:57:45 +00:00
Gordon Tetlow 27bee646a4 Fix missing IPsec anti-replay window check
Reported by:	Jean-Francois HREN
Approved by:	so
Security:	FreeBSD-SA-20:02.ipsec
Security:	CVE-2019-5613
2020-01-28 18:56:46 +00:00
Gordon Tetlow 8540c2ad85 Fix libfetch buffer overflow
Reported by:	Duncan Overbruck
Approved by:	so
Security:	FreeBSD-SA-20:01.libfetch
Security:	CVE-2020-7450
2020-01-28 18:55:25 +00:00
Gordon Tetlow c905511eff Fix nmount invalid pointer dereference
Submitted by:	Andrew Turner
Approved by:	so
Security:	FreeBSD-EN-20:02.nmount
2020-01-28 18:54:15 +00:00
Gordon Tetlow 792e2e88f5 Fix imprecise ordering of SSP canary initialization
Submitted by:	Kyle Evans
Approved by:	so
Security:	FreeBSD-EN-20:01.ssp
2020-01-28 18:53:14 +00:00
Gordon Tetlow 916c699956 Add UPDATING entries and bump version numbers.
Approved by:	so
2019-11-12 18:13:51 +00:00
Gordon Tetlow 61ba71b7db Fix Machine Check Exception on Page Size Change.
Approved by:	so
Security:	FreeBSD-SA-19:25.mcepsc
Security:	CVE-2018-12207
2019-11-12 18:13:04 +00:00
Gordon Tetlow 003f54e19a Fix UEFI Loader Memory Fragmentation.
Approved by:	so
Security:	FreeBSD-EN-19:19.loader
2019-11-12 18:10:26 +00:00
Gordon Tetlow 21db5b26ff Import tzdata 2019c.
Approved by:	so
Security:	FreeBSD-EN-19:18.tzdata
2019-10-23 03:25:32 +00:00
Gordon Tetlow 7588ae58a1 Bump version information and add UPDATING entries.
Approved by:	so
2019-08-20 17:52:28 +00:00
Gordon Tetlow 5c2884c651 Fix reference count overflow in mqueuefs.
Approved by:	so
Security:	FreeBSD-SA-19:24.mqueuefs
Security:	CVE-2019-5603
2019-08-20 17:51:32 +00:00
Gordon Tetlow c09c4a2cc0 Fix kernel memory disclosure from /dev/midistat.
Approved by:	so
Security:	FreeBSD-SA-19:23.midi
Security:	CVE-2019-5612
2019-08-20 17:50:33 +00:00
Gordon Tetlow dbb9f166cc Fix IPv6 remote denial of service.
Approved by:	so
Security:	FreeBSD-SA-19:22.mbuf
Security:	CVE-2019-5611
2019-08-20 17:49:33 +00:00
Gordon Tetlow c7f7f6a134 Add bhyve instruction emulation improvements (opcode 03H and F7H).
Approved by:	so
Security:	FreeBSD-EN-19:16.bhyve
2019-08-20 17:45:44 +00:00
Gordon Tetlow f7498a0ec9 Bump version information and add UPDATING entries.
Approved by:	so
2019-08-06 17:14:09 +00:00
Gordon Tetlow 78d610aaa4 Fix insufficient validation of guest-supplied data (e1000 device).
Approved by:	so
Security:	FreeBSD-SA-19:21.bhyve
Security:	CVE-2019-5609
2019-08-06 17:13:17 +00:00
Gordon Tetlow a3f4653401 Fix insufficient message length validation in bsnmp library.
Approved by:	so
Security:	FreeBSD-SA-19:20.bsnmp
Security:	CVE-2019-5610
2019-08-06 17:12:17 +00:00
Gordon Tetlow a237cb55dd Fix ICMPv6 / MLDv2 out-of-bounds memory access.
Approved by:	so
Security:	FreeBSD-SA-19:19.mldv2
Security:	CVE-2019-5608
2019-08-06 17:11:17 +00:00
Gordon Tetlow 12a4559aa3 Fix multiple vulnerabilities in bzip2.
Approved by:	so
Security:	FreeBSD-SA-19:18.bzip2
Security:	CVE-2016-3189
Security:	CVE-2019-12900
2019-08-06 17:09:47 +00:00
Gordon Tetlow ca6c6484f8 Fix incorrect exception handling.
Approved by:	so
Security:	FreeBSD-EN-19:15.libunwind
2019-08-06 17:08:30 +00:00
Gordon Tetlow 0a6e9b50e8 Fix incorrect locking in epoch(9).
Approved by:	so
Security:	FreeBSD-EN-19:14.epoch
2019-08-06 17:07:43 +00:00
Gordon Tetlow 905120e81d Bump version information and update UPDATING.
Approved by:	so
2019-07-24 12:58:21 +00:00
Gordon Tetlow dcb5468627 Fix file descriptor reference count leak.
Approved by:	so
Security:	FreeBSD-SA-19:17.fd
Security:	CVE-2019-5607
2019-07-24 12:57:49 +00:00
Gordon Tetlow dbecd54401 Fix byhve out-of-bounds read in XHCI device.
Approved by:	so
Security:	FreeBSD-SA-19:16.bhyve
Security:	CVE-2019-5604
2019-07-24 12:56:06 +00:00
Gordon Tetlow f24f0dc9a1 Fix reference count overflow in mqueuefs.
Approved by:	so
Security:	FreeBSD-SA-19:15.mqueuefs
Security:	CVE-2019-5603
2019-07-24 12:55:16 +00:00
Gordon Tetlow 4260e8800e Fix pts write-after-free.
Approved by:	so
Security:	FreeBSD-SA-19:13.pts
Security:	CVE-2019-5606
2019-07-24 12:53:06 +00:00
Gordon Tetlow be12ff6b8f Fix multiple telnet client vulnerabilities.
Approved by:	so
Security:	FreeBSD-SA-19:12.telnet
Security:	CVE-2019-0053
2019-07-24 12:51:52 +00:00
Gordon Tetlow c6e684ee3c Fix panic from Intel CPU vulnerability mitigation.
Approved by:	so
Security:	FreeBSD-EN-19:13.mds
2019-07-24 12:50:46 +00:00
Gordon Tetlow 0546fa8290 Update UPDATING and bump newvers.sh
Approved by:	so
Approved by:	re (implicit)
2019-07-03 00:04:50 +00:00
Gordon Tetlow b52b8830a3 Fix privilege escalation in cd(4) driver.
Approved by:	so
Approved by:	re (implicit)
Security:	FreeBSD-SA-19:11.cd_ioctl
Security:	CVE-2019-5602
2019-07-03 00:03:55 +00:00
Gordon Tetlow 395cc3f57b Fix kernel stack disclosure in UFS/FFS.
Approved by:	so
Security:	FreeBSD-SA-19:10.ufs
Security:	CVE-2019-5601
2019-07-03 00:02:16 +00:00
Gordon Tetlow 3f0c9ee125 Fix iconv buffer overflow.
Approved by:	so
Approved by:	re (implicit)
Security:	FreeBSD-SA-19:09.iconv
2019-07-03 00:00:39 +00:00
Gordon Tetlow dbb965405c Import tzdata 2019b.
Approved by:	so
Approved by:	re (implicit)
Security:	FreeBSD-EN-19:12.tzdata
2019-07-02 23:59:45 +00:00
Gordon Tetlow 8221fc5642 Add UPDATING entries for today's release. Bump patch version.
Also fix the previous UPDATING entry. MDS was an SA, not an EN.

Approved by:	so
2019-06-19 16:44:07 +00:00
Gordon Tetlow bf30c02a92 Add ability to limit split map entries to prevent resource
exhaustion in non-default RACK TCP stack.

Approved by:	so
Security:	 FreeBSD-SA-19:08.rack
Security:	 CVE-2019-5599
2019-06-19 16:43:05 +00:00
Gordon Tetlow cdd2c870ec Fix incorrect locking in networking stack.
Approved by:	so
Security:	FreeBSD-EN-19:11.net
2019-06-19 16:41:18 +00:00
Gordon Tetlow d47a74a9ca Bump patch revision for updated mds patches.
Approved by:	so
2019-05-15 21:25:44 +00:00
Konstantin Belousov 26818e1bd4 Fix mismerge.
Pointy hat to:	kib
Tested by: so (emaste, gtetlow)
Approved by: so (emaste, gtetlow)
2019-05-15 20:44:27 +00:00
Gordon Tetlow 4f3ddec86b Bump newvers.sh and add UPDATING block.
Approved by:	so
2019-05-14 23:22:30 +00:00
Gordon Tetlow df1a10865d Mitigations for Microarchitectural Data Sampling.
Approved by:	so
Security:	FreeBSD-SA-19:07.mds
Security:	CVE-2018-12126
Security:	CVE-2018-12127
Security:	CVE-2018-12130
Security:	CVE-2019-11091
2019-05-14 23:19:08 +00:00
Gordon Tetlow 1867195966 Fix ICMP/ICMP6 packet filter bypass in pf.
Approved by:	so
Security:	FreeBSD-SA-19:06.pf
Security:	CVE-2019-5598
2019-05-14 23:12:22 +00:00
Gordon Tetlow f2dbf50589 Fix IPv6 fragment reassembly panic in pf
Approved by:	so
Security:	FreeBSD-SA-19:05.pf
Security:	CVE-2019-5597
2019-05-14 23:10:21 +00:00
Gordon Tetlow d7a4868097 Update ntpd to 4.2.8p13 to fix authenticated denial of service.
Approved by:	so
Security:	FreeBSD-SA-19:04.ntp
Security:	CVE-2019-8936
2019-05-14 23:02:56 +00:00
Gordon Tetlow 9584388bb5 Update hostapd/wpa_supplicant to 2.8 to fix multiple vulnerabilities.
Approved by:	so
Security:	FreeBSD-SA-19:03.wpa
Security:	CVE-2019-9494
Security:	CVE-2019-9495
Security:	CVE-2019-9496
Security:	CVE-2019-9497
Security:	CVE-2019-9498
Security:	CVE-2019-9499
Security:	CVE-2019-11555
2019-05-14 22:57:29 +00:00
Gordon Tetlow ceb3d18ec1 Fix insufficient filename validation in scp client
Approved by:	so
Security:	FreeBSD-EN-19:10.scp
2019-05-14 22:54:17 +00:00
Gordon Tetlow f92548dacd Fix partially matching relative paths in xinstall.
Approved by:	so
Security:	FreeBSD-EN-19:09.xinstall
2019-05-14 22:51:49 +00:00
Gordon Tetlow 23f6311f71 Import tzdata 2019a.
Approved by:	so
Security:	FreeBSD-EN-19:08.tzdata
2019-05-14 22:48:36 +00:00
Ed Maste 99f9f36c3d UPDATING and newvers entries for 12.0-p3
Approved by:	so
Security:	FreeBSD-SA-19:01.syscall
Security:	FreeBSD-SA-19:02.fd
Security:	FreeBSD-EN-19:06.dtrace
Security:	FreeBSD-EN-19:07.lle
2019-02-05 18:20:34 +00:00
Ed Maste 9eb177b6ac MFS12 r343785: Avoid leaking fp references when truncating SCM_RIGHTS
control messages.

Submitted by:	markj
Approved by:	so
Security:	CVE-2019-5596
2019-02-05 18:11:15 +00:00
Ed Maste 5b483a68e7 MFS12 r343781: amd64: clear callee-preserved registers on syscall exit
Submitted by:	kib
Approved by:	so
Security:	CVE-2019-5595
Security:	FreeBSD-SA-19:01.syscall
2019-02-05 18:05:05 +00:00
Ed Maste 9deaef450e MFS12 r343454: Fix an LLE lookup race
PR:		234296
Submitted by:	markj
Approved by:	so
2019-02-05 17:59:50 +00:00
Ed Maste c82caa6fa2 MFS12 r342267: dtrace: fix userspace access on boxes with SMAP
Approved by:	so
Sponsored by:	The FreeBSD Foundation
2019-02-05 17:54:09 +00:00
Ed Maste 8af468045d UPDATING and newvers entries for 12.0-p2
Approved by:	so
Security:	FreeBSD-EN-19:01.cc_cubic
Security:	FreeBSD-EN-19:02.tcp
Security:	FreeBSD-EN-19:03.sqlite
Security:	FreeBSD-EN-19:04.tzdata
2019-01-09 19:10:13 +00:00
Ed Maste 39fd024594 MFS12 r342667: Import tzdata 2018h, 2018i
Approved by:	so
Security:	FreeBSD-EN-19:04.tzdata
2019-01-09 18:53:35 +00:00
Ed Maste c145fc7abd MFS12 r342291: Update sqlite3-3.23.1 --> sqlite3-3.26.0 (3260000)
PR:		234113
Approved by:	so
Security:	FreeBSD-EN-19:03.sqlite
2019-01-09 18:47:10 +00:00
Ed Maste 7c93ae54ae MFS12 r342378: Fix a regression in the TCP handling of received segments.
When receiving TCP segments the stack protects itself by limiting
the resources allocated for a TCP connections. This patch adds
an exception to these limitations for the TCP segement which is the next
expected in-sequence segment. Without this patch, TCP connections
may stall and finally fail in some cases of packet loss.

Approved by:	so
Security:	FreeBSD-EN-19:02.tcp
2019-01-09 18:42:40 +00:00
Ed Maste 861ad1e92c MFS12 r342181: Revert CC Cubic: fix underflow for cubic_cwnd()
This change is causing TCP connections using cubic to hang. Need to dig
more to find exact cause and fix it.

Approved by:	so
Security:	FreeBSD-EN-19:01.cc_cubic
2019-01-09 18:38:35 +00:00
Ed Maste 8adcc0813f 12.0-RELEASE-p1 UPDATING
Approved by:	so
Security:	FreeBSD-SA-18:15.bootpd
2018-12-19 18:32:32 +00:00
Ed Maste 1a1dae24ce MFS12 r342228: bootpd: validate hardware type
Due to insufficient validation of network-provided data it may have been
possible for a malicious actor to craft a bootp packet which could cause
a stack buffer overflow.

admbugs:	850
Reported by:	Reno Robert
Reviewed by:	markj
Approved by:	so
Security:	FreeBSD-SA-18:15.bootpd
Sponsored by:	The FreeBSD Foundation
2018-12-19 18:21:07 +00:00
Glen Barber 4ba619efbd - Switch releng/12.0 from RC3 to RELEASE.
- Add the anticipated 12.0-RELEASE date to UPDATING.
- Set a static __FreeBSD_version.
- This one goes to 12.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2018-12-07 00:00:12 +00:00
Glen Barber 958cc17b94 MFS12 r341490, r341493:
r341490 (markj):
  MFC r341442, r341443:
  Plug memory disclosures via ptrace(2).

 r341493 (garga):
  MFC r341464:
  Restore /var/crash permissions to 0750, as declared in mtree file.
  After r337337 it changed to 0755.

As this would have otherwise been resolved as a post-release EN/SA
from so@, this does not warrant adding RC4 to the 12.0 schedule.

Approved by:	re (implicit), so
Sponsored by:	The FreeBSD Foundation
2018-12-05 19:16:12 +00:00
Gordon Tetlow 7120cc96ee Fix insufficient bounds checking in bhyve(8) device model. [SA-18:14.bhyve]
Submitted by:	jhb
Reported by:	Reno Robert
Approved by:	so
Approved by:	re (implicit)
Security:	FreeBSD-SA-18:14.bhyve
Security:	CVE-2018-17160
2018-12-04 18:38:03 +00:00
Glen Barber 47ca0d7d12 Update releng/12.0 from RC2 to RC3 as part of the 12.0-RELEASE
cycle.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2018-11-30 00:00:51 +00:00
Marius Strobl 132a9c6842 MFV: r341039, MFC: r341041, MF12: r341264
Import CK as of 21d3e319407d19dece16ee317c757ffc54a452bc, which makes its
sparcv9 atomics compatible with the FreeBSD kernel by using instructions
which access the appropriate address space.
Atomic operations within the kernel must access the nucleus address space
instead of the default primary one. Without this change but the increased
use of CK in the kernel, machines started to panic after some minutes of
uptime due to an unresolvable fault in ck_pr_cas_64_value().

Approved by:	re (gjb)
2018-11-29 22:00:20 +00:00
Marius Strobl 8935371200 MFC: r341016, MF12: r341261
- Add a belated UPDATING entry for the ixlv(4) -> iavf(4) rename in r339338.
- Likewise, add ixlv.4.gz to OLD_FILES,
- and link if_ixlv.ko to if_iavf.ko in order to aid a bit in the transition.

Approved by:	re (gjb)
2018-11-29 21:59:09 +00:00
Mark Johnston 952168d0cb MFstable/12 r341259:
Add some additional length checks to the IPv4 fragmentation code.

Approved by:	re (gjb)
2018-11-29 20:59:18 +00:00
Mark Johnston f2ade22c6c MFstable/12 r341250:
Fix age_old_log() after r337468.

PR:		233633
Approved by:	re (gjb)
2018-11-29 18:02:35 +00:00
Mark Johnston f140b6f6b2 MFstable/12 r341249:
Update the free page count when blacklisting pages.

Approved by:	re (gjb)
2018-11-29 17:54:03 +00:00
Mark Johnston f2464ec60c MFstable/12 r341238:
Plug routing sysctl leaks.

Approved by:	re (gjb)
2018-11-29 15:58:14 +00:00
Oleg Bulyzhin b7ff6145a6 MFS r341139:
MFC r340724:

Unbreak kernel build with VLAN_ARRAY defined.

Approved by:	re (gjb)
2018-11-29 15:26:07 +00:00
Yuri Pankov 1564e78e66 MFS12 r341168:
MFC r340974:
bectl: sync usage with man page, removing stray multibyte characters
in the process.

PR:             233526
Submitted by:   [email protected] (original version)
Reviewed by:    kevans
Approved by:	re (gjb)
Differential revision:  https://reviews.freebsd.org/D18335
2018-11-29 01:31:12 +00:00
Glen Barber d2400028d1 MFS12 r341167:
MFC r340983:
 Fix NTP query on GCE due to unresolved hostname.

PR:		232456
Submitted by:	Lucas Kanashiro
Approved by:	re (delphij)
Sponsored by:	The FreeBSD Foundation
2018-11-29 01:02:52 +00:00
Mark Johnston 3a2ceb530c MFstable/12 r341082:
Ensure that knotes do not get registered when KQ_CLOSING is set.

PR:		228858
Approved by:	re (gjb)
2018-11-28 18:06:16 +00:00
Mark Johnston c8a5b4f24b MFstable/12 r341077:
Lock the knlist before releasing the in-flux state in knote_fork().

PR:		228858
Approved by:	re (gjb)
2018-11-28 17:40:08 +00:00
Mark Johnston 80dcfd1eb4 MFstable/12 r341075:
Plug some kernel memory disclosures via kevent(2).

Approved by:	re (gjb)
2018-11-28 17:31:34 +00:00
Eric van Gyzen db07df555d MFS r341147
MFC r340995

Prevent kernel stack disclosure in signal delivery

On arm64 and riscv platforms, sendsig() failed to zero the signal
frame before copying it out to userspace.  Zero it.

On arm, I believe all the contents of the frame were initialized,
so there was no disclosure.  However, explicitly zero the whole frame
because that fact could inadvertently change in the future,
it's more clear to the reader, and I could be wrong in the first place.

Approved by:	re (gjb)
Security:	similar to FreeBSD-EN-18:12.mem and CVE-2018-17155
Sponsored by:	Dell EMC Isilon
2018-11-28 16:58:35 +00:00
Eric van Gyzen de76300dcd MFS r341146
MFC r340994

Prevent kernel stack disclosure in getcontext/swapcontext

Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc.

Approved by:	re (gjb)
Security:	FreeBSD-EN-18:12.mem
Security:	CVE-2018-17155
Sponsored by:	Dell EMC Isilon
2018-11-28 16:20:04 +00:00
Mark Johnston e9ed7ded6f MFstable/12 r340970:
Ensure that directory entry padding bytes are zeroed.

Approved by:	re (gjb)
2018-11-27 17:58:25 +00:00
Mark Johnston 60d38f079b MFstable/12 r340921:
Plug some networking sysctl leaks.

Approved by:	re (gjb)
2018-11-26 16:36:38 +00:00
Mark Johnston 50d8a8c2b6 MFstable/12 r340903:
Avoid unsynchronized updates to kn_status.

Approved by:	re (gjb)
2018-11-26 15:46:46 +00:00
Ed Maste 798fd2a5fc MFS12 r340849, r340850, r340851:
MFC r340661 (rmacklem):

r304026 added code that started statistics gathering for an operation
before the operation number (the variable called "op") was sanity checked.
This patch moves the code down to below the range sanity check for "op".

MFC r340662 (rmacklem):

nfsm_advance() would panic() when the offs argument was negative.
The code assumed that this would indicate a corrupted mbuf chain, but
it could simply be caused by bogus RPC message data.
This patch replaces the panic() with a printf() plus error return.

MFC r340663 (rmacklem):

Improve sanity checking for the dircount hint argument to
NFSv3's ReaddirPlus and NFSv4's Readdir operations. The code
checked for a zero argument, but did not check for a very large value.
This patch clips dircount at the server's maximum data size.

Approved by:	re (kib)
2018-11-23 21:08:11 +00:00
Glen Barber 2d134a34df - Update releng/12.0 from RC1 to RC2 as part of the 12.0-RELEASE
cycle.
- Update the dvd1.iso pkg(8) configuration to use the release_0
  package set to populate the dvd.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2018-11-23 16:32:27 +00:00
Mark Johnston 50f530b444 MFstable/12 r340788:
Clear pad bytes in the struct exported by kern.ntp_pll.gettime.

Approved by:	re (gjb)
2018-11-23 01:07:12 +00:00
Ed Maste 29acfe3f53 MF12 r340697: Introduce src.conf knob to build userland with retpoline
MFC r339511: Introduce src.conf knob to build userland with retpoline

WITH_RETPOLINE enables -mretpoline vulnerability mitigation in userland
for CVE-2017-5715.

MFC r340099: libcompat: disable retpoline when building build tools

These are built with the host toolchain which may not support retpoline.
While here, move the MK_ overrides to a separate line and sort them
alphabetically to support future changes.

MFC r340650: Avoid retpolineplt with static linking

Statically linked binaries linked with -zretpolineplt crash at startup
as lld produces a broken PLT.

MFC r340652: rescue: set NO_SHARED in Makefile

The rescue binary is built statically via the Makefile generated by
crunchgen, but that does not trigger other shared/static logic in
bsd.prog.mk - in particular

PR:		233336
Reported by:	Peter Malcom (r339511), Charlie Li (r340652)
Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2018-11-22 18:59:05 +00:00
Marius Strobl bf45cbe065 MFC: r340656, MF12: r340759
Given that the idea of D15374 was to "make memmove a first class citizen",
provide a _MEMMOVE extension of _MEMCPY that deals with overlap based on
the previous bcopy(9) implementation and use the former for bcopy(9) and
memmove(9). This addresses my D15374 review comment, avoiding extra MOVs
in case of memmove(9) and trashing the stack pointer.

Approved by:	re (kib)
2018-11-22 16:27:30 +00:00
Tijl Coosemans 3d0ff7a6fa MFS r340757:
Fix another user address dereference in linux_sendmsg syscall.

This was hidden behind the LINUX_CMSG_NXTHDR macro which dereferences its
second argument.  Stop using the macro as well as LINUX_CMSG_FIRSTHDR.  Use
the size field of the kernel copy of the control message header to obtain
the next control message.

PR:		217901
Approved by:	re (marius)
2018-11-22 13:12:17 +00:00
Tijl Coosemans 9321d6f091 MFS r340755:
Do proper copyin of control message data in the Linux sendmsg syscall.

Instead of calling m_append with a user address, allocate an mbuf cluster
and copy data into it using copyin.  For the SCM_CREDS case, instead of
zeroing a stack variable and appending that to the mbuf, zero part of the
mbuf cluster directly.  One mbuf cluster is also the size limit used by
the FreeBSD sendmsg syscall (uipc_syscalls.c:sockargs()).

PR:		217901
Reviewed by:	kib
Approved by:	re (marius)
2018-11-22 13:09:42 +00:00
Kyle Evans 803e875cdc MFC r340507-r340508, r340592-r340594, r340635-r340636: bectl(8) fixes
r340507:
libbe(3): rewrite init to support chroot usage

libbe(3) currently uses zfs_be_root and locates which of its children is
currently mounted at "/". This is reasonable, but not correct in the case of
a chroot, for two reasons:

- chroot root may be of a different zpool than zfs_be_root
- chroot root will not show up as mounted at "/"

Fix both of these by rewriting libbe_init to work from the rootfs down.
zfs_path_to_zhandle on / will resolve to the dataset mounted at the new
root, rather than the real root. From there, we can derive the BE root/pool
and grab the bootfs off of the new pool. This does no harm in the average
case, and opens up bectl to operating on different pools for scenarios where
one may be, for instance, updating a pool that generally gets re-rooted into
from a separate UFS root or zfs bootpool.

While here, I've also:
- Eliminated the check for /boot and / to be on the same partition. This
  leaves one open to a setup where /boot (and consequently, kernel/modules)
  are not included in the boot environment. This may very well be an
  intentional setup done by someone that knows what they're doing, we should
  not kill BE usage because of it.

- Eliminated the validation bits of BEs and snapshots that enforced
  'mountpoint' to be "/" -- this broke when trying to operate on an imported
  pool with an altroot, but we need not be this picky.

Reported by:	philip
Reviewed by:	philip, allanjude (previous version)
Tested by:	philip
Differential Revision:	https://reviews.freebsd.org/D18012

r340508:
libbe(3): Rewrite be_unmount to stop mucking with getmntinfo(2)

Go through the ZFS layer instead; given a BE, we can derive the dataset,
zfs_open it, then zfs_unmount. ZFS takes care of the dirty details and
likely gets it more correct than we did for more interesting setups.

r340592:
bectl(3)/libbe(3): Allow BE root to be specified

Add an undocumented -r option preceding the bectl subcommand to specify a BE
root to operate out of. This will remain undocumented for now, as some
caveats apply:

- BEs cannot be activated in the pool that doesn't contain the rootfs
- bectl create cannot work out of the box without the -e option right now,
  since it defaults to the rootfs and cross-pool cloning doesn't work like
  that (IIRC)

Plumb the BE root through to libbe(3) so that some things -can- be done to
it, e.g.

bectl -r tank/ROOT create -e default upgrade
bectl -r tank/ROOT mount upgrade /mnt

this aides in some upgrade setups where rootfs is not necessarily ZFS, and
also makes it easier/possible to regression-test bectl when combined with a
file-backed zpool.

Differential Revision:	https://reviews.freebsd.org/D18029

r340593:
libbe(3): Properly account for altroot when creating new BEs

Previously we would blindly copy the 'mountpoint' property, which includes
the altroot. The altroot needs to be snipped off prior to setting it on the
new BE, though, or you'll end up with a new BE and a mountpoint of /mnt with
altroot=/mnt

r340594:
bectl(8): Add some regression tests

These tests operate on a file-backed zpool that gets created in the kyua
temp dir. root and ZFS support are both required for these tests. Current
tests cover create, destroy, export/import, jail, list (kind of), mount,
rename, and jail.

List tests should later be extended to cover formatting and the different
list flags, but for now only covers basic "are create/destroy actually
reflected properly"

r340635:
libbe(3): Handle non-ZFS rootfs better

If rootfs isn't ZFS, current version will emit an error claiming so and fail
to initialize libbe. As a consumer, bectl -r (undocumented) can be specified
to operate on a BE independently of whether on a UFS or ZFS root.

Unbreak this for the UFS case by only erroring out the init if we can't
determine a ZFS dataset for rootfs and no BE root was specified. Consumers
of libbe should take care to ensure that rootfs is non-empty if they're
trying to use it, because this could certainly be the case.

Some check is needed before zfs_path_to_zhandle because it will
unconditionally emit to stderr if the path isn't a ZFS filesystem, which is
unhelpful for our purposes.

This should also unbreak the bectl(8) tests on a UFS root, as is the case in
Jenkins' -test runs.

r340636:
bectl(8) tests: attempt to load the ZFS module

Observed in a CI test image, bectl_create test will run and be marked as
skipped because the module is not loaded. The first zpool invocation will
automagically load the module, but bectl_create is still skipped. Subsequent
tests all pass as expected because the module is now loaded and everything
is OK.

Approved by:	re (gjb)
2018-11-22 04:39:06 +00:00
Marius Strobl e2e9732579 MFC: r340495, MF12: r340739
- Restore setting the clock for devices which support the default/legacy
  transfer mode only (lost with r321385). [1]
- Similarly, don't try to set the power class on MMC devices that comply
  to version 4.0 of the system specification but are operated in default/
  legacy transfer or 1-bit bus mode as no power class is specified for
  these cases. Trying to set a power class nevertheless resulted in an -
  albeit harmless - error message.

PR:		231713 [1]
Approved by:	re (gjb)
2018-11-21 19:49:21 +00:00
Mark Johnston 82bdcab53f MFstable/12 r340728:
Change dumpon(8)'s handling of -g.

Approved by:	re (gjb)
2018-11-21 17:47:40 +00:00
Stephen Hurd b5d49a47b1 MFS r340729:
Prevent POLA violation with TSO/CSUM offload

Ensure that any time CSUM_IP_TSO or CSUM_IP6_TSO is set that the corresponding
CSUM_IP6?_TCP / CSUM_IP flags are also set.

Approved by:	re (gjb)
Sponsored by:	Limelight Networks
2018-11-21 17:33:19 +00:00
Mark Johnston d9875e8a58 MFstable/12 r340727:
dumpon.8: Significantly revamp page

Approved by:	re (gjb)
2018-11-21 17:22:31 +00:00
Mateusz Guzik dbea3640aa MFC r340108 and r340149
hwpmc: limit wait for user callchain collection to 1 tick
Add aditional counter descriptions to AMD 0x17

Approved by:	re (rgrimes)
2018-11-21 03:22:37 +00:00
Jung-uk Kim 2d81533e22 MFC: r340714
Revert r340708.  Some files became symlinks and vice versa.

Approved by:	re (gjb)
2018-11-21 00:16:43 +00:00
Jung-uk Kim 129701749c MFC: r340705, r340708
Merge OpenSSL 1.1.1a.

Approved by:	re (gjb)
2018-11-20 23:07:45 +00:00
Renato Botelho 4ce81672e2 MFC r340439,r340440
Fix /etc/ntp permissions. According to mtree it must be 0700

Approved by:	re (gjb)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2018-11-20 20:31:23 +00:00
Mateusz Guzik e6d818ee28 MFC r339531,r339579,r340252,r340463,r340464,340472,r340587
amd64: tidy up memset to have rax set earlier for small sizes
amd64: finish the tail in memset with an overlapping store
amd64: align memset buffers to 16 bytes before using rep stos
amd64: convert libc bzero to a C func to avoid future bloat
amd64: sync up libc memset with the kernel version
amd64: handle small memset buffers with overlapping stores
Fix -DNO_CLEAN amd64 build after r340463

Approved by:	re (gjb)
2018-11-20 18:14:30 +00:00
Mark Johnston 53eccb9321 MFstable/12 r340680:
Handle kernel superpage mappings in pmap_remove_l2().

PR:		233088
Approved by:	re (gjb)
2018-11-20 17:43:24 +00:00
Brooks Davis af9e43fb5f MFS r340643:
MFC r340489-r340490

r340489:
Fix freebsd32 support for PCIOCGETCONF.

This fixes regresssions in pciconf -l and some ports as reported on
freebsd-current:

https://lists.freebsd.org/pipermail/freebsd-current/2018-November/072144.html

Reported by:	jbeich
Reviewed by:	kib (also proposed an idential patch)
Tested by:	jbeich
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D18011

r340490:
Fix stray tab.

Reported by:	jbeich
MFC with:	r340489
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D18011

Approved by:	re (gjb)
2018-11-20 00:43:14 +00:00
Stephen Hurd 5c8d70a512 MFS r340629
r340434:
Fix leaks caused by ifc_nhwtxqs never being initialized (broken by r333502)
and clear the last ring in the case where isc_nfl != isc_nrxqs

r340445:
Clear RX completion queue state variables in iflib_stop()

Approved by:	re (gjb)
Sponsored by:	Limelight Networks
2018-11-19 16:40:19 +00:00
Glen Barber 0fae320feb MFS12 r340630:
Remove debugging options from amd64 MINIMAL [1] and riscv GENERIC
 kernel configuration files.  This should have been turned off when
 stable/12 branched.

Submitted by:   Harry Schmalzbauer [1]
Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2018-11-19 15:49:39 +00:00
Konstantin Belousov 9ad3bf320c MFS r340603:
Allow set ether/vlan PCP operation from the VNET jails.

Approved by:	re (gjb)
2018-11-19 14:19:27 +00:00
Konstantin Belousov 56a1e41cc1 MFS r340605:
Align IA32_ARCH_CAP MSR definitions and use with SDM rev. 068.

Approved by:	re (gjb)
2018-11-19 13:59:11 +00:00
Mark Johnston d4919c7dba MFstable/12 r340498:
Hook mac_ntpd.4 up to the build.

PR:		232757
Approved by:	re (gjb)
2018-11-17 20:47:41 +00:00
Glen Barber f2a71a6821 MFS12 r340503:
Remove debugging options from arm, armv6, armv7 files included by
 GENERIC.  This should have been turned off when stable/12 branched.

Submitted by:   thompsa
Approved by:	re (rgrimes)
Sponsored by:	The FreeBSD Foundation
2018-11-17 20:11:20 +00:00
Glen Barber b9ffe52b79 - Copy stable/12@r340462 to releng/12.0 as part of the 12.0-RELEASE
cycle.
- Prune svn:mergeinfo from the new branch.
- Update from BETA4 to RC1.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2018-11-16 00:00:59 +00:00
Alan Somers 5c1fe75840 MFC r340314:
libjail: fix handling of allow.mount.fusefs in jailparam_init

fusefs is inconsistently named. The kernel module is named "fuse", but the
mount helper is named "mount_fusefs" and the jail(8) parameter is named
"allow.mount.fusefs". Special case it in libjail.

Reviewed by:	jamie
Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D17929
2018-11-15 19:06:07 +00:00
Vincenzo Maffione 03bc8eede4 MFC :r340436
vtnet: fix netmap support

netmap(4) support for vtnet(4) was incomplete and had multiple bugs.
This commit fixes those bugs to bring netmap on vtnet in a functional state.

Changelist:
  - handle errors returned by virtqueue_enqueue() properly (they were
    previously ignored)
  - make sure netmap XOR rest of the kernel access each virtqueue.
  - compute the number of netmap slots for TX and RX separately, according to
    whether indirect descriptors are used or not for a given virtqueue.
  - make sure sglist are freed according to their type (mbufs or netmap
    buffers)
  - add support for mulitiqueue and netmap host (aka sw) rings.
  - intercept VQ interrupts directly instead of intercepting them in txq_eof
    and rxq_eof. This simplifies the code and makes it easier to make sure
    taskqueues are not running for a VQ while it is in netmap mode.
  - implement vntet_netmap_config() to cope with changes in the number of queues.

Sponsored by:	Sunny Valley Networks
Differential Revision:	https://reviews.freebsd.org/D17916
Approved by: re (gjb)
2018-11-15 18:51:37 +00:00
Michael Tuexen 45e9405ea4 MFC r340361:
Fix printing of 64-bit counters on 32-bit ppc platforms.

Several statistic counters are uint64_t values and are printed by systat
using %lu. This results in displaying wrong numbers. Use PRIu64 instead.
While there, print variables of size_t using %zd.

Approved by:		re (gjb@)
Differential Revision:	https://reviews.freebsd.org/D17838
2018-11-15 17:25:32 +00:00
Glen Barber 21f383924e MFC r340406:
The roff ascii.gz documentation installed to /usr/share/doc
 was removed in r318881 when roff was removed from the base
 system.

 This results in the doc.txz distribution set containing a
 single directory (./) which is empty.

 Remove the "Additional documentation" option from the menu
 selection of bsdinstall(8), as the plain-text documentation
 installed in /usr/share/doc is installed as part of the
 packageworld target.

 The doc entry has not been removed from EXTRA_DISTRIBUTIONS
 in Makefile.inc1, in case its removal triggers an issue with
 freebsd-update(8), which is currently aware of the world/doc
 component, so the empty doc.txz continues to be created as
 a precaution.

Approved by:	re (rgrimes)
Sponsored by:	The FreeBSD Foundation
2018-11-15 16:42:59 +00:00
Kyle Evans 2210ae4965 MFC r340334: libbe(3): Set canmount properly when activating a new BE
The previously activated BE should have canmount=noauto set on it upon
activation of the new BE, but we previously did not touch canmount on either
old or new BE.

PR:		233113
Approved by:	re (gjb)
2018-11-15 16:03:52 +00:00
Eric van Gyzen cff60c178f MFC r340426 (by cem)
amdtemp(4): Fix temperature reporting on AMD 2990WX

Update the AMD family 17h temperature reporting based on AMD Tech Doc 56255
OSRR, section 4.2.1.

For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temperature into the
range -49..206; i.e., subtract 49°C.

Submitted by:	gallatin@
Reported by:	bcran@
Reviewed by:	cem (long ago)
Approved by:	re (kib)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D16855
2018-11-14 22:05:20 +00:00
Eric van Gyzen 0d094645f7 MFC r340425 (by cem)
amdsmn(4)/amdtemp(4): Attach to Ryzen 2 hostbridges

As reported, tested, and patch supplied by Johannes.

There may be future work to do to support multiple sensors, but for now, any
sensor at all is a strict improvement for Ryzen 2 systems.

PR:		228480
Submitted by:	Johannes Lundberg <johalun0 AT gmail.com> (earlier version)
Reported by:	deischen@, Johannes, and numerous others
Early MFC approved by:  cem
Approved by:    re (kib)
Relnotes:       yes
2018-11-14 21:31:26 +00:00
Stefan Eßer 8e85462800 MFC S340428: Prepare move of ctm from base to a port (misc/ctm) by:
- Adding a note to UPDATING
- Adding a note to the history section of the manpage ctm.1
- Adding a message printed to STDERR to the ctm program

This version is meant for release in FreeBSD-12.0 and should remain in
FreeBSD-12 over its life-time.

A follow-up commit will remove ctm from -CURRENT after the MFC to 12
has happened.

Approved by:    re
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D17969
2018-11-14 20:35:04 +00:00
Mark Johnston d18a8aa15d MFC r339927:
Add malloc_domainset(9) and _domainset variants to other allocator KPIs.

Approved by:	re (gjb)
2018-11-13 18:21:47 +00:00
Mark Johnston 24d81f89d0 MFC r340331:
Re-apply r336984, reverting r339934.

Approved by:	re (gjb)
2018-11-13 17:43:16 +00:00
Mark Johnston 5323d309df MFC r340313:
Ensure that IP fragments do not extend beyond IP_MAXPACKET.

Approved by:	re (gjb)
2018-11-13 17:25:34 +00:00
Mark Johnston 8d33352d0a MFC r339925:
Fix some problems that manifest when NUMA domain 0 is empty.

Approved by:	re (gjb)
2018-11-13 16:51:30 +00:00
Brooks Davis c2d6ce7fd2 Regen after r340388: MFC r340302: Fix freebsd32 mknod(at).
Approved by:	re (gjb, implicit)
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D17928
2018-11-12 21:53:47 +00:00
Brooks Davis 0f41ded533 MFC r340302:
Fix freebsd32 mknod(at).

As dev_t is now a 64-bit integer, it requires special handling as a
system call argument.  64-bit arguments are split between two 64-bit
integers due to the way arguments are promoted to allow reuse of most
system call implementations.  They must be reassembled before use.
Further, 64-bit arguments at an odd offset (counting from zero) are
padded and slid to the next slot on powerpc and mips.  Fix the
non-COMPAT11 system call by adding a freebsd32_mknodat() and
appropriately padded declerations.

The COMPAT11 system calls are fully compatible with the 64-bit
implementations so remove the freebsd32_ versions.

Use uint32_t consistently as the type of the old dev_t.  This matches
the old definition.

Reviewed by:	kib
Approved by:	re (gjb)
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D17928
2018-11-12 21:51:36 +00:00
Brooks Davis 47e7df3fe2 Regen after r340377: MFC r340272, r340274, r340294
r340272: Make __sysctl follow the freebsd32_foo convention.
r340274: Make freebsd32_umtx_op follow the freebsd32_foo convention.
r340294: Fix a number of bugs in freebsd32's capabilities.conf.

Approved by:	re (gjb, implicit)
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D17925
2018-11-12 18:23:51 +00:00
Brooks Davis 1c172d408a MFC r340272, r340274, r340294
r340272:
Make __sysctl follow the freebsd32_foo convention.

Sponsored by:	DARPA, AFRL

r340274:
Make freebsd32_umtx_op follow the freebsd32_foo convention.

Sponsored by:	DARPA, AFRL

r340294:
Fix a number of bugs in freebsd32's capabilities.conf.

Bugs range from failure to update after changing syscall implementaion
names to using the wrong name.  Somewhat confusingly, the name in
capabilities.conf is exactly the string that appears in syscalls.master,
not the name with a COMPAT* prefix which is the actual function name.

Found while making a change to use the default capabilities.conf.

Fixes:	r335177, r336980, r340272, r340274, others
Reviewed by:	kib, emaste
Approved by:	re (gjb)
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D17925
2018-11-12 18:21:17 +00:00
Bjoern A. Zeeb 4ea900c024 MFC r340251:
Update rum(4) and run(4) man pages to reflect that newer versions
  of TP-LINK TL-WN321G are run(4) and not rum(4) anymore.

  Reported by:	J (tech-lists zyxst.net)
Approved by:	re (kib)
2018-11-12 16:37:23 +00:00
Stephen Hurd d1db2aa912 MFC r340310:
Fix first-packet completion

The first packet after the ring is initialized was never
completed as isc_txd_credits_update() would not include it in the
count of completed packets. This caused netmap to never complete
a batch. See PR 233022 for more details.

PR:		233022
Reported by:	lev
Reviewed by:	lev
Approved by:	re (kib)
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D17931
2018-11-12 16:28:07 +00:00
Stephen Hurd 8d219159c7 MFC r340236:
Fix rxcsum issue introduced in r338838

r338838 attempted to fix issues with rxcsum and rxcsum6.
However, the rxcsum bits were set as though if_setcapenablebit() was
being called, not if_togglecapenable() which is in use. As a result,
it was not possible to disable rxcsum when rxcsum6 was supported.

PR:		233004
Reported by:	lev
Reviewed by:	lev
Approved by:	re (kib)
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D17881
2018-11-12 16:08:14 +00:00
Kyle Evans 5ccca965c2 MFC r340297: Use ${ECHO} in dtb/dtbo build, pass in from dtb.mk for -s
Approved by:	re (kib)
2018-11-12 15:18:09 +00:00
Hans Petter Selasky d4d9b85cce MFC r340248:
Don't read the USB audio sync endpoint when we don't use it to save
isochronous bandwidth.

Approved by:		re (kib)
Sponsored by:		Mellanox Technologies
2018-11-11 12:31:27 +00:00
Devin Teske af22b383fc MFC r339971: Add new rc keywords: enable, disable, delete
This adds new keywords to rc/service to enable/disable a service's
rc.conf(5) variable and "delete" to remove the variable.

When the "service_delete_empty" variable in rc.conf(5) is set to "YES"
(default is "NO") an rc.conf.d file (in /etc/ or /usr/local/etc) is
deleted if empty after modification using "service $foo delete".

Submitted by:	lme (modified)
Reviewed by:	0mp (previous version), lme, bcr
Approved by:	re (rgrimes)
Relnotes:	yes
Sponsored by:	Smule, Inc.
Differential Revision:	https://reviews.freebsd.org/D17113
2018-11-11 06:05:28 +00:00
Mark Johnston b42e561d6a MFC r340241:
Fix a use-after-free in swp_pager_meta_free().

Approved by:	re (gjb)
2018-11-10 20:36:48 +00:00
Mark Johnston 5027105905 MFC r339793:
Don't set NFSv4 ACL inheritance flags on non-directories.

PR:		155163
Approved by:	re (gjb)
2018-11-10 20:34:59 +00:00
Hans Petter Selasky 53bcdaef90 MFC r340212:
Sometimes the complete split packet may be queued too early and the
transaction translator will return a NAK. Ignore this message and
retry the complete split instead.

Approved by:		re (kib)
Sponsored by:		Mellanox Technologies
2018-11-10 10:30:01 +00:00
Hans Petter Selasky 977368147d MFC r340089:
Use correct type for IOCTL request argument.
This fixes signed IOCTL value warnings in uhsoctl().

Approved by:		re (kib)
Submitted by:		Marcin Cieslak <[email protected]>
Sponsored by:		Mellanox Technologies
2018-11-09 09:26:10 +00:00
Andrey V. Elsukov 19da555275 MFC r340100:
Do not use bzero() for the O_ICMP6TYPE opcode.

  The buffer is already zeroed in compile_rule() function, and also it
  may contain configured F_NOT flag in o.len field. This fixes the
  filling for "not icmp6types" opcode.

MFC r340175:
  Do not print "ip6" keyword in print_icmp6types() for O_ICMP6TYPE opcode.

  It produces incompatibility when rules listing is used again to
  restore saved ruleset, because "ip6" keyword produces separate opcode.
  The kernel already has the check and only IPv6 packets will be checked
  for matching.

PR:		232939
Approved by:	re (kib)
2018-11-09 08:14:47 +00:00
Glen Barber a04e071689 Update stable/12 from BETA3 to BETA4 as part of the 12.0-RELEASE
cycle.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2018-11-09 00:01:53 +00:00
John Baldwin 8406429759 MFC 340164,340168,340170: Add custom cpu_lock_delay() for x86.
340164:
Add a KPI for the delay while spinning on a spin lock.

Replace a call to DELAY(1) with a new cpu_lock_delay() KPI.  Currently
cpu_lock_delay() is defined to DELAY(1) on all platforms.  However,
platforms with a DELAY() implementation that uses spin locks should
implement a custom cpu_lock_delay() doesn't use locks.

340168:
Add a delay_tsc() static function for when DELAY() uses the TSC.

This uses slightly simpler logic than the existing code by using the
full 64-bit counter and thus not having to worry about counter
overflow.

340170:
Add a custom implementation of cpu_lock_delay() for x86.

Avoid using DELAY() since it can try to use spin locks on CPUs without
a P-state invariant TSC.  For cpu_lock_delay(), always use the TSC if
it exists (even if it is not P-state invariant) to delay for a
microsecond.  If the TSC does not exist, read from I/O port 0x84 to
delay instead.

PR:		228768
Approved by:	re (gjb)
2018-11-08 22:39:38 +00:00
Glen Barber 47a256af7a MFC r340260 (emaste):
Avoid buffer underwrite in icmp_error

 icmp_error allocates either an mbuf (with pkthdr) or a cluster depending
 on the size of data to be quoted in the ICMP reply, but the calculation
 failed to account for the additional padding that m_align may apply.

 Include the ip header in the size passed to m_align.  On 64-bit archs
 this will have the net effect of moving everything 4 bytes later in the
 mbuf or cluster.  This will result in slightly pessimal alignment for
 the ICMP data copy.

 Also add an assertion that we do not move m_data before the beginning of
 the mbuf or cluster.

Approved by:	re (kib)
Security:	CVE-2018-17156
Sponsored by:	The FreeBSD Foundation
2018-11-08 21:58:23 +00:00
Eric Joyner 84b28a1f9b MFC r340256: ixl/iavf(4): Fix TSO offloads when TXCSUM is disabled
Approved by: re (gjb@)
2018-11-08 21:36:45 +00:00
Tijl Coosemans a14a7bbbc3 MFC r340181, r340185:
On amd64 both Linux compat modules, linux.ko and linux64.ko, provide
linux_ioctl_(un)register_handler that allows other driver modules to
register ioctl handlers.  The ioctl syscall implementation in each Linux
compat module iterates over the list of handlers and forwards the call to
the appropriate driver.  Because the registration functions have the same
name in each module it is not possible for a driver to support both 32 and
64 bit linux compatibility.

Move the list of ioctl handlers to linux_common.ko so it is shared by
both Linux modules and all drivers receive both 32 and 64 bit ioctl calls
with one registration.  These ioctl handlers normally forward the call
to the FreeBSD ioctl handler which can handle both 32 and 64 bit.

Keep the special COMPAT_LINUX32 ioctl handlers in linux.ko in a separate
list for now and let the ioctl syscall iterate over that list first.
Later, COMPAT_LINUX32 support can be added to the 64 bit ioctl handlers
via a runtime check for ILP32 like is done for COMPAT_FREEBSD32 and then
this separate list would disappear again.  That is a much bigger effort
however and this commit is meant to be MFCable.

This enables linux64 support in x11/nvidia-driver*.

PR:		206711
Reviewed by:	kib
Approved by:	re (gjb)
2018-11-08 19:56:29 +00:00
Warner Losh 0dc238a663 MFC r340155: Assert locks held for async events.
Approved by:	re@ (gjb)
2018-11-08 14:21:25 +00:00
Kyle Evans 4532ac986d MFC r340040, r340152: lualoader boot-conf and chainload
r340040:
lualoader: Implement boot-conf

r340152:
lualoader: Add chainload menu entry

Approved by:	re (rgrimes)
2018-11-08 03:25:18 +00:00
Kyle Evans 12da6be5ad MFC r340146: Move pmc* bits behind MK_PMC to fix WITHOUT_PMC build
Approved by:	re (rgrimes)
2018-11-08 03:24:24 +00:00
Konstantin Belousov 934ea6ccb0 MFC r339892:
Clarify explanation of VFCF_SBDRY.

Approved by:	re (gjb)
2018-11-07 18:29:54 +00:00
Konstantin Belousov 6b05d8eac6 MFC r339896:
Initialize ifunc calling machinery earlier.

Approved by:	re (gjb)
2018-11-07 18:07:29 +00:00
Ed Maste 6b7a2785e2 MFC r340137: rtld: move relro enforcement after ifunc processing
Previously the combination of relro (implicit), -z now and ifunc use
resulted in a segfault when applying ifuncs after relro (test binary
here just calls amd64_get_fsbase()):

| % env LD_DEBUG=1 libexec/rtld-elf/obj/ld-elf.so.1 a.out
| ...
| enforcing main obj relro
| ...
| resolving ifuncs
| reloc_jmpslot: *0x203198 = 0x189368ea4570
| zsh: bus error (core dumped)  LD_DEBUG=1 obj/ld-elf.so.1 ~/a.out

Approved by:	re (gjb)
2018-11-07 18:04:19 +00:00
Konstantin Belousov 3abc4ff44e MFC r339979:
Add pci_early function to detect Intel stolen memory.

Approved by:	re (rgrimes)
2018-11-07 17:44:27 +00:00
Dag-Erling Smørgrav 03eb6a5667 MFH (r339812): add default value for local_unbound_tls
MFH (r339995): run unbound-anchor if root.key is empty (PR 232555)
MFH (r340037): turn off so-reuseport by default

Approved by:	re (gjb)
2018-11-07 16:22:18 +00:00
Stephen Hurd 81afa92400 MFC r339861:
Drain grouptaskqueue of the gtask before detaching it.

taskqgroup_detach() would remove the task even if it was running or
enqueued, which could lead to panics (see D17404). With this change,
taskqgroup_detach() drains the task and sets a new flag which prevents the
task from being scheduled again.

I've added grouptask_block() and grouptask_unblock() to allow control
over the flag from other locations as well.

Reviewed by:	Jeffrey Pieper <[email protected]>
Approved by:	re (kib)
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D17674
2018-11-06 20:46:00 +00:00
Andriy Gapon 87711319c5 MFC r339591: ichwd: add support for TCO watchdog timer in Lewisburg PCH (C620)
PR:		222079
Approved by:	re (rgrimes)
Relnotes:	maybe
Sponsored by:	Panzura
2018-11-06 17:31:09 +00:00
Glen Barber 607156d373 Switch the dvd1.iso pkg(8) configuration to use the quarterly
branch, now that the package sets are now available.  This
normally would have been after BETA1, however there were issues
preventing package builds to succeed.

Switch the default pkg(8) repository to the quarterly branch
as well, to prevent 'pkg upgrade' from downgrading packages
as the 12.0-RELEASE cycle progresses.

These changes will be reverted after releng/12.0 is branched.

This is a direct commit to stable/12.

MFC after:	2 weeks
MFC note:	fake MFC timeframe as a reminder to revert
Approved by:	re (delphij)
Sponsored by:	The FreeBSD Foundation
2018-11-05 21:28:32 +00:00
Kyle Evans 1ef5e7d56c MFC r339994: libbe(3): Don't promote non-cloned BEs
Most easily reproducible by attempting to activate the currently activated
BE, one would get a "not a cloned filesystem" error instead of success or a
sane message.

PR:		232488
Approved by:	re (gjb)
2018-11-05 18:12:41 +00:00
Kyle Evans ef5d846a47 MFC r339972: rescue: Add bectl(8)
Approved by:	re (gjb)
2018-11-05 18:11:38 +00:00
Bjoern A. Zeeb ae78f8f429 MFC r340009:
carpstats are the last virtualised variable in the file and end up at the
  end of the vnet_set.  The generated code uses an absolute relocation at
  one byte beyond the end of the carpstats array.  This means the relocation
  for the vnet does not happen for carpstats initialisation and as a result
  the kernel panics on module load.

  This problem has only been observed with carp and only on i386.
  We considered various possible solutions including using linker scripts
  to add padding to all kernel modules for pcpu and vnet sections.

  While the symbols (by chance) stay in the order of appearance in the file
  adding an unused non-file-local variable at the end of the file will extend
  the size of set_vnet and hence make the absolute relocation for carpstats
  work (think of this as a single-module set_vnet padding).

  This is a (tmporary) hack.  It is the least intrusive one as we need a
  timely solution for the upcoming release.  We will revisit the problem in
  HEAD.  For a lot more information and the possible alternate solutions
  please see the PR and the references therein.

PR:		230857
Approved by:	re (kib)
2018-11-04 06:25:07 +00:00
Michael Tuexen f18168af70 MFC r339914:
Bump the number of fans supported from 8 to 12.
The number of fans on a PowerMac7,3 with liquid cooling is 9.

Approved by:		re (kib@)
Reviewed by:		andreast@
Differential Revision:	https://reviews.freebsd.org/D17754
2018-11-03 20:35:39 +00:00
Glen Barber 9fd7c97b87 Update stable/12 from BETA2 to BETA3 as part of the 12.0-RELEASE
cycle.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2018-11-01 23:56:10 +00:00
Warner Losh c147f2f0a2 MFC: r339800 and r339802:
Fixes to ignore partial DEVICE_PATH items in  BOOT_PARAM objects that are
too short.

Approved by:	re@ (glen)
2018-11-01 21:28:22 +00:00
Kyle Evans 4c6e112e9f MFC r339849: lualoader: Fix try_include error handling
The previous iteration of try_include attempted to be 'friendly' and error()
out if we hit an error that wasn't ENOENT. This was semi-OK, but fragile as
it relied on pattern matching the error message.

Move the responsibility for handling failure to the caller. Following
a common lua pattern, we'll return the return value of the underlying
require() on success, or false and an error message.

Approved by:	re (gjb)
2018-11-01 17:37:20 +00:00
Mark Johnston 69d2f812fd MFC r339688:
Add an #include required after r339686.

Reported by:	lwhsu
Approved by:	re (gjb)
2018-11-01 17:36:42 +00:00
Mark Johnston 97fba7509b MFC r339616:
Make it possible to disable NUMA support with a tunable.

PR:		231460
Approved by:	re (gjb)
2018-11-01 16:50:19 +00:00
Mark Johnston 0401b2fb08 MFC r339686:
Use a vm_domainset iterator in keg_fetch_slab().

Approved by:	re (kib)
2018-11-01 16:00:00 +00:00
Hans Petter Selasky 711db39fec MFC r339924:
Implement the dump_stack() function in the LinuxKPI.

Approved by:		re (gjb)
Submitted by:		Johannes Lundberg <[email protected]>
Sponsored by:		Mellanox Technologies
2018-11-01 15:47:07 +00:00
Mark Johnston c643cd842c MFC r339661, r339669:
Refactor domainset iterators for use by malloc(9) and UMA.

Approved by:	re (gjb)
2018-11-01 15:19:36 +00:00
Hans Petter Selasky 48e4bb4379 MFC r339923:
Implement __KERNEL_DIV_ROUND_UP() function macro in the LinuxKPI.

Approved by:		re (kib)
Submitted by:		Johannes Lundberg <[email protected]>
Sponsored by:		Mellanox Technologies
2018-11-01 14:42:14 +00:00
Hans Petter Selasky bcd172012b MFC r339868:
Implement dma_pool_zalloc() in the LinuxKPI.

Approved by:		re (rgrimes)
Submitted by:		Johannes Lundberg <[email protected]>
Sponsored by:		Mellanox Technologies
2018-11-01 08:59:18 +00:00
Wei Hu 352fc1abf9 MFC r339585:
Do not drop UDP traffic when TXCSUM_IPV6 flag is on.

PR:		231797
Submitted by:	whu
Reviewed by:	dexuan
Obtained from:	Kevin Morse
Approved by:	re (rgrimes)
Sponsored by:	Microsoft
2018-11-01 08:08:08 +00:00
Glen Barber b6eaf36aa3 MFC r339873:
Set OPTIONS_UNSET in the argument list to env(1), and add
 AVAHI to the list.  This fixes the textproc/docproj build
 seemingly following FLAVORS being added.

 Specifically, the problem with the dependency chain here is:
 - textproc/docproj depends on print/cups, which sets AVAHI=on
   by default;
 - net/avahi-app depends on devel/gobject-introspection, which
   requires python3+;
 - graphics/netpbm depends on graphics/mesa-libs, which can
   only be built with python2.7;
 - textproc/docproj depends on a number of graphics ports for
   font rendering, etc.

MFC r339875:
 Pass _BRANCH in the reldoc target to ensure the correct
 src branch is used when generating the hardware.html page.

Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2018-10-31 23:54:36 +00:00
Kyle Evans fdc0a80de8 MFC r339677-r339678, r339702, r339805: Lualoader Bugfixes
r339677:
lualoader: unload upon kernel change if a kernel was previously loaded

In the majority of cases, a kernel is not loaded before we hit the menu.
However, if a password is set, we'll trigger autoboot and have loadelf'd
beforehand. We also need to take into account one dropping to the loader
prompt and twiddling with things manually; if they try to toggle through
kernels, we'll assume they mean it.

r339678:
menu.lua: Abort autoboot sequence on failed command

Currently, a timeout in the menu autoboot sequence would effectively do
nothing. We would return from the autoboot handling, then begin processing
the menu without redrawing it.

This change makes the behavior a little more friendly. Returning the user to
the menu can't have any good effects, so abort the autoboot sequence and
drop to the loader prompt.

r339702:
lualoader: Improve module loading diagnostics

Some fixes:

- Maintain historical behavior more accurately w.r.t verbose_loading;
  verbose_loading strictly prints "${module_name...}" and later "failed!"
  or "ok" based on load success
- With or without verbose_loading, dump command_errbuf on load failure.
  This usually happens prior to ok/failed if we're verbose_loading

r339805:
lualoader: Always return a proper dictionary for blacklist

If module_blacklist isn't specified, we have an empty blacklist; effectively
the same as if module_blacklist="" were specified in loader.conf(5).

This was reported when switching to a BE that predated the module_blacklist
introduction, but the problem is valid all the same and likely to be tripped
over in other scenarios.

Approved by:	re (kib)
2018-10-31 23:08:49 +00:00
Devin Teske f137a85e48 MFC r339843: Fix jail examples in jib, jng, README
Submitted by:	Ryan Moeller <[email protected]>
Reported by:	Ryan Moeller <[email protected]>
Approved by:	re (gjb)
Sponsored by:	Smule, Inc.
Differential Revision:	https://reviews.freebsd.org/D17697
2018-10-31 23:07:47 +00:00
Gleb Smirnoff c3102c342a MFhead r339643:
Fix ipw_start(), where logic was reverted in r287197.

PR		232554
Approved by:	re (kib)
2018-10-31 23:02:59 +00:00
Mark Johnston 702b7be467 MFC r339601, r339603:
Swap in processes unless there's a global memory shortage.

Approved by:	re (gjb)
2018-10-31 19:28:05 +00:00
Gleb Smirnoff c884ba7756 MFhead r339596:
If we lost race or were migrated during bucket allocation for the per-CPU
  cache, then we put new bucket on generic bucket cache. However, code didn't
  honor UMA_ZONE_NOBUCKETCACHE flag, so potentially we could start a cache
  on a zone that clearly forbids that. Fix this.

Approved by:	re (gjb)
2018-10-31 18:01:02 +00:00
Bjoern A. Zeeb 1259c0994a MFC r339931,r339933:
As a follow-up to r339930 (r339951 in stable/12) and various reports
   implement logging in case we fail during module load because the pcpu
   or vnet module sections are full.
   We did return a proper error but not leaving any indication to the
   user as to what the actual problem was.

   Even worse, on 12/13 currently we are seeing an unrelated error (ENOSYS
   instead of ENOSPC, which gets skipped over in kern_linker.c) to be
   printed which made problem diagnostics even harder.

PR:		228854

Approved by:	re (kib)
2018-10-31 14:03:48 +00:00
Bjoern A. Zeeb 4ba00f725a MFC r339930:
With more excessive use of modules, more kernel parts working with
   VIMAGE, and feature richness and global state increasing the 8k of
   vnet module space are no longer sufficient for people and loading
   multiple modules, e.g., pf(4) and ipl(4) or ipsec(4) will fail on
   the second module.

   Increase the module space to 8 * PAGE_SIZE which should be enough
   to hold multiple firewalls, ipsec, multicast (as in the old days was
   a problem), epair, carp, and any kind of other vnet enabled modules.

   Sadly this is a global byte array part of the vnet_set, so we cannot
   dynamically change its size;  otherwise a TUNABLE would have been
   a better solution.

PR:			228854
   Reported by:	Ernie Luzar, Marek Zarychta

Approved by:	re (kib)
2018-10-31 12:50:39 +00:00
Bjoern A. Zeeb 10b26c77fe MFC r339682:
rip6_input() inp validation after epoch(9)

  After r335924 rip6_input() needs inp validation to avoid
  working on FREED inps.

  Apply the relevant bits from r335497,r335501 (rip_input() change)
  to the IPv6 counterpart.

PR:			232194
  Reviewed by:	rgrimes, ae (,hps)

Approved by:	re (kib)
2018-10-31 12:49:18 +00:00
Bjoern A. Zeeb f0eb1c5531 MFC r339586:
In bhyve's fbuf emulation improve the overall "usage" message and
  for the vga option, rather than printing the entire option string,
  only print vga (as we do for everything else).

MFC r339681:

  Allow the bhyve VNC server to listen on IPv6 for incoming connections.

  Alternatively to IPv4 address:port this will allow to listen on IPv6
  link-local (incl. scope), a specific address, or ::.  Addresses have
  to be given in RFC2732 format so that [::]:port parsing will work.

  This patch also starts to introduce WITH_INET/INET6_SUPPORT to bhyve.

PR:			232018
  Submitted by:	Dave Rush (northwoodlogic.free gmail.com) (original)
  Reviewed by:	Dave Rush (updated verison)

Approved by:	re (kib)
2018-10-31 12:05:45 +00:00
Mark Johnston e9131f34b8 MFC r339452, r339664:
Create some global domainsets and refactor NUMA registration.

Approved by:	re (kib)
2018-10-31 02:02:12 +00:00
Philip Paeps 4209a7bf2a MFC r339848: mport tzdata 2018g
Approved by:	re (kib)
2018-10-31 01:57:51 +00:00
Mark Johnston 0f4e2de7c6 MFC r339934:
Revert r336984.

Approved by:	re (kib)
2018-10-30 23:09:04 +00:00
Xin LI 52584919e7 Restore backward compatibility for "attach" verb.
In r332361 and r333439, two new parameters were added to geli attach
verb using gctl_get_paraml, which requires the value to be present.
This would prevent old geli(8) binary from attaching geli(4) device
as they have no knowledge about the new parameters.

Restore backward compatibility by treating the absense of these two
values as seeing the default value supplied by userland.

PR:		232595
Reviewed by:	oshogbo
Approved by:	re (rgrimes)
2018-10-30 15:11:34 +00:00
Vincenzo Maffione f97f4e0b8f MFC r339685
netmap: add man page for the vale-ctl program

Added man page for vale-ctl program.
Small fixes to vale-ctl, including the support for -m option
(to specify the netmap memory allocator id).

Approved by:	re (rgrimes)
2018-10-30 14:25:16 +00:00
Vincenzo Maffione 95ff7e4bb5 MFC r339659:
netmap: add man page for the bridge program

Added bridge(8).
Also, minor fixes to the netmap "bridge" application:
 - indentation fixes and code cleanup
 - better usage description
 - better processing of netmap flags

Approved by:	re (rgrimes)
2018-10-30 10:01:15 +00:00
Vincenzo Maffione d740f83794 MFC r339639:
netmap: align codebase to the current upstream (sha 8374e1a7e6941)

Changelist:
    - Move large parts of VALE code to a new file and header netmap_bdg.[ch].
      This is useful to reuse the code within upcoming projects.
    - Improvements and bug fixes to pipes and monitors.
    - Introduce nm_os_onattach(), nm_os_onenter() and nm_os_onexit() to
      handle differences between FreeBSD and Linux.
    - Introduce some new helper functions to handle more host rings and fake
      rings (netmap_all_rings(), netmap_real_rings(), ...)
    - Added new sysctl to enable/disable hw checksum in emulated netmap mode.
    - nm_inject: add support for NS_MOREFRAG

Approved by: re (gjb)
2018-10-30 08:36:36 +00:00
Navdeep Parhar fbf40542f8 MFC r339626:
cxgbe(4): Use automatic cidx updates with ofld and ctrl queues.

The bits that explicitly request cidx updates do not work reliably with
all possible WRs that can be sent over the queue.  The F_FW_WR_EQUIQ
requests that still remain may also have to be replaced with explicit
credit flush WRs in the future.

Approved by:	re@ (rgrimes@)
Sponsored by:	Chelsio Communications
2018-10-30 05:04:18 +00:00
Michael Tuexen 5bb244b0a0 MFC r339869,r339870:
Remove empty line.

Reported by:	gjb@
Approved by:	re (gjb@)
2018-10-29 20:08:19 +00:00
Michael Tuexen 985f3e4c66 MFC r339791:
Add initial descriptions for SCTP related MIB variable.
This work was mostly done by Marie-Helene Kvello-Aune.

Approved by:		re (gjb)
Differential Revision:	https://reviews.freebsd.org/D3583
2018-10-29 19:01:47 +00:00
Hans Petter Selasky 44291434af MFC r339600:
Make sure returned value is checked and assert a valid refcount.
While at it fix a print: Unsigned types cannot be negative.

Reviewed by:		kib, mjg
Approved by:		re (gjb)
Differential revision:	https://reviews.freebsd.org/D17616
Sponsored by:		Mellanox Technologies
2018-10-29 14:06:20 +00:00
Hans Petter Selasky 860538b4fb MFC r339588:
Resolve deadlock between epoch(9) and various network interface
SX-locks, during if_purgeaddrs(), by not allowing to hold the epoch
read lock over typical network IOCTL code paths. This is a regression
issue after r334305.

Reviewed by:		ae (network)
Approved by:		re (kib)
Differential revision:	https://reviews.freebsd.org/D17647
Sponsored by:		Mellanox Technologies
2018-10-29 13:17:41 +00:00
Hans Petter Selasky a352cef971 MFC r339587:
Added support for formula-based arbitrary baud rates, in contrast to
the current fixed values, which enables use of rates above 1 Mbps.
Improved the detection of HXD chips, and the status flag handling as
well.

Submitted by:		Gabor Simon <[email protected]>
PR:			225932
Approved by:		re (kib)
Differential revision:	https://reviews.freebsd.org/D16639
Sponsored by:		Mellanox Technologies
2018-10-29 12:08:15 +00:00
Andrey V. Elsukov 5a4deb4db9 MFC r339740:
Use correct format specificator to print setdscp action.

  PR:		232642
Approved by:	re (rgrimes)
2018-10-28 18:21:14 +00:00
Vincenzo Maffione 91463af35f MFC r339548:
man: fix vale(4) port naming

The current documentation describing the syntax of a VALE port is wrong.
This patch fixes it to make it consistent.

Approved by:	re (gjb)
2018-10-28 07:50:15 +00:00
Cy Schubert daccc520c1 Follow up on r331936. gets_s(3) will also fail in the same way that
gets(3) does. This was missed in r331936.

Reported by:	emaste@
Approved by:	re (kib@)
2018-10-28 00:57:39 +00:00
Yuri Pankov 0a8c491e71 MFC r339489:
Add -b/-l options to localedef(1) to specify output endianness and use
it appropriately when building share/ctypedef and share/colldef.

This makes the resulting locale data in EL->EB (amd64->powerpc64) cross
build and in the native EB build match.  Revert the changes done to libc
in r308170 as they are no longer needed.

PR:             231965
Reviewed by:    bapt, emaste, sbruno, 0mp
Approved by:    re (gjb), kib (mentor)
Differential Revision:  https://reviews.freebsd.org/D17603
2018-10-27 21:17:01 +00:00
Justin Hibbits d5958b4d6d MFC r339514:
powerpcspe: Implement SPE exception handling

The Signal Processing Engine (SPE) found in Freescale e500 cores (and
others) offloads IEEE-754 compliance (NaN, Inf handling, overflow,
underflow) to software, most likely as a means of simplifying the APU
silicon.  Some software, like AbiWord, needs full IEEE-754 compliance,
including NaN handling.  Implement the necessary bits to enable it.

Approved by:	re(kib)
2018-10-27 03:16:32 +00:00
Andrey V. Elsukov 4982480b2e MFC r339532 (by glebius):
Fix exiting an epoch(9) we never entered. May happen only with MAC.

Approved by:	re (kib)
2018-10-26 10:20:03 +00:00
Glen Barber 5bd5b97bc2 Update stable/12 from BETA1 to BETA2 as part of the 12.0-RELEASE
cycle.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2018-10-26 00:00:13 +00:00
Glen Barber 347338d6cc MFC r339741:
Update SHLIB_VERSION_NUMBER following the OpenSSL shared library
 number bump.

Approved by:	re (bdrewery)
Sponsored by:	The FreeBSD Foundation
2018-10-25 19:57:42 +00:00
Brooks Davis 68742e0d2e MFC r339703:
Deprecate a number of less used 10 and 10/100 Ethernet devices.

The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe,
pcn, sf, sn, tl, tx, txp, vx, wb, xe

The list was defined as part of FCP-0101. Per the FCP, devices may be
removed from the deprecation list if enough users are found or they are
converted to iflib.

FCP:		https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Approved by:	re (gjb)
Reviewed by:	rgrimes
Differential Revision:	https://reviews.freebsd.org/D17654
2018-10-25 17:00:39 +00:00
Tijl Coosemans 6cbca952c3 MFC r339618:
Define linuxkpi readq for 64-bit architectures.  It is used by drm-kmod.
Currently the compiler picks up the definition in machine/cpufunc.h.

Add compiler memory barriers to read* and write*.  The Linux x86
implementation of these functions uses inline asm with "memory" clobber.
The Linux x86 implementation of read_relaxed* and write_relaxed* uses the
same inline asm without "memory" clobber.

Implement ioread* and iowrite* in terms of read* and write* so they also
have memory barriers.

Qualify the addr parameter in write* as volatile.

Like Linux, define macros with the same name as the inline functions.

Only define 64-bit versions on 64-bit architectures because generally
32-bit architectures can't do atomic 64-bit loads and stores.

Regroup the functions a bit and add brief comments explaining what they do:
- __raw_read*, __raw_write*: atomic, no barriers, no byte swapping
- read_relaxed*, write_relaxed*: atomic, no barriers, little-endian
- read*, write*: atomic, with barriers, little-endian

Add a comment that says our implementation of ioread* and iowrite*
only handles MMIO and does not support port IO.

Reviewed by:	hselasky
Approved by:	re (gjb)
2018-10-25 16:01:10 +00:00
Konstantin Belousov d33226f4dc MFC r339709:
Bump base OpenSSL libraries versions to avoid conflict with port's libraries.

Approved by:	re (gjb)
2018-10-25 15:49:59 +00:00
Warner Losh 271d3b9a5b MFC r339493: add wdc as an alias for wds
wdc is the preferred name for Western Digital. wds should never
have been committed in the first place. Add wdc as an alias for 12
and in 13 we'll retire the undocumented wds.

Approved by:	re@ (kib)
2018-10-25 15:35:12 +00:00
Ed Maste 868f48f109 MFC r339451: objcopy: restore behaviour required by GCC's build
In r339350 filter_reloc() was removed, to fix the case of stripping
statically linked binaries with relocations (which may come from ifunc
use, for example).  As a side effect this changed the behaviour when
stripping object files - the output was broken both before and after
r339350, in different ways.  Unfortunately GCC's build process relies
on the previous behaviour, so:

- Revert r339350, restoring filter_reloc().
- Fix an unitialized variable use (commited as r3638 in ELF Tool Chain).
- Change filter_reloc() to omit relocations referencing removed
  symbols, while retaining relocations with no symbol reference.
- Retain the entire relocation section if it references the dynamic
  symbol table (fix from kaiw in D17596).

PR:		232176
Approved by:	re (gjb, kib)
Sponsored by:	The FreeBSD Foundation
2018-10-25 15:18:54 +00:00
Glen Barber f757fe4a18 MFC r339684:
Reduce the GCE image size to 27G to be lower than the free
 quota limit.

PR:		232313
Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2018-10-25 15:11:18 +00:00
Hans Petter Selasky 20991c24d0 MFC r339582:
Drop sequencer mutex around uiomove() and make sure we don't move more bytes
than is available, else a panic might happen.

Found by:		Peter Holm <[email protected]>
Approved by:		re (rgrimes)
Sponsored by:		Mellanox Technologies
2018-10-25 14:53:24 +00:00
Slava Shwartsman 5956f49d94 MFC r339584:
mlx5: Notify user that the ConnectX-6 shutdown its port due to power limitation

If power exceed the slot limit, or slot limit is unknown the ConnectX-6
firmware will shutdown its port.
Inform the user via debug message.

Approved by:    re(rgrimes), hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies
2018-10-25 14:07:28 +00:00
Hans Petter Selasky 3865992e19 MFC r339581:
Fix off-by-one which can lead to panics.

Found by:		Peter Holm <[email protected]>
Approved by:		re (kib)
Sponsored by:		Mellanox Technologies
2018-10-25 12:27:16 +00:00
Warner Losh c905270a53 MFC: r339562 (remove obsolete drivers from GENERIC)
Remove the drivers we'd planned on removing from 12.x from GENERIC.

Approved by:	re@ (rgrimes@)
2018-10-25 05:18:25 +00:00
Devin Teske dedcd347d6 MFC r339509: Fix loader.conf(5) "password" feature
Restore the ability to prevent the user from interrupting the boot process
without first entering the password stored in loader.conf(5).

PR:		kern/207069
Reported by:	[email protected]
Approved by:	re (rgrimes)
Sponsored by:	Smule, Inc.
2018-10-24 23:13:53 +00:00
Kristof Provost 81c4c199a5 MFC r339547:
vlan: Fix panic with lagg and vlan

vlan_lladdr_fn() is called from taskqueue, which means there's no vnet context
set. We can end up trying to send ARP messages (through the iflladdr_event
event), which requires a vnet context.

PR:		227654
Approved by:	re (kib)
2018-10-24 17:32:31 +00:00
Glen Barber 6763b01834 Remove debug.witness.trace=0 from the installer sysctl.conf(5),
which should have been removed from stable/12 post-branch.

This is a direct commit to stable/12.

Reported by:	bdrewery
Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2018-10-23 16:24:26 +00:00
Warner Losh e68496f578 MFC 339475: improve drm messaging in driver and UPDATING
Approved by:	re@ (rgrimes)
2018-10-23 03:30:14 +00:00
Philip Paeps 4b34e3e645 MFC r339503: Import tzdata 2018f
Approved by:	re (kib)
2018-10-23 01:39:26 +00:00
Eugene Grosbein 1bf567ff00 MFC r339462: make upgrade from previous FreeBSD versions less painful
and make previously working configuration like this work again:

gif_interfaces="gif0"
gifconfig_gif0="1.1.1.1 2.2.2.2"
ifconfig_gif0="inet 192.168.1.1 192.168.1.2 netmask 255.255.255.252"

PR:		204700
Approved by:	re (gjb)
2018-10-22 17:27:36 +00:00
Glen Barber bf347bfd58 Uncomment -DNDEBUG in stable/12 after branching stable/12.
This edit was a mistake in head, and should have been applied
to stable/12 upon branching, not head.

This is a direct commit to stable/12.

Reported by:	jbeich, dim
Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2018-10-21 17:38:52 +00:00
Glen Barber f34e7e0e50 - Prune svn:mergeinfo from the new branch, as nothing has been merged
here.
- Remove debugging from GENERIC* kernel configurations
- Enable MALLOC_PRODUCTION
- Default dumpdev=NO
- Remove UPDATING entry regarding debugging features
- Switch 12.0 from -ALPHA10 to -BETA1 to prepare for builds.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2018-10-19 00:24:23 +00:00
1838 changed files with 167726 additions and 41680 deletions

No files matched your search

+19 -3
View File
@@ -659,7 +659,7 @@ BSARGS= DESTDIR= \
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
MK_LLDB=no MK_TESTS=no \
MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no \
MK_INCLUDES=yes
BMAKE= \
@@ -680,7 +680,7 @@ TMAKE= \
-DNO_LINT \
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
MK_LLDB=no MK_TESTS=no
MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no
# cross-tools stage
# TOOLS_PREFIX set in BMAKE
@@ -703,7 +703,7 @@ KTMAKE= \
SSP_CFLAGS= \
MK_HTML=no -DNO_LINT MK_MAN=no \
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no
-DNO_CPU_CFLAGS MK_RETPOLINE=no MK_WARNS=no MK_CTF=no
# world stage
WMAKEENV= ${CROSSENV} \
@@ -948,6 +948,13 @@ _cleanobj_fast_depend_hack: .PHONY
${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \
fi
.endfor
# 20181115 r340463 bzero reimplemented as .c
@if [ -e "${OBJTOP}/lib/libc/.depend.bzero.o" ] && \
egrep -qw 'bzero\.[sS]' ${OBJTOP}/lib/libc/.depend.bzero.o; then \
echo "Removing stale dependencies for bzero"; \
rm -f ${OBJTOP}/lib/libc/.depend.bzero.* \
${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.bzero.*}; \
fi
# 20181009 track migration from ntp's embedded libevent to updated one
@if [ -e "${OBJTOP}/usr.sbin/ntp/libntpevent/.depend.bufferevent_openssl.o" ] && \
egrep -q 'contrib/ntp/sntp/libevent/bufferevent_openssl.c' \
@@ -956,6 +963,14 @@ _cleanobj_fast_depend_hack: .PHONY
rm -f ${OBJTOP}/usr.sbin/ntp/libntpevent/.depend.*; \
fi
# 20181209 r341759 track migration across wpa update
@if [ -e "${OBJTOP}/usr.sbin/wpa/wpa_supplicant/.depend.rrm.o" ] && \
egrep -q 'src/ap/rrm.c' \
${OBJTOP}/usr.sbin/wpa/wpa_supplicant/.depend.rrm.o; then \
echo "Removing stale wpa dependencies"; \
rm -f ${OBJTOP}/usr.sbin/wpa/*/.depend*; \
fi
_worldtmp: .PHONY
@echo
@echo "--------------------------------------------------------------"
@@ -2383,6 +2398,7 @@ NXBMAKEARGS+= \
MK_OFED=no \
MK_OPENSSH=no \
MK_PROFILE=no \
MK_RETPOLINE=no \
MK_SENDMAIL=no \
MK_SVNLITE=no \
MK_TESTS=no \
+2 -1
View File
@@ -200,7 +200,8 @@ build${libcompat}: .PHONY
OBJTOP=${LIBCOMPAT_OBJTOP} \
OBJROOT='$${OBJTOP}/' \
MAKEOBJDIRPREFIX= \
DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS \
MK_CTF=no MK_RETPOLINE=no MK_WARNS=no \
${_t}
.endfor
.endfor
+9
View File
@@ -38,6 +38,13 @@
# xargs -n1 | sort | uniq -d;
# done
# 20181030: malloc_domain(9) KPI change
OLD_FILES+=share/man/man9/malloc_domain.9.gz
# 20181025: OpenSSL libraries version bump to avoid conflict with ports
OLD_LIBS+=lib/libcrypto.so.9
OLD_LIBS+=usr/lib/libssl.so.9
OLD_LIBS+=usr/lib32/libcrypto.so.9
OLD_LIBS+=usr/lib32/libssl.so.9
# 20181015: Stale libcasper(3) files following r329452
OLD_LIBS+=lib/casper/libcap_sysctl.so.0
OLD_LIBS+=lib/casper/libcap_grp.so.0
@@ -51,6 +58,8 @@ OLD_LIBS+=usr/lib32/libcap_pwd.so.0
OLD_LIBS+=usr/lib32/libcap_random.so.0
OLD_LIBS+=usr/lib32/libcap_dns.so.0
OLD_LIBS+=usr/lib32/libcap_syslog.so.0
# 20181012: rename of ixlv(4) to iavf(4)
OLD_FILES+=usr/share/man/man4/ixlv.4.gz
# 20181009: OpenSSL 1.1.1
OLD_FILES+=usr/include/openssl/des_old.h
OLD_FILES+=usr/include/openssl/dso.h
+210 -14
View File
@@ -16,20 +16,216 @@ from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to
the tip of head, and then rebuild without this option. The bootstrap process
from older version of current across the gcc/clang cutover is a bit fragile.
NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
FreeBSD 12.x has many debugging features turned on, in both the kernel
and userland. These features attempt to detect incorrect use of
system primitives, and encourage loud failure through extra sanity
checking and fail stop semantics. They also substantially impact
system performance. If you want to do performance measurement,
benchmarking, and optimization, you'll want to turn them off. This
includes various WITNESS- related kernel options, INVARIANTS, malloc
debugging flags in userland, and various verbose features in the
kernel. Many developers choose to disable these features on build
machines to maximize performance. (To completely disable malloc
debugging, define MALLOC_PRODUCTION in /etc/make.conf, or to merely
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
20200128 p13 FreeBSD-EN-20:01.ssp
FreeBSD-EN-20:02.nmount
FreeBSD-SA-20:01.libfetch
FreeBSD-SA-20:02.ipsec
FreeBSD-SA-20:03.thrmisc
Fix imprecise ordering of SSP canary initialization [EN-20:01.ssp]
Fix nmount invalid pointer dereference [EN-20:02.nmount]
Fix libfetch buffer overflow [SA-20:01.libfetch]
Fix missing IPsec anti-replay window check [SA-20:02.ipsec]
Fix kernel stack data disclosure [SA-20:03.thrmisc]
20191112 p12 FreeBSD-EN-19:19.loader
FreeBSD-SA-19:25.mcepsc
Fix UEFI Loader Memory Fragmentation [EN-19:19.loader]
Fix Machine Check Exception on Page Size Change [SA-19:25.mcepsc]
20191023 p11 FreeBSD-EN-19:18.tzdata
Import tzdata 2019c. [EN-19:18.tzdata]
20190820 p10 FreeBSD-EN-19:16.bhyve
FreeBSD-SA-19:22.mbuf
FreeBSD-SA-19:23.midi
FreeBSD-SA-19:24.mqueuefs
Bhyve instruction emulation improvements (opcode 03H and F7H).
[EN-19:16.bhyve]
Fix IPv6 remote denial of service. [SA-19:22.mbuf]
Fix kernel memory disclosure from /dev/midistat. [SA-19:23.midi]
Fix reference count overflow in mqueuefs. [SA-19:24.mqueuefs]
20190806 p9 FreeBSD-EN-19:14.epoch
FreeBSD-EN-19:15.libunwind
FreeBSD-SA-19:18.bzip2
FreeBSD-SA-19:19.mldv2
FreeBSD-SA-19:20.bsnmp
FreeBSD-SA-19:21.bhyve
Fix incorrect locking in epoch(9). [EN-19:14.epoch]
Fix incorrect exception handling. [EN-19:15.libunwind]
Fix multiple vulnerabilities in bzip2. [SA-19:18.bzip2]
Fix ICMPv6 / MLDv2 out-of-bounds memory access. [SA-19:19.mldv2]
Fix insufficient message length validation in bsnmp library.
[SA-19:20.bsnmp]
Fix insufficient validation of guest-supplied data (e1000 device).
[SA-19:21.bhyve]
20190724 p8 FreeBSD-EN-19:13.mds
FreeBSD-SA-19:12.telnet
FreeBSD-SA-19:13.pts
FreeBSD-SA-19:15.mqueuefs
FreeBSD-SA-19:16.bhyve
FreeBSD-SA-19:17.fd
Fix panic from Intel CPU vulnerability mitigation. [EN-19:13.mds]
Fix multiple telnet client vulnerabilities. [SA-19:12.telnet]
Fix pts write-after-free. [SA-19:13.pts]
Fix reference count overflow in mqueuefs. [SA-19:15.mqueuefs]
Fix byhve out-of-bounds read in XHCI device. [SA-19:16.bhyve]
Fix file descriptor reference count leak. [SA-19:17.fd]
20190702 p7 FreeBSD-EN-19:12.tzdata
FreeBSD-SA-19:09.iconv
FreeBSD-SA-19:10.ufs
FreeBSD-SA-19:11.cd_ioctl
Import tzdata 2019b. [EN-19:12.tzdata]
Fix iconv buffer overflow. [SA-19:09.iconv]
Fix kernel stack disclosure in UFS/FFS. [SA-19:10.ufs]
Fix privilege escalation in cd(4) driver. [SA-19:11.cd_ioctl]
20190619 p6 FreeBSD-EN-19:11.net
FreeBSD-SA-19:08.rack
Fix incorrect locking in networking stack [EN-19:11.net]
Add ability to limit split map entries to prevent resource exhaustion
in non-default RACK TCP stack [SA-19:08.rack]
20190515 p5 FreeBSD-SA-19:07.mds [revised]
Fixed error in patch causing panic on i386 architecture. [SA-19:07.mds]
20190514 p4 FreeBSD-EN-19:08.tzdata
FreeBSD-EN-19:09.xinstall
FreeBSD-EN-19:10.scp
FreeBSD-SA-19:03.wpa
FreeBSD-SA-19:04.ntp
FreeBSD-SA-19:05.pf
FreeBSD-SA-19:06.pf
FreeBSD-SA-19:07.mds
Import tzdata 2019a. [EN-19:08.tzdata]
Fix install with partially matching relative paths. [EN-19:09.xinstall]
Fix filename validation in scp. [EN-19:10.scp]
Fix multiple vulnerabilities in hostapd/wpa_supplicant. [SA-19:03.wpa]
Fix authenticated denial of service in ntpd. [SA-19:04.ntp]
Fix IPv6 fragment reassembly in pf. [SA-19:05.pf]
Fix ICMP/ICMP6 packet filter bypass in pf. [SA-19:06.pf]
Add mitigations for Microarchitectural Data Sampling. [SA-19:07.mds]
20190205: p3 FreeBSD-SA-19:01.syscall
FreeBSD-SA-19:02.fd
FreeBSD-EN-19:06.dtrace
FreeBSD-EN-19:07.lle
amd64: clear callee-preserved registers on syscall exit
[SA-19:01.syscall]
Avoid leaking fp references when truncating SCM_RIGHTS control messages.
[SA-19:02.fd]
dtrace: fix userspace access on boxes with SMAP [EN-19:06.dtrace]
Fix an LLE lookup race [EN-19:07.lle]
20190109: p2 FreeBSD-EN-19:01.cc_cubic
FreeBSD-EN-19:02.tcp
FreeBSD-EN-19:03.sqlite
FreeBSD-EN-19:04.tzdata
Revert CC Cubic: fix underflow for cubic_cwnd() [EN-19:01.cc_cubic]
Fix a TCP handling of received segments. [EN-19:02.tcp]
Update sqlite3-3.23.1 --> sqlite3-3.26.0 (3260000) [EN-19:03.sqlite]
Import tzdata 2018h, 2018i [EN-19:04.tzdata]
20181219: p1 FreeBSD-SA-18:15.bootpd
bootpd: validate hardware type [SA-18:15.bootpd]
20181211:
12.0-RELEASE.
20181115:
The set of CTM commands (ctm, ctm_smail, ctm_rmail, ctm_dequeue)
has been converted to a port (misc/ctm) and will be removed from
FreeBSD-13. A depreciation warning will be printed to stderr by
the ctm command, but the functionality will remain in base for all
FreeBSD-12 releases.
20181019:
The stable/12 branch has been created in subversion from head
revision r339432.
20181015:
Ports for the DRM modules have been simplified. Now, amd64 users should
just install the drm-kmod port. All others should install
drm-legacy-kmod.
Graphics hardware that's newer than about 2010 usually works with
drm-kmod. For hardware older than 2013, however, some users will need
to use drm-legacy-kmod if drm-kmod doesn't work for them. Hardware older
than 2008 usually only works in drm-legacy-kmod. The graphics team can
only commit to hardware made since 2013 due to the complexity of the
market and difficulty to test all the older cards effectively. If you
have hardware supported by drm-kmod, you are strongly encouraged to use
that as you will get better support.
Other than KPI chasing, drm-legacy-kmod will not be updated. As outlined
elsewhere, the drm and drm2 modules will be eliminated from the src base
soon (with a limited exception for arm). Please update to the package asap
and report any issues to [email protected].
Generally, anybody using the drm*-kmod packages should add
WITHOUT_DRM_MODULE=t and WITHOUT_DRM2_MODULE=t to avoid nasty
cross-threading surprises, especially with automatic driver
loading from X11 startup. These will become the defaults in 13-current
shortly.
20181012:
The ixlv(4) driver has been renamed to iavf(4). As a consequence,
custom kernel and module loading configuration files must be updated
accordingly. Moreover, interfaces previous presented as ixlvN to the
system are now exposed as iavfN and network configuration files must
be adjusted as necessary.
20181009:
OpenSSL has been updated to version 1.1.1. This update included
+3 -1
View File
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd April 10, 2018
.Dd October 26, 2018
.Dt SETFACL 1
.Os
.Sh NAME
@@ -136,6 +136,8 @@ option is specified, no symbolic links are followed.
This is the default.
.It Fl R
Perform the action recursively on any specified directories.
When modifying or adding NFSv4 ACL entries, inheritance flags
are applied only to directories.
.It Fl x Ar entries | position
If
.Ar entries
+68 -13
View File
@@ -27,9 +27,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/acl.h>
#include <sys/queue.h>
@@ -73,6 +71,7 @@ static bool need_mask;
static acl_type_t acl_type = ACL_TYPE_ACCESS;
static int handle_file(FTS *ftsp, FTSENT *file);
static acl_t clear_inheritance_flags(acl_t acl);
static char **stdin_files(void);
static void usage(void);
@@ -124,10 +123,57 @@ stdin_files(void)
return (files_list);
}
/*
* Remove any inheritance flags from NFSv4 ACLs when running in recursive
* mode. This is to avoid files being assigned identical ACLs to their
* parent directory while also being set to inherit them.
*
* The acl argument is assumed to be valid.
*/
static acl_t
clear_inheritance_flags(acl_t acl)
{
acl_t nacl;
acl_entry_t acl_entry;
acl_flagset_t acl_flagset;
int acl_brand, entry_id;
(void)acl_get_brand_np(acl, &acl_brand);
if (acl_brand != ACL_BRAND_NFS4)
return (acl);
nacl = acl_dup(acl);
if (nacl == NULL) {
warn("acl_dup() failed");
return (acl);
}
entry_id = ACL_FIRST_ENTRY;
while (acl_get_entry(nacl, entry_id, &acl_entry) == 1) {
entry_id = ACL_NEXT_ENTRY;
if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
warn("acl_get_flagset_np() failed");
continue;
}
if (acl_get_flag_np(acl_flagset, ACL_ENTRY_INHERIT_ONLY) == 1) {
if (acl_delete_entry(nacl, acl_entry) != 0)
warn("acl_delete_entry() failed");
continue;
}
if (acl_delete_flag_np(acl_flagset,
ACL_ENTRY_FILE_INHERIT |
ACL_ENTRY_DIRECTORY_INHERIT |
ACL_ENTRY_NO_PROPAGATE_INHERIT) != 0)
warn("acl_delete_flag_np() failed");
}
return (nacl);
}
static int
handle_file(FTS *ftsp, FTSENT *file)
{
acl_t acl;
acl_t acl, nacl;
acl_entry_t unused_entry;
int local_error, ret;
struct sf_entry *entry;
@@ -193,17 +239,20 @@ handle_file(FTS *ftsp, FTSENT *file)
/* Cycle through each option. */
TAILQ_FOREACH(entry, &entrylist, next) {
if (local_error)
continue;
switch(entry->op) {
nacl = entry->acl;
switch (entry->op) {
case OP_ADD_ACL:
local_error += add_acl(entry->acl, entry->entry_number,
&acl, file->fts_path);
if (R_flag && file->fts_info != FTS_D &&
acl_type == ACL_TYPE_NFS4)
nacl = clear_inheritance_flags(nacl);
local_error += add_acl(nacl, entry->entry_number, &acl,
file->fts_path);
break;
case OP_MERGE_ACL:
local_error += merge_acl(entry->acl, &acl,
file->fts_path);
if (R_flag && file->fts_info != FTS_D &&
acl_type == ACL_TYPE_NFS4)
nacl = clear_inheritance_flags(nacl);
local_error += merge_acl(nacl, &acl, file->fts_path);
need_mask = true;
break;
case OP_REMOVE_EXT:
@@ -240,8 +289,7 @@ handle_file(FTS *ftsp, FTSENT *file)
need_mask = false;
break;
case OP_REMOVE_ACL:
local_error += remove_acl(entry->acl, &acl,
file->fts_path);
local_error += remove_acl(nacl, &acl, file->fts_path);
need_mask = true;
break;
case OP_REMOVE_BY_NUMBER:
@@ -250,6 +298,13 @@ handle_file(FTS *ftsp, FTSENT *file)
need_mask = true;
break;
}
if (nacl != entry->acl) {
acl_free(nacl);
nacl = NULL;
}
if (local_error)
break;
}
/*
+5
View File
@@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_len_t *len)
*len = *b->asn_cptr++;
b->asn_len--;
}
if (*len > b->asn_len) {
asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len);
return (ASN_ERR_EOBUF);
}
return (ASN_ERR_OK);
}
+15 -2
View File
@@ -2,8 +2,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -325,3 +325,16 @@ Security fix only. Fixes CERT-FI 20469 as it applies to bzip2.
Izdebski.
* Make the documentation build on Ubuntu 10.04
1.0.7 (27 Jun 19)
~~~~~~~~~~~~~~~~~
* Fix undefined behavior in the macros SET_BH, CLEAR_BH, & ISSET_BH
* bzip2: Fix return value when combining --test,-t and -q.
* bzip2recover: Fix buffer overflow for large argv[0]
* bzip2recover: Fix use after free issue with outFile (CVE-2016-3189)
* Make sure nSelectors is not out of range (CVE-2019-12900)
+2 -2
View File
@@ -36,7 +36,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, jseward@bzip.org
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Julian Seward, jseward@acm.org
bzip2/libbzip2 version 1.0.7 of 27 June 2019
--------------------------------------------------------------------------
+8 -28
View File
@@ -6,8 +6,8 @@ This version is fully compatible with the previous public releases.
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in this file.
@@ -73,7 +73,7 @@ HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc.
It's difficult for me to support compilation on all these platforms.
My approach is to collect binaries for these platforms, and put them
on the master web site (http://www.bzip.org). Look there. However
on the master web site (https://sourceware.org/bzip2/). Look there. However
(FWIW), bzip2-1.0.X is very standard ANSI C and should compile
unmodified with MS Visual C. If you have difficulties building, you
might want to read README.COMPILATION.PROBLEMS.
@@ -161,43 +161,22 @@ WHAT'S NEW IN 0.9.5 ?
* Many small improvements in file and flag handling.
* A Y2K statement.
WHAT'S NEW IN 1.0.0 ?
WHAT'S NEW IN 1.0.x ?
See the CHANGES file.
WHAT'S NEW IN 1.0.2 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.3 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.4 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.5 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.6 ?
See the CHANGES file.
I hope you find bzip2 useful. Feel free to contact me at
jseward@bzip.org
jseward@acm.org
if you have any suggestions or queries. Many people mailed me with
comments, suggestions and patches after the releases of bzip-0.15,
bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1,
1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this
feedback. I thank you for your comments.
bzip2's "home" is http://www.bzip.org/
bzip2's "home" is https://sourceware.org/bzip2/
Julian Seward
jseward@bzip.org
jseward@acm.org
Cambridge, UK.
18 July 1996 (version 0.15)
@@ -213,3 +192,4 @@ Cambridge, UK.
20 December 2006 (bzip2, version 1.0.4)
10 December 2007 (bzip2, version 1.0.5)
6 Sept 2010 (bzip2, version 1.0.6)
27 June 2019 (bzip2, version 1.0.7)
+3 -3
View File
@@ -2,8 +2,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -12,7 +12,7 @@ This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------
bzip2-1.0.6 should compile without problems on the vast majority of
bzip2 should compile without problems on the vast majority of
platforms. Using the supplied Makefile, I've built and tested it
myself for x86-linux and amd64-linux. With makefile.msc, Visual C++
6.0 and nmake, you can build a native Win32 version too. Large file
+5 -5
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -202,9 +202,9 @@ void fallbackQSort3 ( UInt32* fmap,
bhtab [ 0 .. 2+(nblock/32) ] destroyed
*/
#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31))
#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31))
#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31)))
#define SET_BH(zz) bhtab[(zz) >> 5] |= ((UInt32)1 << ((zz) & 31))
#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~((UInt32)1 << ((zz) & 31))
#define ISSET_BH(zz) (bhtab[(zz) >> 5] & ((UInt32)1 << ((zz) & 31)))
#define WORD_BH(zz) bhtab[(zz) >> 5]
#define UNALIGNED_BH(zz) ((zz) & 0x01f)
+4 -4
View File
@@ -1,6 +1,6 @@
.TH bzip2 1
.SH NAME
bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6
bzip2, bunzip2 \- a block-sorting file compressor, v1.0.7
.br
bzcat \- decompresses files to stdout
.br
@@ -404,7 +404,7 @@ I/O error messages are not as helpful as they could be.
tries hard to detect I/O errors and exit cleanly, but the details of
what the problem is sometimes seem rather misleading.
This manual page pertains to version 1.0.6 of
This manual page pertains to version 1.0.7 of
.I bzip2.
Compressed data created by this version is entirely forwards and
backwards compatible with the previous public releases, versions
@@ -426,9 +426,9 @@ with MaybeUInt64 set to be an unsigned 64-bit integer.
.SH AUTHOR
Julian Seward, jsewardbzip.org.
Julian Seward, jseward@acm.org.
http://www.bzip.org
https://sourceware.org/bzip2/
The ideas embodied in
.I bzip2
+16 -14
View File
@@ -7,8 +7,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -554,7 +554,7 @@ static
Bool testStream ( FILE *zStream )
{
BZFILE* bzf = NULL;
Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i;
Int32 bzerr, bzerr_dummy, ret, streamNo, i;
UChar obuf[5000];
UChar unused[BZ_MAX_UNUSED];
Int32 nUnused;
@@ -577,7 +577,7 @@ Bool testStream ( FILE *zStream )
streamNo++;
while (bzerr == BZ_OK) {
nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler;
}
if (bzerr != BZ_STREAM_END) goto errhandler;
@@ -749,7 +749,7 @@ void panic ( const Char* s )
"\n%s: PANIC -- internal consistency error:\n"
"\t%s\n"
"\tThis is a BUG. Please report it to me at:\n"
"\tjseward@bzip.org\n",
"\tjseward@acm.org\n",
progName, s );
showFileNames();
cleanUpAndFail( 3 );
@@ -829,7 +829,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n )
" The user's manual, Section 4.3, has more info on (1) and (2).\n"
" \n"
" If you suspect this is a bug in bzip2, or are unsure about (1)\n"
" or (2), feel free to report it to me at: jseward@bzip.org.\n"
" or (2), feel free to report it to me at: jseward@acm.org.\n"
" Section 4.3 of the user's manual describes the info a useful\n"
" bug report should have. If the manual is available on your\n"
" system, please try and read it before mailing me. If you don't\n"
@@ -852,7 +852,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n )
" The user's manual, Section 4.3, has more info on (2) and (3).\n"
" \n"
" If you suspect this is a bug in bzip2, or are unsure about (2)\n"
" or (3), feel free to report it to me at: jseward@bzip.org.\n"
" or (3), feel free to report it to me at: jseward@acm.org.\n"
" Section 4.3 of the user's manual describes the info a useful\n"
" bug report should have. If the manual is available on your\n"
" system, please try and read it before mailing me. If you don't\n"
@@ -1609,7 +1609,7 @@ void license ( void )
" \n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms set out in the LICENSE file, which is included\n"
" in the bzip2-1.0.6 source distribution.\n"
" in the bzip2 source distribution.\n"
" \n"
" This program is distributed in the hope that it will be useful,\n"
" but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
@@ -2005,12 +2005,14 @@ IntNative main ( IntNative argc, Char *argv[] )
testf ( aa->name );
}
}
if (testFailsExist && noisy) {
fprintf ( stderr,
"\n"
"You can use the `bzip2recover' program to attempt to recover\n"
"data from undamaged sections of corrupted files.\n\n"
);
if (testFailsExist) {
if (noisy) {
fprintf ( stderr,
"\n"
"You can use the `bzip2recover' program to attempt to recover\n"
"data from undamaged sections of corrupted files.\n\n"
);
}
setExit(2);
exit(exitValue);
}
+6 -4
View File
@@ -7,8 +7,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -309,11 +309,12 @@ Int32 main ( Int32 argc, Char** argv )
UInt32 buffHi, buffLo, blockCRC;
Char* p;
strcpy ( progName, argv[0] );
strncpy ( progName, argv[0], BZ_MAX_FILENAME-1);
progName[BZ_MAX_FILENAME-1]='\0';
inFileName[0] = outFileName[0] = 0;
fprintf ( stderr,
"bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" );
"bzip2recover 1.0.7: extracts blocks from damaged .bz2 files.\n" );
if (argc != 2) {
fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n",
@@ -457,6 +458,7 @@ Int32 main ( Int32 argc, Char** argv )
bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 );
bsPutUInt32 ( bsWr, blockCRC );
bsClose ( bsWr );
outFile = NULL;
}
if (wrBlock >= rbCtr) break;
wrBlock++;
+3 -3
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -47,7 +47,7 @@ void BZ2_bz__AssertH__fail ( int errcode )
fprintf(stderr,
"\n\nbzip2/libbzip2: internal error number %d.\n"
"This is a bug in bzip2/libbzip2, %s.\n"
"Please report it to me at: jseward@bzip.org. If this happened\n"
"Please report it to me at: jseward@acm.org. If this happened\n"
"when you were using some program which uses libbzip2 as a\n"
"component, you should also report this bug to the author(s)\n"
"of that program. Please make an effort to report this bug;\n"
+2 -2
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+3 -3
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -36,7 +36,7 @@
/*-- General stuff. --*/
#define BZ_VERSION "1.0.6, 6-Sept-2010"
#define BZ_VERSION "1.0.7, 27-Jun-2019"
typedef char Char;
typedef unsigned char Bool;
+2 -2
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+2 -2
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+4 -4
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -285,9 +285,9 @@ Int32 BZ2_decompress ( DState* s )
/*--- Now the selectors ---*/
GET_BITS(BZ_X_SELECTOR_1, nGroups, 3);
if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR);
if (nGroups < 2 || nGroups > BZ_N_GROUPS) RETURN(BZ_DATA_ERROR);
GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15);
if (nSelectors < 1) RETURN(BZ_DATA_ERROR);
if (nSelectors < 1 || nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR);
for (i = 0; i < nSelectors; i++) {
j = 0;
while (True) {
+2 -2
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+2 -2
View File
@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+2 -2
View File
@@ -13,8 +13,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+2 -2
View File
@@ -17,8 +17,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.7 of 27 June 2019
Copyright (C) 1996-2010 Julian Seward <jseward@acm.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
+1 -1
View File
@@ -1,5 +1,5 @@
Checking test results. If any of the four "cmp"s which follow
report any differences, something is wrong. If you can't easily
figure out what, please let me know (jseward@bzip.org).
figure out what, please let me know (jseward@acm.org).
+143
View File
@@ -39,6 +39,7 @@ ELFTC_VCSID("$Id: sections.c 3443 2016-04-15 18:57:54Z kaiwang27 $");
static void add_gnu_debuglink(struct elfcopy *ecp);
static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc);
static void check_section_rename(struct elfcopy *ecp, struct section *s);
static void filter_reloc(struct elfcopy *ecp, struct section *s);
static int get_section_flags(struct elfcopy *ecp, const char *name);
static void insert_sections(struct elfcopy *ecp);
static void insert_to_strtab(struct section *t, const char *s);
@@ -572,6 +573,14 @@ copy_content(struct elfcopy *ecp)
strcmp(s->name, ".shstrtab") == 0)
continue;
/*
* If strip action is STRIP_ALL, relocation info need
* to be stripped. Skip filtering otherwisw.
*/
if (ecp->strip == STRIP_ALL &&
(s->type == SHT_REL || s->type == SHT_RELA))
filter_reloc(ecp, s);
/*
* The section indices in the SHT_GROUP section needs
* to be updated since we might have stripped some
@@ -664,6 +673,140 @@ update_section_group(struct elfcopy *ecp, struct section *s)
s->nocopy = 1;
}
/*
* Filter relocation entries, only keep those entries whose
* symbol is in the keep list.
*/
static void
filter_reloc(struct elfcopy *ecp, struct section *s)
{
const char *name;
GElf_Shdr ish;
GElf_Rel rel;
GElf_Rela rela;
Elf32_Rel *rel32;
Elf64_Rel *rel64;
Elf32_Rela *rela32;
Elf64_Rela *rela64;
Elf_Data *id;
uint64_t cap, n, nrels, sym;
int elferr, i;
if (gelf_getshdr(s->is, &ish) == NULL)
errx(EXIT_FAILURE, "gelf_getehdr() failed: %s",
elf_errmsg(-1));
/* We don't want to touch relocation info for dynamic symbols. */
if ((ecp->flags & SYMTAB_EXIST) == 0) {
/*
* No symbol table in output. If sh_link points to a section
* that exists in the output object, this relocation section
* is for dynamic symbols. Don't touch it.
*/
if (ish.sh_link != 0 && ecp->secndx[ish.sh_link] != 0)
return;
} else {
/* Symbol table exist, check if index equals. */
if (ish.sh_link != elf_ndxscn(ecp->symtab->is))
return;
}
#define COPYREL(REL, SZ) do { \
if (nrels == 0) { \
if ((REL##SZ = malloc(cap * \
sizeof(*REL##SZ))) == NULL) \
err(EXIT_FAILURE, "malloc failed"); \
} \
if (nrels >= cap) { \
cap *= 2; \
if ((REL##SZ = realloc(REL##SZ, cap * \
sizeof(*REL##SZ))) == NULL) \
err(EXIT_FAILURE, "realloc failed"); \
} \
REL##SZ[nrels].r_offset = REL.r_offset; \
REL##SZ[nrels].r_info = REL.r_info; \
if (s->type == SHT_RELA) \
rela##SZ[nrels].r_addend = rela.r_addend; \
nrels++; \
} while (0)
nrels = 0;
cap = 4; /* keep list is usually small. */
rel32 = NULL;
rel64 = NULL;
rela32 = NULL;
rela64 = NULL;
if ((id = elf_getdata(s->is, NULL)) == NULL)
errx(EXIT_FAILURE, "elf_getdata() failed: %s",
elf_errmsg(-1));
n = ish.sh_size / ish.sh_entsize;
for(i = 0; (uint64_t)i < n; i++) {
if (s->type == SHT_REL) {
if (gelf_getrel(id, i, &rel) != &rel)
errx(EXIT_FAILURE, "gelf_getrel failed: %s",
elf_errmsg(-1));
sym = GELF_R_SYM(rel.r_info);
} else {
if (gelf_getrela(id, i, &rela) != &rela)
errx(EXIT_FAILURE, "gelf_getrel failed: %s",
elf_errmsg(-1));
sym = GELF_R_SYM(rela.r_info);
}
/*
* If a relocation references a symbol and we are omitting
* either that symbol or the entire symbol table we cannot
* produce valid output, and so just omit the relocation.
* Broken output like this is generally not useful, but some
* uses of elfcopy/strip rely on it - for example, GCC's build
* process uses it to check for build reproducibility by
* stripping objects and comparing them.
*
* Relocations that do not reference a symbol are retained.
*/
if (sym != 0) {
if (ish.sh_link == 0 || ecp->secndx[ish.sh_link] == 0)
continue;
name = elf_strptr(ecp->ein, elf_ndxscn(ecp->strtab->is),
sym);
if (name == NULL)
errx(EXIT_FAILURE, "elf_strptr failed: %s",
elf_errmsg(-1));
if (lookup_symop_list(ecp, name, SYMOP_KEEP) == NULL)
continue;
}
if (ecp->oec == ELFCLASS32) {
if (s->type == SHT_REL)
COPYREL(rel, 32);
else
COPYREL(rela, 32);
} else {
if (s->type == SHT_REL)
COPYREL(rel, 64);
else
COPYREL(rela, 64);
}
}
elferr = elf_errno();
if (elferr != 0)
errx(EXIT_FAILURE, "elf_getdata() failed: %s",
elf_errmsg(elferr));
if (ecp->oec == ELFCLASS32) {
if (s->type == SHT_REL)
s->buf = rel32;
else
s->buf = rela32;
} else {
if (s->type == SHT_REL)
s->buf = rel64;
else
s->buf = rela64;
}
s->sz = gelf_fsize(ecp->eout, (s->type == SHT_REL ? ELF_T_REL :
ELF_T_RELA), nrels, EV_CURRENT);
s->nocopy = 1;
}
static void
update_reloc(struct elfcopy *ecp, struct section *s)
{
@@ -5,7 +5,7 @@
#undef JEMALLOC_OVERRIDE_VALLOC
#ifndef MALLOC_PRODUCTION
#define JEMALLOC_DEBUG
#define MALLOC_PRODUCTION
#endif
#undef JEMALLOC_DSS
@@ -68,7 +68,9 @@ void EHHeaderParser<A>::decodeEHHdr(A &addressSpace, pint_t ehHdrStart,
ehHdrInfo.eh_frame_ptr =
addressSpace.getEncodedP(p, ehHdrEnd, eh_frame_ptr_enc, ehHdrStart);
ehHdrInfo.fde_count =
addressSpace.getEncodedP(p, ehHdrEnd, fde_count_enc, ehHdrStart);
fde_count_enc == DW_EH_PE_omit
? 0
: addressSpace.getEncodedP(p, ehHdrEnd, fde_count_enc, ehHdrStart);
ehHdrInfo.table = p;
}
+22 -29
View File
@@ -1,16 +1,15 @@
This file is automatically generated from html/copyright.html
Copyright Notice
jpg "Clone me," says Dolly sheepishly.
Last update: 2-Jan-2017 11:58 UTC
_________________________________________________________________
The following copyright notice applies to all files collectively
called the Network Time Protocol Version 4 Distribution. Unless
specifically declared otherwise in an individual file, this entire
notice applies as if the text was explicitly included in the file.
__________________________________________________________________
The following copyright notice applies to all files collectively called
the Network Time Protocol Version 4 Distribution. Unless specifically
declared otherwise in an individual file, this entire notice applies as
if the text was explicitly included in the file.
***********************************************************************
* *
* Copyright (c) University of Delaware 1992-2015 *
@@ -62,13 +61,13 @@ This file is automatically generated from html/copyright.html
***********************************************************************
The following individuals contributed in part to the Network Time
Protocol Distribution Version 4 and are acknowledged as authors of
this work.
Protocol Distribution Version 4 and are acknowledged as authors of this
work.
1. [1]Takao Abe <[email protected]> Clock driver for JJY receivers
2. [2]Mark Andrews <[email protected]> Leitch atomic clock
controller
3. [3]Bernd Altmeier <[email protected]> hopf Elektronik serial
line and PCI-bus devices
3. [3]Bernd Altmeier <[email protected]> hopf Elektronik serial line
and PCI-bus devices
4. [4]Viraj Bais <[email protected]> and [5]Clayton Kirkwood
<[email protected]> port to WindowsNT 3.5
5. [6]Michael Barone <michael,[email protected]> GPSVME fixes
@@ -84,13 +83,12 @@ This file is automatically generated from html/copyright.html
<[email protected]> IPv6 support
12. [13]Reg Clemens <[email protected]> Oncore driver (Current maintainer)
13. [14]Steve Clift <[email protected]> OMEGA clock driver
14. [15]Casey Crellin <[email protected]> vxWorks (Tornado) port and
help with target configuration
14. [15]Casey Crellin <[email protected]> vxWorks (Tornado) port and help
with target configuration
15. [16]Sven Dietrich <[email protected]> Palisade reference
clock driver, NT adj. residuals, integrated Greg's Winnt port.
16. [17]John A. Dundas III <[email protected]> Apple A/UX port
17. [18]Torsten Duwe <[email protected]> Linux
port
17. [18]Torsten Duwe <[email protected]> Linux port
18. [19]Dennis Ferguson <[email protected]> foundation code for
NTP Version 2 as specified in RFC-1119
19. [20]John Hay <[email protected]> IPv6 support and testing
@@ -122,9 +120,8 @@ This file is automatically generated from html/copyright.html
code for Version 3 as specified in RFC-1305
36. [39]Danny Mayer <[email protected]>Network I/O, Windows Port, Code
Maintenance
37. [40]David L. Mills <[email protected]> Version 4 foundation,
precision kernel; clock drivers: 1, 3, 4, 6, 7, 11, 13, 18, 19,
22, 36
37. [40]David L. Mills <[email protected]> Version 4 foundation, precision
kernel; clock drivers: 1, 3, 4, 6, 7, 11, 13, 18, 19, 22, 36
38. [41]Wolfgang Moeller <[email protected]> VMS port
39. [42]Jeffrey Mogul <[email protected]> ntptrace utility
40. [43]Tom Moore <[email protected]> i386 svr4 port
@@ -136,22 +133,18 @@ This file is automatically generated from html/copyright.html
44. [48]Rainer Pruy <[email protected]>
monitoring/trap scripts, statistics file handling
45. [49]Dirce Richards <[email protected]> Digital UNIX V4.0 port
46. [50]Wilfredo Sánchez <[email protected]> added support for
NetInfo
46. [50]Wilfredo Sánchez <[email protected]> added support for NetInfo
47. [51]Nick Sayer <[email protected]> SunOS streams modules
48. [52]Jack Sasportas <[email protected]> Saved a Lot of
space on the stuff in the html/pic/ subdirectory
49. [53]Ray Schnitzler <[email protected]> Unixware1 port
50. [54]Michael Shields <[email protected]> USNO clock driver
51. [55]Jeff Steinman <[email protected]> Datum PTS clock
driver
51. [55]Jeff Steinman <[email protected]> Datum PTS clock driver
52. [56]Harlan Stenn <[email protected]> GNU automake/autoconfigure
makeover, various other bits (see the ChangeLog)
53. [57]Kenneth Stone <[email protected]> HP-UX port
54. [58]Ajit Thyagarajan <[email protected]>IP multicast/anycast
support
55. [59]Tomoaki TSURUOKA <[email protected]>TRAK clock
driver
54. [58]Ajit Thyagarajan <[email protected]>IP multicast/anycast support
55. [59]Tomoaki TSURUOKA <[email protected]>TRAK clock driver
56. [60]Brian Utterback <[email protected]> General codebase,
Solaris issues
57. [61]Loganaden Velvindron <[email protected]> Sandboxing
@@ -160,7 +153,7 @@ This file is automatically generated from html/copyright.html
TrueTime clock driver
59. [63]Ulrich Windl <[email protected]> corrected and
validated HTML documents according to the HTML DTD
_________________________________________________________________
__________________________________________________________________
References
+45
View File
@@ -1,3 +1,48 @@
---
(4.2.8p13) 2019/03/07 Released by Harlan Stenn <[email protected]>
* [Sec 3565] Crafted null dereference attack in authenticated
mode 6 packet <[email protected]>
- reported by Magnus Stubman
* [Bug 3560] Fix build when HAVE_DROPROOT is not defined <[email protected]>
- applied patch by Ian Lepore
* [Bug 3558] Crash and integer size bug <[email protected]>
- isolate and fix linux/windows specific code issue
* [Bug 3556] ntp_loopfilter.c snprintf compilation warnings <[email protected]>
- provide better function for incremental string formatting
* [Bug 3555] Tidy up print alignment of debug output from ntpdate <[email protected]>
- applied patch by Gerry Garvey
* [Bug 3554] config revoke stores incorrect value <[email protected]>
- original finding by Gerry Garvey, additional cleanup needed
* [Bug 3549] Spurious initgroups() error message <[email protected]>
- patch by Christous Zoulas
* [Bug 3548] Signature not verified on windows system <[email protected]>
- finding by Chen Jiabin, plus another one by me
* [Bug 3541] patch to fix STA_NANO struct timex units <[email protected]>
- applied patch by Maciej Szmigiero
* [Bug 3540] Cannot set minsane to 0 anymore <[email protected]>
- applied patch by Andre Charbonneau
* [Bug 3539] work_fork build fails when droproot is not supported <[email protected]>
- applied patch by Baruch Siach
* [Bug 3538] Build fails for no-MMU targets <[email protected]>
- applied patch by Baruch Siach
* [Bug 3535] libparse won't handle GPS week rollover <[email protected]>
- refactored handling of GPS era based on 'tos basedate' for
parse (TSIP) and JUPITER clocks
* [Bug 3529] Build failures on Mac OS X 10.13 (High Sierra) <[email protected]>
- patch by Daniel J. Luke; this does not fix a potential linker
regression issue on MacOS.
* [Bug 3527 - Backward Incompatible] mode7 clockinfo fudgeval2 packet
anomaly <[email protected]>, reported by GGarvey.
- --enable-bug3527-fix support by HStenn
* [Bug 3526] Incorrect poll interval in packet <[email protected]>
- applied patch by Gerry Garvey
* [Bug 3471] Check for openssl/[ch]mac.h. <[email protected]>
- added missing check, reported by Reinhard Max <[email protected]>
* [Bug 1674] runtime crashes and sync problems affecting both x86 and x86_64
- this is a variant of [bug 3558] and should be fixed with it
* Implement --disable-signalled-io
---
(4.2.8p12) 2018/08/14 Released by Harlan Stenn <[email protected]>
+7298 -462
View File
File diff suppressed because it is too large. Load diff
+6 -6
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -830,7 +830,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
@@ -856,7 +856,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@@ -874,7 +874,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@@ -884,7 +884,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
+54 -2
View File
@@ -1,8 +1,60 @@
---
NTP 4.2.8p13 (Harlan Stenn <[email protected]>, 2019 Mar 07)
Focus: Security, Bug fixes, enhancements.
Severity: MEDIUM
This release fixes a bug that allows an attacker with access to an
explicitly trusted source to send a crafted malicious mode 6 (ntpq)
packet that can trigger a NULL pointer dereference, crashing ntpd.
It also provides 17 other bugfixes and 1 other improvement:
* [Sec 3565] Crafted null dereference attack in authenticated
mode 6 packet <[email protected]>
- reported by Magnus Stubman
* [Bug 3560] Fix build when HAVE_DROPROOT is not defined <[email protected]>
- applied patch by Ian Lepore
* [Bug 3558] Crash and integer size bug <[email protected]>
- isolate and fix linux/windows specific code issue
* [Bug 3556] ntp_loopfilter.c snprintf compilation warnings <[email protected]>
- provide better function for incremental string formatting
* [Bug 3555] Tidy up print alignment of debug output from ntpdate <[email protected]>
- applied patch by Gerry Garvey
* [Bug 3554] config revoke stores incorrect value <[email protected]>
- original finding by Gerry Garvey, additional cleanup needed
* [Bug 3549] Spurious initgroups() error message <[email protected]>
- patch by Christous Zoulas
* [Bug 3548] Signature not verified on windows system <[email protected]>
- finding by Chen Jiabin, plus another one by me
* [Bug 3541] patch to fix STA_NANO struct timex units <[email protected]>
- applied patch by Maciej Szmigiero
* [Bug 3540] Cannot set minsane to 0 anymore <[email protected]>
- applied patch by Andre Charbonneau
* [Bug 3539] work_fork build fails when droproot is not supported <[email protected]>
- applied patch by Baruch Siach
* [Bug 3538] Build fails for no-MMU targets <[email protected]>
- applied patch by Baruch Siach
* [Bug 3535] libparse won't handle GPS week rollover <[email protected]>
- refactored handling of GPS era based on 'tos basedate' for
parse (TSIP) and JUPITER clocks
* [Bug 3529] Build failures on Mac OS X 10.13 (High Sierra) <[email protected]>
- patch by Daniel J. Luke; this does not fix a potential linker
regression issue on MacOS.
* [Bug 3527 - Backward Incompatible] mode7 clockinfo fudgeval2 packet
anomaly <[email protected]>, reported by GGarvey.
- --enable-bug3527-fix support by HStenn
* [Bug 3526] Incorrect poll interval in packet <[email protected]>
- applied patch by Gerry Garvey
* [Bug 3471] Check for openssl/[ch]mac.h. <[email protected]>
- added missing check, reported by Reinhard Max <[email protected]>
* [Bug 1674] runtime crashes and sync problems affecting both x86 and x86_64
- this is a variant of [bug 3558] and should be fixed with it
* Implement 'configure --disable-signalled-io'
--
NTP 4.2.8p12 (Harlan Stenn <[email protected]>, 2018/14/09)
NOTE: this NEWS file will be undergoing more revisions.
Focus: Security, Bug fixes, enhancements.
Severity: MEDIUM
+130 -135
View File
@@ -1,6 +1,6 @@
# generated automatically by aclocal 1.15 -*- Autoconf -*-
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,126 +20,121 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# serial 9 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
# longlong.m4 serial 17
dnl Copyright (C) 1999-2007, 2009-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert.
# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
# Autoconf. Perhaps we can remove this once we can assume Autoconf
# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
# enough in this area it's likely we'll need to redefine
# AC_USE_SYSTEM_EXTENSIONS for quite some time.
# Define HAVE_LONG_LONG_INT if 'long long int' works.
# This fixes a bug in Autoconf 2.61, and can be faster
# than what's in Autoconf 2.62 through 2.68.
# If autoconf reports a warning
# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
# the fix is
# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
# but always AC_REQUIREd,
# 2) to ensure that for each occurrence of
# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
# or
# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
# the corresponding gnulib module description has 'extensions' among
# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
# invocation occurs in gl_EARLY, not in gl_INIT.
# Note: If the type 'long long int' exists but is only 32 bits large
# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
# defined. In this case you can treat 'long long int' like 'long int'.
# AC_USE_SYSTEM_EXTENSIONS
# ------------------------
# Enable extensions on systems that normally disable them,
# typically due to standards-conformance issues.
# Remember that #undef in AH_VERBATIM gets replaced with #define by
# AC_DEFINE. The goal here is to define all known feature-enabling
# macros, then, if reports of conflicts are made, disable macros that
# cause problems on some platforms (such as __EXTENSIONS__).
AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
AC_REQUIRE([AC_CANONICAL_HOST])
AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
if test "$MINIX" = yes; then
AC_DEFINE([_POSIX_SOURCE], [1],
[Define to 1 if you need to in order for `stat' and other
things to work.])
AC_DEFINE([_POSIX_1_SOURCE], [2],
[Define to 2 if the system does not provide POSIX.1 features
except with this defined.])
AC_DEFINE([_MINIX], [1],
[Define to 1 if on MINIX.])
fi
dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
dnl provided.
case "$host_os" in
hpux*)
AC_DEFINE([_XOPEN_SOURCE], [500],
[Define to 500 only on HP-UX.])
;;
esac
AH_VERBATIM([__EXTENSIONS__],
[/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
])
AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
[ac_cv_safe_to_define___extensions__],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
# define __EXTENSIONS__ 1
]AC_INCLUDES_DEFAULT])],
[ac_cv_safe_to_define___extensions__=yes],
[ac_cv_safe_to_define___extensions__=no])])
test $ac_cv_safe_to_define___extensions__ = yes &&
AC_DEFINE([__EXTENSIONS__])
AC_DEFINE([_ALL_SOURCE])
AC_DEFINE([_GNU_SOURCE])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
AC_DEFINE([_TANDEM_SOURCE])
])# AC_USE_SYSTEM_EXTENSIONS
# gl_USE_SYSTEM_EXTENSIONS
# ------------------------
# Enable extensions on systems that normally disable them,
# typically due to standards-conformance issues.
AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
AC_DEFUN([AC_TYPE_LONG_LONG_INT],
[
dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
dnl gnulib does not need it. But if it gets required by third-party macros
dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
AC_REQUIRE([AC_GNU_SOURCE])
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
[ac_cv_type_long_long_int=yes
if test "x${ac_cv_prog_cc_c99-no}" = xno; then
ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
if test $ac_cv_type_long_long_int = yes; then
dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
dnl If cross compiling, assume the bug is not important, since
dnl nobody cross compiles for this platform as far as we know.
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[@%:@include <limits.h>
@%:@ifndef LLONG_MAX
@%:@ define HALF \
(1LL << (sizeof (long long int) * CHAR_BIT - 2))
@%:@ define LLONG_MAX (HALF - 1 + HALF)
@%:@endif]],
[[long long int n = 1;
int i;
for (i = 0; ; i++)
{
long long int m = n << i;
if (m >> i != n)
return 1;
if (LLONG_MAX / 2 < m)
break;
}
return 0;]])],
[],
[ac_cv_type_long_long_int=no],
[:])
fi
fi])
if test $ac_cv_type_long_long_int = yes; then
AC_DEFINE([HAVE_LONG_LONG_INT], [1],
[Define to 1 if the system has the type 'long long int'.])
fi
])
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
# This fixes a bug in Autoconf 2.61, and can be faster
# than what's in Autoconf 2.62 through 2.68.
# Note: If the type 'unsigned long long int' exists but is only 32 bits
# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
# will not be defined. In this case you can treat 'unsigned long long int'
# like 'unsigned long int'.
AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
[
AC_CACHE_CHECK([for unsigned long long int],
[ac_cv_type_unsigned_long_long_int],
[ac_cv_type_unsigned_long_long_int=yes
if test "x${ac_cv_prog_cc_c99-no}" = xno; then
AC_LINK_IFELSE(
[_AC_TYPE_LONG_LONG_SNIPPET],
[],
[ac_cv_type_unsigned_long_long_int=no])
fi])
if test $ac_cv_type_unsigned_long_long_int = yes; then
AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
[Define to 1 if the system has the type 'unsigned long long int'.])
fi
])
# Expands to a C program that can be used to test for simultaneous support
# of 'long long' and 'unsigned long long'. We don't want to say that
# 'long long' is available if 'unsigned long long' is not, or vice versa,
# because too many programs rely on the symmetry between signed and unsigned
# integer types (excluding 'bool').
AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
[
AC_LANG_PROGRAM(
[[/* For now, do not test the preprocessor; as of 2007 there are too many
implementations with broken preprocessors. Perhaps this can
be revisited in 2012. In the meantime, code should not expect
#if to work with literals wider than 32 bits. */
/* Test literals. */
long long int ll = 9223372036854775807ll;
long long int nll = -9223372036854775807LL;
unsigned long long int ull = 18446744073709551615ULL;
/* Test constant expressions. */
typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
? 1 : -1)];
typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
? 1 : -1)];
int i = 63;]],
[[/* Test availability of runtime routines for shift and division. */
long long int llmax = 9223372036854775807ll;
unsigned long long int ullmax = 18446744073709551615ull;
return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
| (llmax / ll) | (llmax % ll)
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
| (ullmax / ull) | (ullmax % ull));]])
])
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -154,7 +149,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.15], [],
m4_if([$1], [1.15.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -170,12 +165,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.15])dnl
[AM_AUTOMAKE_VERSION([1.15.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# Copyright (C) 2011-2014 Free Software Foundation, Inc.
# Copyright (C) 2011-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -237,7 +232,7 @@ AC_SUBST([AR])dnl
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -289,7 +284,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -320,7 +315,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -511,7 +506,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -587,7 +582,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -784,7 +779,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -805,7 +800,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2014 Free Software Foundation, Inc.
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -826,7 +821,7 @@ AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -876,7 +871,7 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -915,7 +910,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -944,7 +939,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -991,7 +986,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1010,7 +1005,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1091,7 +1086,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
# Copyright (C) 2009-2014 Free Software Foundation, Inc.
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1151,7 +1146,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1179,7 +1174,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2014 Free Software Foundation, Inc.
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1198,7 +1193,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2014 Free Software Foundation, Inc.
# Copyright (C) 2004-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
+2 -2
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
+1 -1
View File
@@ -52,7 +52,7 @@ esac
case "$NTP_BDIR" in
'')
case "$IAM" in
*.ntp.org)
*.ntp.org | *.ntfo.org)
NTP_BDIR=host
;;
*.udel.edu)
+2 -2
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
+27 -27
View File
@@ -296,6 +296,9 @@
/* use old autokey session key behavior? */
#undef DISABLE_BUG1243_FIX
/* use old autokey session key behavior? */
#undef DISABLE_BUG3527_FIX
/* synch TODR hourly? */
#undef DOSYNCTODR
@@ -550,7 +553,7 @@
/* Define to 1 if the system has the type `long long'. */
#undef HAVE_LONG_LONG
/* Define to 1 if the system has the type `long long int'. */
/* Define to 1 if the system has the type 'long long int'. */
#undef HAVE_LONG_LONG_INT
/* if you have SunOS LWP package */
@@ -1170,7 +1173,7 @@
/* deviant sigwait? */
#undef HAVE_UNIXWARE_SIGWAIT
/* Define to 1 if the system has the type `unsigned long long int'. */
/* Define to 1 if the system has the type 'unsigned long long int'. */
#undef HAVE_UNSIGNED_LONG_LONG_INT
/* Define to 1 if you have the `updwtmp' function. */
@@ -1611,6 +1614,28 @@ typedef unsigned int uintptr_t;
/* OK to use snprintb()? */
#undef USE_SNPRINTB
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Can we use SIGPOLL for tty IO? */
#undef USE_TTY_SIGPOLL
@@ -1663,9 +1688,6 @@ typedef unsigned int uintptr_t;
/* enable thread safety */
#undef _THREAD_SAFE
/* Define to 500 only on HP-UX. */
#undef _XOPEN_SOURCE
/* Are we _special_? */
#undef __APPLE_USE_RFC_3542
@@ -1674,28 +1696,6 @@ typedef unsigned int uintptr_t;
# undef __CHAR_UNSIGNED__
#endif
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* deviant */
#undef adjtimex
+152 -55
View File
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for ntp 4.2.8p12.
# Generated by GNU Autoconf 2.69 for ntp 4.2.8p13.
#
# Report bugs to <http://bugs.ntp.org./>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ntp'
PACKAGE_TARNAME='ntp'
PACKAGE_VERSION='4.2.8p12'
PACKAGE_STRING='ntp 4.2.8p12'
PACKAGE_VERSION='4.2.8p13'
PACKAGE_STRING='ntp 4.2.8p13'
PACKAGE_BUGREPORT='http://bugs.ntp.org./'
PACKAGE_URL='http://www.ntp.org./'
@@ -969,6 +969,7 @@ enable_clockctl
enable_linuxcaps
enable_solarisprivs
enable_trustedbsd_mac
enable_signalled_io
with_arlib
with_net_snmp_config
enable_libseccomp
@@ -1051,6 +1052,7 @@ enable_hourly_todr_sync
enable_kernel_fll_bug
enable_bug1243_fix
enable_bug3020_fix
enable_bug3527_fix
enable_irig_sawtooth
enable_nist
enable_ntp_signd
@@ -1615,7 +1617,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures ntp 4.2.8p12 to adapt to many kinds of systems.
\`configure' configures ntp 4.2.8p13 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1685,7 +1687,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of ntp 4.2.8p12:";;
short | recursive ) echo "Configuration of ntp 4.2.8p13:";;
esac
cat <<\_ACEOF
@@ -1734,6 +1736,7 @@ Optional Features and Packages:
--enable-solarisprivs + Use Solaris privileges for non-root clock control
--enable-trustedbsd-mac s Use TrustedBSD MAC policy for non-root clock
control
--enable-signalled-io s Use signalled IO if we can
--with-arlib - deprecated, arlib not distributed
--with-net-snmp-config + =net-snmp-config
--enable-libseccomp EXPERIMENTAL: enable support for libseccomp
@@ -1826,6 +1829,7 @@ Optional Features and Packages:
--enable-kernel-fll-bug s if we should avoid a kernel FLL bug
--enable-bug1243-fix + use unmodified autokey session keys
--enable-bug3020-fix + Provide the explicit 127.0.0.0/8 martian filter
--enable-bug3527-fix + provide correct mode7 fudgetime2 behavior
--enable-irig-sawtooth s if we should enable the IRIG sawtooth filter
--enable-nist - if we should enable the NIST lockclock scheme
--enable-ntp-signd - Provide support for Samba's signing daemon,
@@ -1926,7 +1930,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
ntp configure 4.2.8p12
ntp configure 4.2.8p13
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2635,7 +2639,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by ntp $as_me 4.2.8p12, which was
It was created by ntp $as_me 4.2.8p13, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3636,7 +3640,7 @@ fi
# Define the identity of the package.
PACKAGE='ntp'
VERSION='4.2.8p12'
VERSION='4.2.8p13'
cat >>confdefs.h <<_ACEOF
@@ -5116,8 +5120,6 @@ done
ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
if test "x$ac_cv_header_minix_config_h" = xyes; then :
MINIX=yes
@@ -5138,14 +5140,6 @@ $as_echo "#define _MINIX 1" >>confdefs.h
fi
case "$host_os" in
hpux*)
$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
@@ -16093,18 +16087,18 @@ else
/* end confdefs.h. */
/* For now, do not test the preprocessor; as of 2007 there are too many
implementations with broken preprocessors. Perhaps this can
be revisited in 2012. In the meantime, code should not expect
#if to work with literals wider than 32 bits. */
implementations with broken preprocessors. Perhaps this can
be revisited in 2012. In the meantime, code should not expect
#if to work with literals wider than 32 bits. */
/* Test literals. */
long long int ll = 9223372036854775807ll;
long long int nll = -9223372036854775807LL;
unsigned long long int ull = 18446744073709551615ULL;
/* Test constant expressions. */
typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
? 1 : -1)];
? 1 : -1)];
typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
? 1 : -1)];
? 1 : -1)];
int i = 63;
int
main ()
@@ -16113,9 +16107,9 @@ main ()
long long int llmax = 9223372036854775807ll;
unsigned long long int ullmax = 18446744073709551615ull;
return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
| (llmax / ll) | (llmax % ll)
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
| (ullmax / ull) | (ullmax % ull));
| (llmax / ll) | (llmax % ll)
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
| (ullmax / ull) | (ullmax % ull));
;
return 0;
}
@@ -16303,33 +16297,33 @@ if ${ac_cv_type_long_long_int+:} false; then :
else
ac_cv_type_long_long_int=yes
if test "x${ac_cv_prog_cc_c99-no}" = xno; then
ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
if test $ac_cv_type_long_long_int = yes; then
if test "$cross_compiling" = yes; then :
ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
if test $ac_cv_type_long_long_int = yes; then
if test "$cross_compiling" = yes; then :
:
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <limits.h>
#ifndef LLONG_MAX
# define HALF \
(1LL << (sizeof (long long int) * CHAR_BIT - 2))
# define LLONG_MAX (HALF - 1 + HALF)
#endif
#ifndef LLONG_MAX
# define HALF \
(1LL << (sizeof (long long int) * CHAR_BIT - 2))
# define LLONG_MAX (HALF - 1 + HALF)
#endif
int
main ()
{
long long int n = 1;
int i;
for (i = 0; ; i++)
{
long long int m = n << i;
if (m >> i != n)
return 1;
if (LLONG_MAX / 2 < m)
break;
}
return 0;
int i;
for (i = 0; ; i++)
{
long long int m = n << i;
if (m >> i != n)
return 1;
if (LLONG_MAX / 2 < m)
break;
}
return 0;
;
return 0;
}
@@ -16343,7 +16337,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
fi
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
@@ -16366,18 +16360,18 @@ else
/* end confdefs.h. */
/* For now, do not test the preprocessor; as of 2007 there are too many
implementations with broken preprocessors. Perhaps this can
be revisited in 2012. In the meantime, code should not expect
#if to work with literals wider than 32 bits. */
implementations with broken preprocessors. Perhaps this can
be revisited in 2012. In the meantime, code should not expect
#if to work with literals wider than 32 bits. */
/* Test literals. */
long long int ll = 9223372036854775807ll;
long long int nll = -9223372036854775807LL;
unsigned long long int ull = 18446744073709551615ULL;
/* Test constant expressions. */
typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
? 1 : -1)];
? 1 : -1)];
typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
? 1 : -1)];
? 1 : -1)];
int i = 63;
int
main ()
@@ -16386,9 +16380,9 @@ main ()
long long int llmax = 9223372036854775807ll;
unsigned long long int ullmax = 18446744073709551615ull;
return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
| (llmax / ll) | (llmax % ll)
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
| (ullmax / ull) | (ullmax % ull));
| (llmax / ll) | (llmax % ll)
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
| (ullmax / ull) | (ullmax % ull));
;
return 0;
}
@@ -24024,6 +24018,9 @@ case "$ntp_have_solarisprivs" in
$as_echo "#define HAVE_SOLARIS_PRIVS 1" >>confdefs.h
;;
'') ntp_have_solarisprivs="no"
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_have_solarisprivs" >&5
@@ -24057,6 +24054,9 @@ case "$ntp_use_trustedbsd_mac$ac_cv_header_sys_mac_h" in
$as_echo "#define HAVE_TRUSTEDBSD_MAC 1" >>confdefs.h
;;
*) ntp_use_trustedbsd_mac="no";
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_use_trustedbsd_mac" >&5
@@ -24576,6 +24576,16 @@ fi
done
# HMS: does this need to be a cached variable?
# Check whether --enable-signalled-io was given.
if test "${enable_signalled_io+set}" = set; then :
enableval=$enable_signalled_io; use_signalled_io=$enableval
else
use_signalled_io=yes
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGIO" >&5
$as_echo_n "checking for SIGIO... " >&6; }
if ${ntp_cv_hdr_def_sigio+:} false; then :
@@ -24650,13 +24660,24 @@ case "$ntp_cv_hdr_def_sigio" in
ans=no
;;
esac
case "$ans" in
no)
ans="Possible for $host but disabled because of reported problems"
;;
esac
;;
esac
case "$ans" in
yes)
case "$use_signalled_io" in
yes)
$as_echo "#define HAVE_SIGNALED_IO 1" >>confdefs.h
;;
*) ans="Allowed for $host but --disable-signalled-io was given"
;;
esac
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }
@@ -28663,6 +28684,62 @@ case "$ntp_ok" in
$as_echo "#define CLOCK_BANC 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing bcStartPci" >&5
$as_echo_n "checking for library containing bcStartPci... " >&6; }
if ${ac_cv_search_bcStartPci+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char bcStartPci ();
int
main ()
{
return bcStartPci ();
;
return 0;
}
_ACEOF
for ac_lib in '' bcsdk; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_bcStartPci=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_bcStartPci+:} false; then :
break
fi
done
if ${ac_cv_search_bcStartPci+:} false; then :
else
ac_cv_search_bcStartPci=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_bcStartPci" >&5
$as_echo "$ac_cv_search_bcStartPci" >&6; }
ac_res=$ac_cv_search_bcStartPci
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
@@ -31999,6 +32076,26 @@ $as_echo "#define ENABLE_BUG3020_FIX 1" >>confdefs.h
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want correct mode7 fudgetime2 behavior" >&5
$as_echo_n "checking if we want correct mode7 fudgetime2 behavior... " >&6; }
# Check whether --enable-bug3527-fix was given.
if test "${enable_bug3527_fix+set}" = set; then :
enableval=$enable_bug3527_fix; ans=$enableval
else
ans=yes
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
$as_echo "$ans" >&6; }
case "$ans" in
no)
$as_echo "#define DISABLE_BUG3527_FIX 1" >>confdefs.h
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use the IRIG sawtooth filter" >&5
$as_echo_n "checking if we should use the IRIG sawtooth filter... " >&6; }
@@ -34054,7 +34151,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by ntp $as_me 4.2.8p12, which was
This file was extended by ntp $as_me 4.2.8p13, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -34121,7 +34218,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
ntp config.status 4.2.8p12
ntp config.status 4.2.8p13
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
+19
View File
@@ -1749,6 +1749,7 @@ case "$ntp_ok" in
yes)
ntp_refclock=yes
AC_DEFINE([CLOCK_BANC], [1], [Datum/Bancomm bc635/VME interface?])
AC_SEARCH_LIBS([bcStartPci], [bcsdk], , , [])
;;
esac
AC_MSG_RESULT([$ntp_ok])
@@ -4194,6 +4195,24 @@ case "$ans" in
esac
AC_MSG_CHECKING([if we want correct mode7 fudgetime2 behavior])
AC_ARG_ENABLE(
[bug3527-fix],
[AS_HELP_STRING(
[--enable-bug3527-fix],
[+ provide correct mode7 fudgetime2 behavior]
)],
[ans=$enableval],
[ans=yes]
)
AC_MSG_RESULT([$ans])
case "$ans" in
no)
AC_DEFINE([DISABLE_BUG3527_FIX], [1],
[use old autokey session key behavior?])
esac
AC_MSG_CHECKING([if we should use the IRIG sawtooth filter])
case "$host" in
+2 -2
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
+2 -2
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
+21 -3
View File
@@ -93,6 +93,7 @@ extern systime_func_ptr ntpcal_set_timefunc(systime_func_ptr);
#define SECSPERLEAPYEAR (366 * SECSPERDAY) /* leap year */
#define SECSPERAVGYEAR 31556952 /* mean year length over 400yrs */
#define GPSWEEKS 1024 /* GPS week cycle */
/*
* Gross hacks. I have illicit knowlege that there won't be overflows
* here, the compiler often can't tell this.
@@ -404,14 +405,21 @@ basedate_get_eracenter(void);
extern time_t
basedate_get_erabase(void);
extern uint32_t
basedate_get_gpsweek(void);
extern uint32_t
basedate_expand_gpsweek(unsigned short weekno);
/*
* Additional support stuff for Ed Rheingold's calendrical calculations
*/
/*
* Start day of NTP time as days past the imaginary date 12/1/1 BC.
* (This is the beginning of the Christian Era, or BCE.)
* Start day of NTP time as days past 0000-12-31 in the proleptic
* Gregorian calendar. (So 0001-01-01 is day number 1; this is the Rata
* Die counting scheme used by Ed Rheingold in his book "Calendrical
* Calculations".)
*/
#define DAY_NTP_STARTS 693596
@@ -420,15 +428,25 @@ basedate_get_erabase(void);
*/
#define DAY_UNIX_STARTS 719163
/*
* Start day of the GPS epoch. This is the Rata Die of 1980-01-06
*/
#define DAY_GPS_STARTS 722819
/*
* Difference between UN*X and NTP epoch (25567).
*/
#define NTP_TO_UNIX_DAYS (DAY_UNIX_STARTS - DAY_NTP_STARTS)
/*
* Difference between GPS and NTP epoch (29224)
*/
#define NTP_TO_GPS_DAYS (DAY_GPS_STARTS - DAY_NTP_STARTS)
/*
* Days in a normal 4 year leap year calendar cycle (1461).
*/
#define GREGORIAN_NORMAL_LEAP_CYCLE_DAYS (3 * 365 + 366)
#define GREGORIAN_NORMAL_LEAP_CYCLE_DAYS (4 * 365 + 1)
/*
* Days in a normal 100 year leap year calendar (36524). We lose a
+3
View File
@@ -40,6 +40,9 @@ extern void setup_logfile (const char *);
extern void errno_to_str(int, char *, size_t);
#endif
extern int xvsbprintf(char**, char* const, char const*, va_list) NTP_PRINTF(3, 0);
extern int xsbprintf(char**, char* const, char const*, ...) NTP_PRINTF(3, 4);
/*
* When building without OpenSSL, use a few macros of theirs to
* minimize source differences in NTP.
+2 -2
View File
@@ -275,8 +275,8 @@ extern u_long orphwait; /* orphan wait time */
extern char *sys_hostname; /* host name */
extern char *sys_groupname; /* group name */
extern char *group_name; /* group name */
extern u_long sys_revoke; /* keys revoke timeout */
extern u_long sys_automax; /* session key timeout */
extern u_char sys_revoke; /* keys revoke timeout */
extern u_char sys_automax; /* session key timeout */
#endif /* AUTOKEY */
/* ntp_util.c */
-1
View File
@@ -108,7 +108,6 @@ extern unsigned int splclock (void);
* some constants useful for GPS time conversion
*/
#define GPSORIGIN 2524953600UL /* NTP origin - GPS origin in seconds */
#define GPSWRAP 990 /* assume week count less than this in the previous epoch */
#define GPSWEEKS 1024 /* number of weeks until the GPS epch rolls over */
/*
+2 -2
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
+2 -2
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
+1
View File
@@ -110,6 +110,7 @@ libntp_a_SRCS = \
vint64ops.c \
work_fork.c \
work_thread.c \
xsbprintf.c \
ymd2yd.c \
$(libisc_SRCS) \
$(NULL)
+8 -6
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -160,7 +160,7 @@ am__libntp_a_SOURCES_DIST = systime.c a_md5encrypt.c adjtime.c \
snprintf.c socket.c socktoa.c socktohost.c ssl_init.c \
statestr.c strdup.c strl_obsd.c syssignal.c timetoa.c \
timevalops.c uglydate.c vint64ops.c work_fork.c work_thread.c \
ymd2yd.c $(srcdir)/../lib/isc/assertions.c \
xsbprintf.c ymd2yd.c $(srcdir)/../lib/isc/assertions.c \
$(srcdir)/../lib/isc/buffer.c \
$(srcdir)/../lib/isc/backtrace-emptytbl.c \
$(srcdir)/../lib/isc/backtrace.c \
@@ -224,8 +224,8 @@ am__objects_4 = a_md5encrypt.$(OBJEXT) adjtime.$(OBJEXT) \
ssl_init.$(OBJEXT) statestr.$(OBJEXT) strdup.$(OBJEXT) \
strl_obsd.$(OBJEXT) syssignal.$(OBJEXT) timetoa.$(OBJEXT) \
timevalops.$(OBJEXT) uglydate.$(OBJEXT) vint64ops.$(OBJEXT) \
work_fork.$(OBJEXT) work_thread.$(OBJEXT) ymd2yd.$(OBJEXT) \
$(am__objects_3) $(am__objects_1)
work_fork.$(OBJEXT) work_thread.$(OBJEXT) xsbprintf.$(OBJEXT) \
ymd2yd.$(OBJEXT) $(am__objects_3) $(am__objects_1)
am_libntp_a_OBJECTS = systime.$(OBJEXT) $(am__objects_4)
libntp_a_OBJECTS = $(am_libntp_a_OBJECTS)
libntpsim_a_AR = $(AR) $(ARFLAGS)
@@ -244,7 +244,7 @@ am__libntpsim_a_SOURCES_DIST = systime_s.c a_md5encrypt.c adjtime.c \
snprintf.c socket.c socktoa.c socktohost.c ssl_init.c \
statestr.c strdup.c strl_obsd.c syssignal.c timetoa.c \
timevalops.c uglydate.c vint64ops.c work_fork.c work_thread.c \
ymd2yd.c $(srcdir)/../lib/isc/assertions.c \
xsbprintf.c ymd2yd.c $(srcdir)/../lib/isc/assertions.c \
$(srcdir)/../lib/isc/buffer.c \
$(srcdir)/../lib/isc/backtrace-emptytbl.c \
$(srcdir)/../lib/isc/backtrace.c \
@@ -704,6 +704,7 @@ libntp_a_SRCS = \
vint64ops.c \
work_fork.c \
work_thread.c \
xsbprintf.c \
ymd2yd.c \
$(libisc_SRCS) \
$(NULL)
@@ -876,6 +877,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vint64ops.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/work_fork.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/work_thread.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsbprintf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ymd2yd.Po@am__quote@
.c.o:
+2
View File
@@ -221,12 +221,14 @@ authreadkeys(
log_maybe(NULL,
"authreadkeys: invalid type for key %d",
keyno);
# ifdef ENABLE_CMAC
} else if (NID_cmac != keytype &&
EVP_get_digestbynid(keytype) == NULL) {
log_maybe(NULL,
"authreadkeys: no algorithm for key %d",
keyno);
keytype = 0;
# endif /* ENABLE_CMAC */
}
#else /* !OPENSSL follows */
/*
+1 -1
View File
@@ -54,7 +54,7 @@ calmonthstart(u_int32 ntptime, const time_t *pivot)
}
/*
* calweekstart - get NTP time at midnight of the last monday on or
* calweekstart - get NTP time at midnight of the last Monday on or
* before the current date.
*/
u_int32
+38
View File
@@ -1832,6 +1832,7 @@ isocal_date_to_ntp(
*/
static int32_t s_baseday = NTP_TO_UNIX_DAYS;
static int32_t s_gpsweek = 0;
int32_t
basedate_eval_buildstamp(void)
@@ -1901,6 +1902,7 @@ basedate_set_day(
struct calendar jd;
int32_t retv;
/* set NTP base date for NTP era unfolding */
if (day < NTP_TO_UNIX_DAYS) {
msyslog(LOG_WARNING,
"baseday_set_day: invalid day (%lu), UNIX epoch substituted",
@@ -1912,6 +1914,17 @@ basedate_set_day(
ntpcal_rd_to_date(&jd, day + DAY_NTP_STARTS);
msyslog(LOG_INFO, "basedate set to %04hu-%02hu-%02hu",
jd.year, (u_short)jd.month, (u_short)jd.monthday);
/* set GPS base week for GPS week unfolding */
day = ntpcal_weekday_ge(day + DAY_NTP_STARTS, CAL_SUNDAY)
- DAY_NTP_STARTS;
if (day < NTP_TO_GPS_DAYS)
day = NTP_TO_GPS_DAYS;
s_gpsweek = (day - NTP_TO_GPS_DAYS) / DAYSPERWEEK;
ntpcal_rd_to_date(&jd, day + DAY_NTP_STARTS);
msyslog(LOG_INFO, "gps base set to %04hu-%02hu-%02hu (week %d)",
jd.year, (u_short)jd.month, (u_short)jd.monthday, s_gpsweek);
return retv;
}
@@ -1934,4 +1947,29 @@ basedate_get_erabase(void)
return retv;
}
uint32_t
basedate_get_gpsweek(void)
{
return s_gpsweek;
}
uint32_t
basedate_expand_gpsweek(
unsigned short weekno
)
{
/* We do a fast modulus expansion here. Since all quantities are
* unsigned and we cannot go before the start of the GPS epoch
* anyway, and since the truncated GPS week number is 10 bit, the
* expansion becomes a simple sub/and/add sequence.
*/
#if GPSWEEKS != 1024
# error GPSWEEKS defined wrong -- should be 1024!
#endif
uint32_t diff;
diff = ((uint32_t)weekno - s_gpsweek) & (GPSWEEKS - 1);
return s_gpsweek + diff;
}
/* -*-EOF-*- */
+5 -1
View File
@@ -89,7 +89,9 @@ netwrite(
}
int set_user_group_ids(void);
#if defined(HAVE_DROPROOT)
extern int set_user_group_ids(void);
#endif
/* === functions === */
/*
@@ -594,7 +596,9 @@ fork_blocking_child(
init_logging("ntp_intres", 0, FALSE);
setup_logfile(NULL);
#ifdef HAVE_DROPROOT
(void) set_user_group_ids();
#endif
/*
* And now back to the portable code
+75
View File
@@ -0,0 +1,75 @@
/*
* xsbprintf.c - string buffer formatting helpers
*
* Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
* The contents of 'html/copyright.html' apply.
*/
#include <config.h>
#include <sys/types.h>
#include "ntp_stdlib.h"
/* eXtended Varlist String Buffer printf
*
* Formats via 'vsnprintf' into a string buffer, with some semantic
* specialties:
*
* - The start of the buffer pointer is updated according to the number
* of characters written.
* - If the buffer is insufficient to format the number of charactes,
* the partial result will be be discarded, and zero is returned to
* indicate nothing was written to the buffer.
* - On successful formatting, the return code is the return value of
* the inner call to 'vsnprintf()'.
* - If there is any error, the state of the buffer will not be
* changed. (Bytes in the buffer might be smashed, but the buffer
* position does not change, and the NUL marker stays in place at the
* current buffer position.)
* - If '(*ppbuf - pend) <= 0' (or ppbuf is NULL), fail with EINVAL.
*/
int
xvsbprintf(
char **ppbuf, /* pointer to buffer pointer (I/O) */
char * const pend, /* buffer end (I) */
char const *pfmt, /* printf-like format string */
va_list va /* formatting args for above */
)
{
char *pbuf = (ppbuf) ? *ppbuf : NULL;
int rc = -1;
if (pbuf && (pend - pbuf > 0)) {
size_t blen = (size_t)(pend - pbuf);
rc = vsnprintf(pbuf, blen, pfmt, va);
if (rc > 0) {
if ((size_t)rc >= blen)
rc = 0;
pbuf += rc;
}
*pbuf = '\0'; /* fear of bad vsnprintf */
*ppbuf = pbuf;
} else {
errno = EINVAL;
}
return rc;
}
/* variadic wrapper around the buffer string formatter */
int
xsbprintf(
char **ppbuf, /* pointer to buffer pointer (I/O) */
char * const pend, /* buffer end (I) */
char const *pfmt, /* printf-like format string */
... /* formatting args for above */
)
{
va_list va;
int rc;
va_start(va, pfmt);
rc = xvsbprintf(ppbuf, pend, pfmt, va);
va_end(va);
return rc;
}
/* that's all folks! */
+2 -2
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
+5 -9
View File
@@ -265,9 +265,7 @@ cvt_trimtsip(
clock_time->flags = PARSEB_POWERUP;
return CVT_OK;
}
if (week < GPSWRAP) {
week += GPSWEEKS;
}
week = basedate_expand_gpsweek(week);
/* time OK */
@@ -351,14 +349,12 @@ cvt_trimtsip(
int tls = t->t_gpsutc = (u_short) getshort((unsigned char *)&mb(12)); /* current leap correction (GPS-UTC) */
int tlsf = t->t_gpsutcleap = (u_short) getshort((unsigned char *)&mb(24)); /* new leap correction */
t->t_weekleap = (u_short) getshort((unsigned char *)&mb(20)); /* week no of leap correction */
if (t->t_weekleap < GPSWRAP)
t->t_weekleap = (u_short)(t->t_weekleap + GPSWEEKS);
t->t_weekleap = basedate_expand_gpsweek(
(u_short) getshort((unsigned char *)&mb(20))); /* week no of leap correction */
t->t_dayleap = (u_short) getshort((unsigned char *)&mb(22)); /* day in week of leap correction */
t->t_week = (u_short) getshort((unsigned char *)&mb(18)); /* current week no */
if (t->t_week < GPSWRAP)
t->t_week = (u_short)(t->t_weekleap + GPSWEEKS);
t->t_week = basedate_expand_gpsweek(
(u_short) getshort((unsigned char *)&mb(18))); /* current week no */
lbp = (unsigned char *)&mb(14); /* last update time */
if (fetch_ieee754(&lbp, IEEE_SINGLE, &t0t, trim_offsets) != IEEE_OK)
-5
View File
@@ -45,11 +45,6 @@ gpstolfp(
l_fp * lfp
)
{
if (weeks < GPSWRAP)
{
weeks += GPSWEEKS;
}
lfp->l_ui = (uint32_t)(weeks * SECSPERWEEK + days * SECSPERDAY + seconds + GPSORIGIN); /* convert to NTP time */
lfp->l_uf = 0;
}
+2 -2
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
+1 -1
View File
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.conf.texi)
#
# It has been AutoGen-ed August 14, 2018 at 08:29:07 AM by AutoGen 5.18.5
# It has been AutoGen-ed February 20, 2019 at 09:56:39 AM by AutoGen 5.18.5
# From the definitions ntp.conf.def
# and the template file agtexi-file.tpl
@end ignore
+1 -1
View File
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.keys.texi)
#
# It has been AutoGen-ed August 14, 2018 at 08:29:10 AM by AutoGen 5.18.5
# It has been AutoGen-ed February 20, 2019 at 09:56:41 AM by AutoGen 5.18.5
# From the definitions ntp.keys.def
# and the template file agtexi-file.tpl
@end ignore
+4 -4
View File
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpd.texi)
#
# It has been AutoGen-ed August 14, 2018 at 08:29:12 AM by AutoGen 5.18.5
# It has been AutoGen-ed February 20, 2019 at 09:56:42 AM by AutoGen 5.18.5
# From the definitions ntpd-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -142,7 +142,7 @@ with a status code of 0.
@exampleindent 0
@example
ntpd - NTP daemon program - Ver. 4.2.8p12
ntpd - NTP daemon program - Ver. 4.2.8p13
Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
[ <server1> ... <serverN> ]
Flg Arg Option-Name Description
@@ -164,7 +164,7 @@ Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
-g no panicgate Allow the first adjustment to be Big
- may appear multiple times
-G no force-step-once Step any initial offset correction.
-i Str jaildir Jail directory
-i --- jaildir built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs
-I Str interface Listen on an interface name or address
- may appear multiple times
-k Str keyfile path to symmetric keys
@@ -187,7 +187,7 @@ Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
-s Str statsdir Statistics file location
-t Str trustedkey Trusted key number
- may appear multiple times
-u Str user Run as userid (or userid:groupid)
-u --- user built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs
-U Num updateinterval interval in seconds between scans for new or dropped interfaces
Str var make ARG an ntp variable (RW)
- may appear multiple times
+3 -3
View File
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
.TH ntp.conf 5man "14 Aug 2018" "4.2.8p12" "File Formats"
.TH ntp.conf 5man "20 Feb 2019" "4.2.8p13" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-2caiQA/ag-bdaaPA)
.\" EDIT THIS FILE WITH CAUTION (in-mem file)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:28:54 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:43 AM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
+2 -2
View File
@@ -1,9 +1,9 @@
.Dd August 14 2018
.Dd February 20 2019
.Dt NTP_CONF 5mdoc File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:29:15 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:34 AM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
.TH ntp.conf 5 "14 Aug 2018" "4.2.8p12" "File Formats"
.TH ntp.conf 5 "20 Feb 2019" "4.2.8p13" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-2caiQA/ag-bdaaPA)
.\" EDIT THIS FILE WITH CAUTION (in-mem file)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:28:54 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:43 AM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
+2 -2
View File
@@ -1,9 +1,9 @@
.Dd August 14 2018
.Dd February 20 2019
.Dt NTP_CONF 5 File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:29:15 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:34 AM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
+2 -2
View File
@@ -1,8 +1,8 @@
.TH ntp.keys 5man "14 Aug 2018" "4.2.8p12" "File Formats"
.TH ntp.keys 5man "20 Feb 2019" "4.2.8p13" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:28:59 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:44 AM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME
+3 -3
View File
@@ -1,9 +1,9 @@
.Dd August 14 2018
.Dd February 20 2019
.Dt NTP_KEYS 5mdoc File Formats
.Os SunOS 5.10
.Os FreeBSD 11.2-RELEASE_SI
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:29:18 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:35 AM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
+167 -116
View File
@@ -1,101 +1,143 @@
<html lang="en">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>NTP Symmetric Key</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="NTP Symmetric Key">
<meta name="generator" content="makeinfo 4.7">
<link title="Top" rel="top" href="#Top">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family: serif; font-weight: normal; }
--></style>
<meta name="keywords" content="NTP Symmetric Key">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="#Top" rel="start" title="Top">
<link href="dir.html#Top" rel="up" title="(dir)">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body>
<h1 class="settitle">NTP Symmetric Key</h1>
<div class="node">
<p><hr>
<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002ekeys-Description">ntp.keys Description</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<br>
<body lang="en">
<h1 class="settitle" align="center">NTP Symmetric Key</h1>
<a name="Top"></a>
<div class="header">
<p>
Next: <a href="#ntp_002ekeys-Description" accesskey="n" rel="next">ntp.keys Description</a>, Previous: <a href="dir.html#Top" accesskey="p" rel="prev">(dir)</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; </p>
</div>
<a name="NTP_0027s-Symmetric-Key-File-User-Manual"></a>
<h1 class="top">NTP&rsquo;s Symmetric Key File User Manual</h1>
<h2 class="unnumbered">NTP's Symmetric Key File User Manual</h2>
<p>This document describes the symmetric key file for the NTP Project's
<p>This document describes the symmetric key file for the NTP Project&rsquo;s
<code>ntpd</code> program.
</p>
<p>This document applies to version 4.2.8p13 of <code>ntp.keys</code>.
</p>
<a name="SEC_Overview"></a>
<h2 class="shortcontents-heading">Short Table of Contents</h2>
<p>This document applies to version 4.2.8p12 of <code>ntp.keys</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
<ul>
<a href="#Top">NTP's Symmetric Key File User Manual</a>
<div class="shortcontents">
<ul class="no-bullet">
<li><a name="stoc-Description" href="#toc-Description">1 Description</a></li>
</ul>
</div>
<ul class="menu">
<li><a accesskey="1" href="#ntp_002ekeys-Description">ntp.keys Description</a>
<li><a accesskey="2" href="#ntp_002ekeys-Notes">ntp.keys Notes</a>
</ul>
<div class="node">
<p><hr>
<a name="ntp_002ekeys-Description"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#ntp_002ekeys-Description" accesskey="1">ntp.keys Description</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#ntp_002ekeys-Notes" accesskey="2">ntp.keys Notes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="ntp_002ekeys-Description"></a>
<div class="header">
<p>
Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
</div>
<!-- node-name, next, previous, up -->
<h3 class="section">Description</h3>
<a name="Description"></a>
<h2 class="chapter">1 Description</h2>
<p>The name and location of the symmetric key file for <code>ntpd</code> can
be specified in a configuration file, by default <code>/etc/ntp.keys</code>.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#ntp_002ekeys-Notes" accesskey="1">ntp.keys Notes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<div class="node">
<p><hr>
<hr>
<a name="ntp_002ekeys-Notes"></a>
<br>
<div class="header">
<p>
Previous: <a href="#ntp_002ekeys-See-Also" accesskey="p" rel="prev">ntp.keys See Also</a>, Up: <a href="#ntp_002ekeys-Description" accesskey="u" rel="up">ntp.keys Description</a> &nbsp; </p>
</div>
<a name="Notes-about-ntp_002ekeys"></a>
<h3 class="section">1.1 Notes about ntp.keys</h3>
<a name="index-ntp_002ekeys"></a>
<a name="index-NTP-symmetric-key-file-format"></a>
<h3 class="section">Notes about ntp.keys</h3>
<p><a name="index-ntp_002ekeys-1"></a><a name="index-NTP-symmetric-key-file-format-2"></a>
<p>This document describes the format of an NTP symmetric key file.
<p>This document describes the format of an NTP symmetric key file.
For a description of the use of this type of file, see the
"Authentication Support"
&quot;Authentication Support&quot;
section of the
<code>ntp.conf(5)</code>
page.
<p><code>ntpd(8)</code>
</p>
<p><code>ntpd(8)</code>
reads its keys from a file specified using the
<code>-k</code>
command line option or the
<code>keys</code>
statement in the configuration file.
statement in the configuration file.
While key number 0 is fixed by the NTP standard
(as 56 zero bits)
and may not be changed,
one or more keys numbered between 1 and 65535
may be arbitrarily set in the keys file.
<p>The key file uses the same comment conventions
as the configuration file.
</p>
<p>The key file uses the same comment conventions
as the configuration file.
Key entries use a fixed format of the form
</p>
<div class="example">
<pre class="example"><kbd>keyno</kbd> <kbd>type</kbd> <kbd>key</kbd> <kbd>opt_IP_list</kbd>
</pre></div>
<pre class="example"> <kbd>keyno</kbd> <kbd>type</kbd> <kbd>key</kbd> <kbd>opt_IP_list</kbd>
</pre>
<p>where
<p>where
<kbd>keyno</kbd>
is a positive integer (between 1 and 65535),
<kbd>type</kbd>
@@ -106,111 +148,120 @@ is the key itself, and
is an optional comma-separated list of IPs
where the
<kbd>keyno</kbd>
should be trusted.
that are allowed to serve time.
should be trusted.
that are allowed to serve time.
Each IP in
<kbd>opt_IP_list</kbd>
may contain an optional
<code>/subnetbits</code>
specification which identifies the number of bits for
the desired subnet of trust.
the desired subnet of trust.
If
<kbd>opt_IP_list</kbd>
is empty,
any properly-authenticated message will be
accepted.
<p>The
</p>
<p>The
<kbd>key</kbd>
may be given in a format
controlled by the
<kbd>type</kbd>
field.
field.
The
<kbd>type</kbd>
<code>MD5</code>
is always supported.
is always supported.
If
<code>ntpd</code>
was built with the OpenSSL library
then any digest library supported by that library may be specified.
then any digest library supported by that library may be specified.
However, if compliance with FIPS 140-2 is required the
<kbd>type</kbd>
must be either
<code>SHA</code>
or
<code>SHA1</code>.
<p>What follows are some key types, and corresponding formats:
<dl>
<dt><code>MD5</code><dd>The key is 1 to 16 printable characters terminated by
</p>
<p>What follows are some key types, and corresponding formats:
</p>
<dl compact="compact">
<dt><code>MD5</code></dt>
<dd><p>The key is 1 to 16 printable characters terminated by
an EOL,
whitespace,
or
a
<code>#</code>
(which is the "start of comment" character).
<br><dt><code>SHA</code><br><dt><code>SHA1</code><br><dt><code>RMD160</code><dd>The key is a hex-encoded ASCII string of 40 characters,
which is truncated as necessary.
(which is the &quot;start of comment&quot; character).
</p>
</dd>
<dt><code>SHA</code></dt>
<dt><code>SHA1</code></dt>
<dt><code>RMD160</code></dt>
<dd><p>The key is a hex-encoded ASCII string of 40 characters,
which is truncated as necessary.
</p></dd>
</dl>
<p>Note that the keys used by the
<p>Note that the keys used by the
<code>ntpq(8)</code>
and
<code>ntpdc(8)</code>
programs are checked against passwords
requested by the programs and entered by hand,
so it is generally appropriate to specify these keys in ASCII format.
<p>This section was generated by <strong>AutoGen</strong>,
using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp.keys</code> program.
</p>
<p>This section was generated by <strong>AutoGen</strong>,
using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp.keys</code> program.
This software is released under the NTP license, &lt;http://ntp.org/license&gt;.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#ntp_002ekeys-Files" accesskey="1">ntp.keys Files</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Files
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#ntp_002ekeys-See-Also" accesskey="2">ntp.keys See Also</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">See Also
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#ntp_002ekeys-Notes" accesskey="3">ntp.keys Notes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Notes
</td></tr>
</table>
<ul class="menu">
<li><a accesskey="1" href="#ntp_002ekeys-Files">ntp.keys Files</a>: Files
<li><a accesskey="2" href="#ntp_002ekeys-See-Also">ntp.keys See Also</a>: See Also
<li><a accesskey="3" href="#ntp_002ekeys-Notes">ntp.keys Notes</a>: Notes
</ul>
<div class="node">
<p><hr>
<a name="ntp_002ekeys-Files"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002ekeys-See-Also">ntp.keys See Also</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002ekeys-Notes">ntp.keys Notes</a>
<br>
<hr>
<a name="ntp_002ekeys-Files"></a>
<div class="header">
<p>
Next: <a href="#ntp_002ekeys-See-Also" accesskey="n" rel="next">ntp.keys See Also</a>, Up: <a href="#ntp_002ekeys-Notes" accesskey="u" rel="up">ntp.keys Notes</a> &nbsp; </p>
</div>
<h4 class="subsection">ntp.keys Files</h4>
<dl>
<dt><span class="file">/etc/ntp.keys</span><dd>the default name of the configuration file
<a name="ntp_002ekeys-Files-1"></a>
<h4 class="subsection">1.1.1 ntp.keys Files</h4>
<dl compact="compact">
<dt><samp>/etc/ntp.keys</samp></dt>
<dd><p>the default name of the configuration file
</p></dd>
</dl>
<div class="node">
<p><hr>
<a name="ntp_002ekeys-See-Also"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002ekeys-Notes">ntp.keys Notes</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002ekeys-Files">ntp.keys Files</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002ekeys-Notes">ntp.keys Notes</a>
<br>
<hr>
<a name="ntp_002ekeys-See-Also"></a>
<div class="header">
<p>
Previous: <a href="#ntp_002ekeys-Files" accesskey="p" rel="prev">ntp.keys Files</a>, Up: <a href="#ntp_002ekeys-Notes" accesskey="u" rel="up">ntp.keys Notes</a> &nbsp; </p>
</div>
<h4 class="subsection">ntp.keys See Also</h4>
<a name="ntp_002ekeys-See-Also-1"></a>
<h4 class="subsection">1.1.2 ntp.keys See Also</h4>
<p><code>ntp.conf(5)</code>,
<code>ntpd(1ntpdmdoc)</code>,
<code>ntpdate(1ntpdatemdoc)</code>,
<code>ntpdc(1ntpdcmdoc)</code>,
<code>sntp(1sntpmdoc)</code>
<div class="node">
<p><hr>
<a name="ntp_002ekeys-Notes"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002ekeys-See-Also">ntp.keys See Also</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002ekeys-Notes">ntp.keys Notes</a>
<br>
</p><hr>
<div class="header">
<p>
&nbsp; </p>
</div>
<h4 class="subsection">ntp.keys Notes</h4>
<a name="ntp_002ekeys-Notes-1"></a>
<h4 class="subsection">1.1.3 ntp.keys Notes</h4>
<p>This document was derived from FreeBSD.
</p><hr>
</body></html>
</body>
</html>
+2 -2
View File
@@ -1,8 +1,8 @@
.TH ntp.keys 5 "14 Aug 2018" "4.2.8p12" "File Formats"
.TH ntp.keys 5 "20 Feb 2019" "4.2.8p13" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:28:59 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:44 AM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME
+3 -3
View File
@@ -1,9 +1,9 @@
.Dd August 14 2018
.Dd February 20 2019
.Dt NTP_KEYS 5 File Formats
.Os SunOS 5.10
.Os FreeBSD 11.2-RELEASE_SI
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:29:18 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:35 AM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
+18 -5
View File
@@ -2065,8 +2065,12 @@ config_auth(
#ifdef AUTOKEY
/* crypto revoke command */
if (ptree->auth.revoke)
sys_revoke = 1UL << ptree->auth.revoke;
if (ptree->auth.revoke > 2 && ptree->auth.revoke < 32)
sys_revoke = (u_char)ptree->auth.revoke;
else if (ptree->auth.revoke)
msyslog(LOG_ERR,
"'revoke' value %d ignored",
ptree->auth.revoke);
#endif /* AUTOKEY */
}
#endif /* !SIM */
@@ -2112,6 +2116,10 @@ config_tos_clock(
break;
}
}
if (basedate_get_day() <= NTP_TO_UNIX_DAYS)
basedate_set_day(basedate_eval_buildstamp() - 11);
return ret;
}
@@ -2194,8 +2202,8 @@ config_tos(
case T_Minsane:
val = tos->value.d;
if ((int)tos->value.d < 1)
tos->value.d = 1;
if ((int)tos->value.d < 0)
tos->value.d = 0;
l_minsane = (int)tos->value.d;
break;
}
@@ -3813,7 +3821,12 @@ config_vars(
case T_Automax:
#ifdef AUTOKEY
sys_automax = curr_var->value.i;
if (curr_var->value.i > 2 && curr_var->value.i < 32)
sys_automax = (u_char)curr_var->value.i;
else
msyslog(LOG_ERR,
"'automax' value %d ignored",
curr_var->value.i);
#endif
break;
+26 -16
View File
@@ -1910,11 +1910,13 @@ ctl_putsys(
static struct timex ntx;
static u_long ntp_adjtime_time;
static const double to_ms =
static const double to_ms_usec =
1.0e-3; /* usec to msec */
static const double to_ms_nusec =
# ifdef STA_NANO
1.0e-6; /* nsec to msec */
# else
1.0e-3; /* usec to msec */
to_ms_usec;
# endif
/*
@@ -2319,7 +2321,7 @@ ctl_putsys(
case CS_K_OFFSET:
CTL_IF_KERNLOOP(
ctl_putdblf,
(sys_var[varid].text, 0, -1, to_ms * ntx.offset)
(sys_var[varid].text, 0, -1, to_ms_nusec * ntx.offset)
);
break;
@@ -2334,7 +2336,7 @@ ctl_putsys(
CTL_IF_KERNLOOP(
ctl_putdblf,
(sys_var[varid].text, 0, 6,
to_ms * ntx.maxerror)
to_ms_usec * ntx.maxerror)
);
break;
@@ -2342,7 +2344,7 @@ ctl_putsys(
CTL_IF_KERNLOOP(
ctl_putdblf,
(sys_var[varid].text, 0, 6,
to_ms * ntx.esterror)
to_ms_usec * ntx.esterror)
);
break;
@@ -2366,7 +2368,7 @@ ctl_putsys(
CTL_IF_KERNLOOP(
ctl_putdblf,
(sys_var[varid].text, 0, 6,
to_ms * ntx.precision)
to_ms_usec * ntx.precision)
);
break;
@@ -2394,7 +2396,7 @@ ctl_putsys(
case CS_K_PPS_JITTER:
CTL_IF_KERNPPS(
ctl_putdbl,
(sys_var[varid].text, to_ms * ntx.jitter)
(sys_var[varid].text, to_ms_nusec * ntx.jitter)
);
break;
@@ -3446,11 +3448,11 @@ write_variables(
* Look through the variables. Dump out at the first sign of
* trouble.
*/
while ((v = ctl_getitem(sys_var, &valuep)) != 0) {
while ((v = ctl_getitem(sys_var, &valuep)) != NULL) {
ext_var = 0;
if (v->flags & EOV) {
if ((v = ctl_getitem(ext_sys_var, &valuep)) !=
0) {
v = ctl_getitem(ext_sys_var, &valuep);
if (v != NULL) {
if (v->flags & EOV) {
ctl_error(CERR_UNKNOWNVAR);
return;
@@ -3464,16 +3466,24 @@ write_variables(
ctl_error(CERR_PERMISSION);
return;
}
if (!ext_var && (*valuep == '\0' || !atoint(valuep,
&val))) {
/* [bug 3565] writing makes sense only if we *have* a
* value in the packet!
*/
if (valuep == NULL) {
ctl_error(CERR_BADFMT);
return;
}
if (!ext_var && (val & ~LEAP_NOTINSYNC) != 0) {
ctl_error(CERR_BADVALUE);
return;
if (!ext_var) {
if ( !(*valuep && atoint(valuep, &val))) {
ctl_error(CERR_BADFMT);
return;
}
if ((val & ~LEAP_NOTINSYNC) != 0) {
ctl_error(CERR_BADVALUE);
return;
}
}
if (ext_var) {
octets = strlen(v->text) + strlen(valuep) + 2;
vareqv = emalloc(octets);
+4 -3
View File
@@ -353,8 +353,8 @@ make_keylist(
* included in the hash is zero if broadcast mode, the peer
* cookie if client mode or the host cookie if symmetric modes.
*/
mpoll = 1 << min(peer->ppoll, peer->hpoll);
lifetime = min(1U << sys_automax, NTP_MAXSESSION * mpoll);
mpoll = 1U << min(peer->ppoll, peer->hpoll);
lifetime = min((1UL << sys_automax), NTP_MAXSESSION * mpoll);
if (peer->hmode == MODE_BROADCAST)
cookie = 0;
else
@@ -1486,7 +1486,8 @@ crypto_verify(
return (XEVNT_LEN);
i = (vallen + 3) / 4;
siglen = ntohl(ep->pkt[i++]);
siglen = ntohl(ep->pkt[i]);
++i;
if ( siglen > MAX_VALLEN
|| len - VALUE_LEN < ((vallen + 3) / 4) * 4
|| len - VALUE_LEN - ((vallen + 3) / 4) * 4
+18 -14
View File
@@ -246,7 +246,11 @@ ntp_adjtime_error_handler(
)
{
char des[1024] = ""; /* Decoded Error Status */
char *dbp, *ebp;
dbp = des;
ebp = dbp + sizeof(des);
switch (ret) {
case -1:
switch (saved_errno) {
@@ -363,37 +367,37 @@ or, from ntp_adjtime():
/* error (see status word) */
if (ptimex->status & STA_UNSYNC)
snprintf(des, sizeof(des), "%s%sClock Unsynchronized",
des, (*des) ? "; " : "");
xsbprintf(&dbp, ebp, "%sClock Unsynchronized",
(*des) ? "; " : "");
if (ptimex->status & STA_CLOCKERR)
snprintf(des, sizeof(des), "%s%sClock Error",
des, (*des) ? "; " : "");
xsbprintf(&dbp, ebp, "%sClock Error",
(*des) ? "; " : "");
if (!(ptimex->status & STA_PPSSIGNAL)
&& ptimex->status & STA_PPSFREQ)
snprintf(des, sizeof(des), "%s%sPPS Frequency Sync wanted but no PPS",
des, (*des) ? "; " : "");
xsbprintf(&dbp, ebp, "%sPPS Frequency Sync wanted but no PPS",
(*des) ? "; " : "");
if (!(ptimex->status & STA_PPSSIGNAL)
&& ptimex->status & STA_PPSTIME)
snprintf(des, sizeof(des), "%s%sPPS Time Sync wanted but no PPS signal",
des, (*des) ? "; " : "");
xsbprintf(&dbp, ebp, "%sPPS Time Sync wanted but no PPS signal",
(*des) ? "; " : "");
if ( ptimex->status & STA_PPSTIME
&& ptimex->status & STA_PPSJITTER)
snprintf(des, sizeof(des), "%s%sPPS Time Sync wanted but PPS Jitter exceeded",
des, (*des) ? "; " : "");
xsbprintf(&dbp, ebp, "%sPPS Time Sync wanted but PPS Jitter exceeded",
(*des) ? "; " : "");
if ( ptimex->status & STA_PPSFREQ
&& ptimex->status & STA_PPSWANDER)
snprintf(des, sizeof(des), "%s%sPPS Frequency Sync wanted but PPS Wander exceeded",
des, (*des) ? "; " : "");
xsbprintf(&dbp, ebp, "%sPPS Frequency Sync wanted but PPS Wander exceeded",
(*des) ? "; " : "");
if ( ptimex->status & STA_PPSFREQ
&& ptimex->status & STA_PPSERROR)
snprintf(des, sizeof(des), "%s%sPPS Frequency Sync wanted but Calibration error detected",
des, (*des) ? "; " : "");
xsbprintf(&dbp, ebp, "%sPPS Frequency Sync wanted but Calibration error detected",
(*des) ? "; " : "");
if (pps_call && !(ptimex->status & STA_PPSSIGNAL))
report_event(EVNT_KERN, NULL,
+4 -4
View File
@@ -387,9 +387,9 @@ transmit(
*/
if (peer->cast_flags & (MDF_BCAST | MDF_MCAST)) {
peer->outdate = current_time;
poll_update(peer, hpoll);
if (sys_leap != LEAP_NOTINSYNC)
peer_xmit(peer);
poll_update(peer, hpoll);
return;
}
@@ -408,6 +408,7 @@ transmit(
*/
if (peer->cast_flags & MDF_ACAST) {
peer->outdate = current_time;
poll_update(peer, hpoll);
if (peer->unreach > sys_beacon) {
peer->unreach = 0;
peer->ttl = 0;
@@ -419,7 +420,6 @@ transmit(
peer_xmit(peer);
}
peer->unreach++;
poll_update(peer, hpoll);
return;
}
@@ -437,11 +437,11 @@ transmit(
*/
if (peer->cast_flags & MDF_POOL) {
peer->outdate = current_time;
poll_update(peer, hpoll);
if ( (peer_associations <= 2 * sys_maxclock)
&& ( peer_associations < sys_maxclock
|| sys_survivors < sys_minclock))
pool_xmit(peer);
poll_update(peer, hpoll);
return;
}
@@ -549,9 +549,9 @@ transmit(
/*
* Do not transmit if in broadcast client mode.
*/
poll_update(peer, hpoll);
if (peer->hmode != MODE_BCLIENT)
peer_xmit(peer);
poll_update(peer, hpoll);
return;
}
+8
View File
@@ -2536,7 +2536,15 @@ get_clock_info(
DTOLFP(clock_stat.fudgetime2, &ltmp);
HTONL_FP(&ltmp, &ic->fudgetime2);
ic->fudgeval1 = htonl((u_int32)clock_stat.fudgeval1);
/* [Bug3527] Backward Incompatible: ic->fudgeval2 is
* a string, instantiated via memcpy() so there is no
* endian issue to correct.
*/
#ifdef DISABLE_BUG3527_FIX
ic->fudgeval2 = htonl(clock_stat.fudgeval2);
#else
ic->fudgeval2 = clock_stat.fudgeval2;
#endif
free_varlist(clock_stat.kv_list);
+4 -4
View File
@@ -82,8 +82,8 @@ u_long orphwait; /* orphan wait time */
#ifdef AUTOKEY
static u_long revoke_timer; /* keys revoke timer */
static u_long keys_timer; /* session key timer */
u_long sys_revoke = KEY_REVOKE; /* keys revoke timeout (log2 s) */
u_long sys_automax = NTP_AUTOMAX; /* key list timeout (log2 s) */
u_char sys_revoke = KEY_REVOKE; /* keys revoke timeout (log2 s) */
u_char sys_automax = NTP_AUTOMAX; /* key list timeout (log2 s) */
#endif /* AUTOKEY */
/*
@@ -404,7 +404,7 @@ timer(void)
* Garbage collect expired keys.
*/
if (keys_timer <= current_time) {
keys_timer += 1 << sys_automax;
keys_timer += (1UL << sys_automax);
auth_agekeys();
}
@@ -413,7 +413,7 @@ timer(void)
* to regenerate cookies.
*/
if (revoke_timer && revoke_timer <= current_time) {
revoke_timer += 1 << sys_revoke;
revoke_timer += (1UL << sys_revoke);
RAND_bytes((u_char *)&sys_private, 4);
}
#endif /* AUTOKEY */
+8 -8
View File
@@ -1,11 +1,11 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.c)
*
* It has been AutoGen-ed August 14, 2018 at 08:27:45 AM by AutoGen 5.18.5
* It has been AutoGen-ed February 20, 2019 at 09:56:15 AM by AutoGen 5.18.5
* From the definitions ntpd-opts.def
* and the template file options
*
* Generated from AutoOpts 41:0:16 templates.
* Generated from AutoOpts 41:1:16 templates.
*
* AutoOpts is a copyrighted work. This source file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -75,7 +75,7 @@ extern FILE * option_usage_fp;
* static const strings for ntpd options
*/
static char const ntpd_opt_strs[3132] =
/* 0 */ "ntpd 4.2.8p12\n"
/* 0 */ "ntpd 4.2.8p13\n"
"Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
@@ -205,12 +205,12 @@ static char const ntpd_opt_strs[3132] =
/* 2901 */ "output version information and exit\0"
/* 2937 */ "version\0"
/* 2945 */ "NTPD\0"
/* 2950 */ "ntpd - NTP daemon program - Ver. 4.2.8p12\n"
/* 2950 */ "ntpd - NTP daemon program - Ver. 4.2.8p13\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
"\t\t[ <server1> ... <serverN> ]\n\0"
/* 3082 */ "http://bugs.ntp.org, [email protected]\0"
/* 3116 */ "\n\0"
/* 3118 */ "ntpd 4.2.8p12";
/* 3118 */ "ntpd 4.2.8p13";
/**
* ipv4 option description with
@@ -1529,7 +1529,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpdOptions.pzCopyright */
puts(_("ntpd 4.2.8p12\n\
puts(_("ntpd 4.2.8p13\n\
Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
@@ -1670,7 +1670,7 @@ implied warranty.\n"));
puts(_("output version information and exit"));
/* referenced via ntpdOptions.pzUsageTitle */
puts(_("ntpd - NTP daemon program - Ver. 4.2.8p12\n\
puts(_("ntpd - NTP daemon program - Ver. 4.2.8p13\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
\t\t[ <server1> ... <serverN> ]\n"));
@@ -1678,7 +1678,7 @@ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
puts(_("\n"));
/* referenced via ntpdOptions.pzFullVersion */
puts(_("ntpd 4.2.8p12"));
puts(_("ntpd 4.2.8p13"));
/* referenced via ntpdOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
+5 -5
View File
@@ -1,11 +1,11 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.h)
*
* It has been AutoGen-ed August 14, 2018 at 08:27:44 AM by AutoGen 5.18.5
* It has been AutoGen-ed February 20, 2019 at 09:56:15 AM by AutoGen 5.18.5
* From the definitions ntpd-opts.def
* and the template file options
*
* Generated from AutoOpts 41:0:16 templates.
* Generated from AutoOpts 41:1:16 templates.
*
* AutoOpts is a copyrighted work. This header file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -53,7 +53,7 @@
* tolerable version is at least as old as what was current when the header
* template was released.
*/
#define AO_TEMPLATE_VERSION 167936
#define AO_TEMPLATE_VERSION 167937
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
@@ -106,9 +106,9 @@ typedef enum {
/** count of all options for ntpd */
#define OPTION_CT 38
/** ntpd version */
#define NTPD_VERSION "4.2.8p12"
#define NTPD_VERSION "4.2.8p13"
/** Full ntpd version text */
#define NTPD_FULL_VERSION "ntpd 4.2.8p12"
#define NTPD_FULL_VERSION "ntpd 4.2.8p13"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
+3 -3
View File
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
.TH ntpd 1ntpdman "14 Aug 2018" "4.2.8p12" "User Commands"
.TH ntpd 1ntpdman "20 Feb 2019" "4.2.8p13" "User Commands"
.\"
.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-jbaWTB/ag-ubaOSB)
.\" EDIT THIS FILE WITH CAUTION (in-mem file)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:29:02 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:46 AM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
+2 -2
View File
@@ -1,9 +1,9 @@
.Dd August 14 2018
.Dd February 20 2019
.Dt NTPD 1ntpdmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:29:20 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:37 AM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
+36 -19
View File
@@ -534,6 +534,7 @@ set_process_priority(void)
* Detach from terminal (much like daemon())
* Nothe that this function calls exit()
*/
# ifdef HAVE_WORKING_FORK
static void
detach_from_terminal(
int pipe_fds[2],
@@ -617,6 +618,7 @@ detach_from_terminal(
return;
}
# endif /* HAVE_WORKING_FORK */
#ifdef HAVE_DROPROOT
/*
@@ -665,8 +667,7 @@ getuser:
* Map group name/number to group ID
*/
static int
map_group(
)
map_group(void)
{
char *endp;
@@ -688,24 +689,9 @@ getgroup:
return 1;
}
/*
* Change (effective) user and group IDs, also initialize the supplementary group access list
*/
int
set_user_group_ids(
)
static int
set_group_ids(void)
{
/* If the the user was already mapped, no need to map it again */
if ((NULL != user) && (0 == sw_uid)) {
if (0 == map_user())
exit (-1);
}
/* same applies for the group */
if ((NULL != group) && (0 == sw_gid)) {
if (0 == map_group())
exit (-1);
}
if (user && initgroups(user, sw_gid)) {
msyslog(LOG_ERR, "Cannot initgroups() to user `%s': %m", user);
return 0;
@@ -729,6 +715,12 @@ set_user_group_ids(
msyslog(LOG_ERR, "initgroups(<%s>, %d) filed: %m", pw->pw_name, pw->pw_gid);
return 0;
}
return 1;
}
static int
set_user_ids(void)
{
if (user && setuid(sw_uid)) {
msyslog(LOG_ERR, "Cannot setuid() to user `%s': %m", user);
return 0;
@@ -737,6 +729,31 @@ set_user_group_ids(
msyslog(LOG_ERR, "Cannot seteuid() to user `%s': %m", user);
return 0;
}
return 1;
}
/*
* Change (effective) user and group IDs, also initialize the supplementary group access list
*/
int set_user_group_ids(void);
int
set_user_group_ids(void)
{
/* If the the user was already mapped, no need to map it again */
if ((NULL != user) && (0 == sw_uid)) {
if (0 == map_user())
exit (-1);
}
/* same applies for the group */
if ((NULL != group) && (0 == sw_gid)) {
if (0 == map_group())
exit (-1);
}
if (getegid() != sw_gid && 0 == set_group_ids())
return 0;
if (geteuid() != sw_uid && 0 == set_user_ids())
return 0;
return 1;
}
+765 -684
View File
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
.TH ntpd @NTPD_MS@ "14 Aug 2018" "4.2.8p12" "User Commands"
.TH ntpd @NTPD_MS@ "20 Feb 2019" "4.2.8p13" "User Commands"
.\"
.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-jbaWTB/ag-ubaOSB)
.\" EDIT THIS FILE WITH CAUTION (in-mem file)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:29:02 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:46 AM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
+2 -2
View File
@@ -1,9 +1,9 @@
.Dd August 14 2018
.Dd February 20 2019
.Dt NTPD @NTPD_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:29:20 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:37 AM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
+96 -23
View File
@@ -60,6 +60,9 @@
#include <stdio.h>
#include <syslog.h>
#include <ctype.h>
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
struct btfp_time /* Structure for reading 5 time words */
/* in one ioctl(2) operation. */
@@ -74,17 +77,16 @@ struct btfp_time /* Structure for reading 5 time words */
#define IOCIOWN( l, n, s ) ( BTFPIOC | n )
/***** Simple ioctl commands *****/
#define RUNLOCK IOCIOR(b, 19, int ) /* Release Capture Lockout */
#define RCR0 IOCIOR(b, 22, int ) /* Read control register zero.*/
#define WCR0 IOCIOWN(b, 23, int) /* Write control register zero*/
#define RUNLOCK IOCIOR(b, 19, int ) /* Release Capture Lockout */
#define RCR0 IOCIOR(b, 22, int ) /* Read control register zero.*/
#define WCR0 IOCIOWN(b, 23, int) /* Write control register zero*/
/***** Compound ioctl commands *****/
/* Read all 5 time words in one call. */
#define READTIME IOCIORN(b, 32, sizeof( struct btfp_time ))
#if defined(__FreeBSD__)
#undef READTIME
#define READTIME _IOR('u', 5, struct btfp_time )
# define READTIME _IOR('u', 5, struct btfp_time )
#else
# define READTIME IOCIORN(b, 32, sizeof( struct btfp_time ))
#endif
/* Solaris specific section */
@@ -165,18 +167,76 @@ static void vme_poll (int unit, struct peer *);
struct vmedate *get_datumtime(struct vmedate *);
void tvme_fill(struct vmedate *, uint32_t btm[2]);
void stfp_time2tvme(struct vmedate *time_vme, struct stfp_time *stfp);
inline const char *DEVICE_NAME(int n);
static const char *get_devicename(int n);
/* [Bug 3558] and [Bug 1674] [email protected] says:
*
* bcReadBinTime() is defined to use two DWORD pointers on Windows and
* Linux in the BANCOMM SDK. DWORD is of course Windows-specific
* (*shudder*), and it is defined as 'unsigned long' under
* Linux/Unix. (*sigh*)
*
* This creates quite some headache. The size of 'unsigned long' is
* platform/compiler/memory-model dependent (LP32 vs LP64 vs LLP64),
* while the card itself always creates 32bit time stamps. What a
* bummer. And DWORD has tendency to contain 64bit on Win64 (which is
* why we have a DWORD32 defined on Win64) so it can be used as
* substitute for 'UINT_PTR' in Windows API headers. I won't even try
* to comment on that, because anything I have to say will not be civil.
*
* We work around this by possibly using a wrapper function that makes
* the necessary conversions/casts. It might be a bit tricky to
* maintain the conditional logic below, but any lingering disease needs
* constant care to avoid a breakout.
*/
#if defined(__linux__)
typedef unsigned long bcBinTimeT;
# if SIZEOF_LONG == 4
# define safeReadBinTime bcReadBinTime
# endif
#elif defined(SYS_WINNT)
typedef DWORD bcBinTimeT;
# if !defined(_WIN64) || _WIN64 == 0
# define safeReadBinTime bcReadBinTime
# endif
#else
typedef uint32_t bcBinTimeT;
# define safeReadBinTime bcReadBinTime
#endif
/*
* Define the bc*() functions as weak so we can compile/link without them.
* Only clients with the card will have the proprietary vendor device driver
* and interface library needed for use on Linux/Windows platforms.
*/
extern uint32_t __attribute__ ((weak)) bcReadBinTime(SYMMT_PCI_HANDLE, uint32_t *, uint32_t*, uint8_t*);
extern uint32_t __attribute__ ((weak)) bcReadBinTime(SYMMT_PCI_HANDLE, bcBinTimeT*, bcBinTimeT*, uint8_t*);
extern SYMMT_PCI_HANDLE __attribute__ ((weak)) bcStartPci(void);
extern void __attribute__ ((weak)) bcStopPci(SYMMT_PCI_HANDLE);
/* This is the conversion wrapper for the long/DWORD/uint32_t clash in
* reading binary times.
*/
#ifndef safeReadBinTime
static uint32_t
safeReadBinTime(
SYMMT_PCI_HANDLE hnd,
uint32_t *pt1,
uint32_t *pt2,
uint8_t *p3
)
{
bcBinTimeT t1, t2;
uint32_t rc;
rc = bcReadBinTime(hnd, &t1, &t2, p3);
if (rc != 0) {
*pt1 = (uint32_t)t1;
*pt2 = (uint32_t)t2;
}
return rc;
}
#endif /* !defined(safeReadBinTime) */
/*
* Transfer vector
*/
@@ -195,15 +255,27 @@ int regvalue;
int tfp_type; /* mode selector, indicate platform and driver interface */
SYMMT_PCI_HANDLE stfp_handle;
/**
* this macro returns the device name based on
* the platform we are running on and the device number
/* This helper function returns the device name based on the platform we
* are running on and the device number.
*
* Uses a static buffer, so the result is valid only to the next call of
* this function!
*/
#if defined(__sun__)
inline const char *DEVICE_NAME(int n) {static char s[20]={0}; snprintf(s,19,"/dev/stfp%d",n);return s;}
#else
inline const char* DEVICE_NAME(int n) {static char s[20]={0}; snprintf(s,19,"/dev/btfp%d",n);return s;}
#endif /**__sun__**/
static const char*
get_devicename(int n)
{
# if defined(__sun__)
static const char * const template ="/dev/stfp%d";
# else
static const char * const template ="/dev/btfp%d";
# endif
static char namebuf[20];
snprintf(namebuf, sizeof(namebuf), template, n);
namebuf[sizeof(namebuf)-1] = '\0'; /* paranoia rulez! */
return namebuf;
}
/*
* vme_start - open the VME device and initialize data for processing
@@ -235,9 +307,9 @@ vme_start(
*/
#ifdef DEBUG
printf("Opening DATUM DEVICE %s\n",DEVICE_NAME(peer->refclkunit));
printf("Opening DATUM DEVICE %s\n",get_devicename(peer->refclkunit));
#endif
if ( (fd_vme = open(DEVICE_NAME(peer->refclkunit), O_RDWR)) < 0) {
if ( (fd_vme = open(get_devicename(peer->refclkunit), O_RDWR)) < 0) {
msyslog(LOG_ERR, "vme_start: failed open of %s: %m", vmedev);
return (0);
}
@@ -433,7 +505,7 @@ get_datumtime(struct vmedate *time_vme)
break;
case 2: /* Linux/Windows, PCI, 2 32bit time words */
if (bcReadBinTime(stfp_handle, &btm[1], &btm[0], &dmy) == 0) {
if (safeReadBinTime(stfp_handle, &btm[1], &btm[0], &dmy) == 0) {
msyslog(LOG_ERR, "get_datumtime error: %m");
return(NULL);
}
@@ -512,10 +584,11 @@ void
tvme_fill(struct vmedate *time_vme, uint32_t btm[2])
{
struct tm maj;
uint32_t dmaj, dmin;
time_t dmaj;
uint32_t dmin;
dmaj = btm[1]; /* syntax sugar */
dmin = btm[0];
dmaj = btm[1]; /* syntax sugar & expansion */
dmin = btm[0]; /* just syntax sugar */
gmtime_r(&dmaj, &maj);
time_vme->day = maj.tm_yday+1;
+1 -56
View File
@@ -158,10 +158,6 @@ static char * jupiter_send (struct instance *, struct jheader *);
static void jupiter_shutdown(int, struct peer *);
static int jupiter_start (int, struct peer *);
static u_int get_full_week(u_int base_week, u_int gpos_week);
static u_int get_base_week(void);
/*
* Transfer vector
*/
@@ -855,8 +851,7 @@ jupiter_parse_gpos(struct instance *instance, u_short *sp)
}
instance->gpos_sweek = DS2UI(jg->sweek);
instance->gpos_gweek = get_full_week(get_base_week(),
getshort(jg->gweek));
instance->gpos_gweek = basedate_expand_gpsweek(getshort(jg->gweek));
/* according to the protocol spec, the seconds-in-week cannot
* exceed the nominal value: Is it really necessary to normalise
@@ -1129,56 +1124,6 @@ jupiter_recv(struct instance *instance)
return (cc);
}
static u_int
get_base_week(void)
{
static int init_done /* = 0 */;
static u_int base_week;
/* Get the build date, convert to days since GPS epoch and
* finally weeks since GPS epoch. Note that the build stamp is
* trusted once it is fetched -- only dates before the GPS epoch
* are not permitted. This will permit proper synchronisation
* for a time range of 1024 weeks starting with 00:00:00 of the
* last Sunday on or before the build time.
*
* If the impossible happens and fetching the build date fails,
* a 1024-week cycle starting with 2016-01-03 is assumed to
* avoid catastropic errors. This will work until 2035-08-19.
*/
if (!init_done) {
struct calendar bd;
if (ntpcal_get_build_date(&bd)) {
int32_t days = ntpcal_date_to_rd(&bd);
if (days > RDN_GPS_EPOCH)
days -= RDN_GPS_EPOCH;
else
days = 0;
base_week = days / 7;
} else {
base_week = 1878; /* 2016-01-03, Sunday */
msyslog(LOG_ERR,
"refclock_jupiter: ntpcal_get_build_date() failed: %s",
"using 2016-01-03 as GPS base!");
}
init_done = 1;
}
return base_week;
}
static u_int
get_full_week(
u_int base_week,
u_int gpos_week
)
{
/* Periodic extension on base week. Since the period is 1024
* weeks and we do unsigned arithmetic here, we can do wonderful
* things with masks and the well-defined overflow behaviour.
*/
return base_week + ((gpos_week - base_week) & 1023);
}
#else /* not (REFCLOCK && CLOCK_JUPITER && HAVE_PPSAPI) */
int refclock_jupiter_bs;
#endif /* not (REFCLOCK && CLOCK_JUPITER && HAVE_PPSAPI) */
+1 -2
View File
@@ -4256,8 +4256,7 @@ mk_utcinfo(
struct tm *tm;
int nc;
if (wnlsf < GPSWRAP)
wnlsf += GPSWEEKS;
wnlsf = basedate_expand_gpsweek(wnlsf);
/* 'wnt' not used here: would need the same treatment as 'wnlsf */
t_ls = (time_t) wnlsf * SECSPERWEEK
+2 -2
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
+12 -9
View File
@@ -2176,10 +2176,11 @@ print_server(
str, fptoa((s_fp)pp->rootdelay, 6),
ufptoa(pp->rootdisp, 6));
(void) fprintf(fp, "transmitted %d, in filter %d\n",
if (pp->xmtcnt != pp->filter_nextpt)
(void) fprintf(fp, "transmitted %d, in filter %d\n",
pp->xmtcnt, pp->filter_nextpt);
(void) fprintf(fp, "reference time: %s\n",
(void) fprintf(fp, "reference time: %s\n",
prettydate(&pp->reftime));
(void) fprintf(fp, "originate timestamp: %s\n",
prettydate(&pp->org));
@@ -2189,22 +2190,24 @@ print_server(
if (sys_samples > 1) {
(void) fprintf(fp, "filter delay: ");
for (i = 0; i < NTP_SHIFT; i++) {
(void) fprintf(fp, " %-8.8s", fptoa(pp->filter_delay[i], 5));
if (i == (NTP_SHIFT>>1)-1)
(void) fprintf(fp, "\n ");
if (i == (NTP_SHIFT>>1))
(void) fprintf(fp, "\n ");
(void) fprintf(fp, " %-10.10s",
(i<sys_samples ? fptoa(pp->filter_delay[i], 5) : "----"));
}
(void) fprintf(fp, "\n");
(void) fprintf(fp, "filter offset:");
for (i = 0; i < PEER_SHIFT; i++) {
(void) fprintf(fp, " %-8.8s", lfptoa(&pp->filter_offset[i], 6));
if (i == (PEER_SHIFT>>1)-1)
(void) fprintf(fp, "\n ");
if (i == (PEER_SHIFT>>1))
(void) fprintf(fp, "\n ");
(void) fprintf(fp, " %-10.10s",
(i<sys_samples ? lfptoa(&pp->filter_offset[i], 6): "----"));
}
(void) fprintf(fp, "\n");
}
(void) fprintf(fp, "delay %s, dispersion %s\n",
(void) fprintf(fp, "delay %s, dispersion %s, ",
fptoa((s_fp)pp->delay, 5), ufptoa(pp->dispersion, 5));
(void) fprintf(fp, "offset %s\n\n",
+2 -2
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
+2 -2
View File
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpdc.texi)
#
# It has been AutoGen-ed August 14, 2018 at 08:29:40 AM by AutoGen 5.18.5
# It has been AutoGen-ed February 20, 2019 at 09:56:51 AM by AutoGen 5.18.5
# From the definitions ntpdc-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -76,7 +76,7 @@ with a status code of 0.
@exampleindent 0
@example
ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p12
ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p13
Usage: ntpdc [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
+1 -1
View File
@@ -1,4 +1,4 @@
#! /usr/local/bin/perl -w
#! /ntpbuild/bin/perl -w
$found = 0;
$last = 0;
+8 -8
View File
@@ -1,11 +1,11 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpdc-opts.c)
*
* It has been AutoGen-ed August 14, 2018 at 08:29:29 AM by AutoGen 5.18.5
* It has been AutoGen-ed February 20, 2019 at 09:56:48 AM by AutoGen 5.18.5
* From the definitions ntpdc-opts.def
* and the template file options
*
* Generated from AutoOpts 41:0:16 templates.
* Generated from AutoOpts 41:1:16 templates.
*
* AutoOpts is a copyrighted work. This source file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -69,7 +69,7 @@ extern FILE * option_usage_fp;
* static const strings for ntpdc options
*/
static char const ntpdc_opt_strs[1914] =
/* 0 */ "ntpdc 4.2.8p12\n"
/* 0 */ "ntpdc 4.2.8p13\n"
"Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
@@ -128,14 +128,14 @@ static char const ntpdc_opt_strs[1914] =
/* 1695 */ "no-load-opts\0"
/* 1708 */ "no\0"
/* 1711 */ "NTPDC\0"
/* 1717 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p12\n"
/* 1717 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p13\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
/* 1848 */ "$HOME\0"
/* 1854 */ ".\0"
/* 1856 */ ".ntprc\0"
/* 1863 */ "http://bugs.ntp.org, [email protected]\0"
/* 1897 */ "\n\0"
/* 1899 */ "ntpdc 4.2.8p12";
/* 1899 */ "ntpdc 4.2.8p13";
/**
* ipv4 option description with
@@ -796,7 +796,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpdcOptions.pzCopyright */
puts(_("ntpdc 4.2.8p12\n\
puts(_("ntpdc 4.2.8p13\n\
Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
@@ -862,14 +862,14 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via ntpdcOptions.pzUsageTitle */
puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p12\n\
puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p13\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
/* referenced via ntpdcOptions.pzExplain */
puts(_("\n"));
/* referenced via ntpdcOptions.pzFullVersion */
puts(_("ntpdc 4.2.8p12"));
puts(_("ntpdc 4.2.8p13"));
/* referenced via ntpdcOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
+5 -5
View File
@@ -1,11 +1,11 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpdc-opts.h)
*
* It has been AutoGen-ed August 14, 2018 at 08:29:28 AM by AutoGen 5.18.5
* It has been AutoGen-ed February 20, 2019 at 09:56:48 AM by AutoGen 5.18.5
* From the definitions ntpdc-opts.def
* and the template file options
*
* Generated from AutoOpts 41:0:16 templates.
* Generated from AutoOpts 41:1:16 templates.
*
* AutoOpts is a copyrighted work. This header file is not encumbered
* by AutoOpts licensing, but is provided under the licensing terms chosen
@@ -53,7 +53,7 @@
* tolerable version is at least as old as what was current when the header
* template was released.
*/
#define AO_TEMPLATE_VERSION 167936
#define AO_TEMPLATE_VERSION 167937
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
|| (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
# error option template version mismatches autoopts/options.h header
@@ -83,9 +83,9 @@ typedef enum {
/** count of all options for ntpdc */
#define OPTION_CT 15
/** ntpdc version */
#define NTPDC_VERSION "4.2.8p12"
#define NTPDC_VERSION "4.2.8p13"
/** Full ntpdc version text */
#define NTPDC_FULL_VERSION "ntpdc 4.2.8p12"
#define NTPDC_FULL_VERSION "ntpdc 4.2.8p13"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
+3 -3
View File
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
.TH ntpdc 1ntpdcman "14 Aug 2018" "4.2.8p12" "User Commands"
.TH ntpdc 1ntpdcman "20 Feb 2019" "4.2.8p13" "User Commands"
.\"
.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-uwaqJD/ag-GwaiID)
.\" EDIT THIS FILE WITH CAUTION (in-mem file)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:29:36 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:53 AM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
+2 -2
View File
@@ -1,9 +1,9 @@
.Dd August 14 2018
.Dd February 20 2019
.Dt NTPDC 1ntpdcmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc)
.\"
.\" It has been AutoGen-ed August 14, 2018 at 08:29:43 AM by AutoGen 5.18.5
.\" It has been AutoGen-ed February 20, 2019 at 09:56:50 AM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
Loaded 100 of 1838 files, more files were not shown because too many files have changed in this diff. Show more