Commit Graph

13530 Commits

Author SHA1 Message Date
Jonathan T. Looney
752c009f53 Bump netstat.1's .Dd after r331347. 2018-03-22 09:43:15 +00:00
Jonathan T. Looney
2529f56ed3 Add the "TCP Blackbox Recorder" which we discussed at the developer
summits at BSDCan and BSDCam in 2017.

The TCP Blackbox Recorder allows you to capture events on a TCP connection
in a ring buffer. It stores metadata with the event. It optionally stores
the TCP header associated with an event (if the event is associated with a
packet) and also optionally stores information on the sockets.

It supports setting a log ID on a TCP connection and using this to correlate
multiple connections that share a common log ID.

You can log connections in different modes. If you are doing a coordinated
test with a particular connection, you may tell the system to put it in
mode 4 (continuous dump). Or, if you just want to monitor for errors, you
can put it in mode 1 (ring buffer) and dump all the ring buffers associated
with the connection ID when we receive an error signal for that connection
ID. You can set a default mode that will be applied to a particular ratio
of incoming connections. You can also manually set a mode using a socket
option.

This commit includes only basic probes. rrs@ has added quite an abundance
of probes in his TCP development work. He plans to commit those soon.

There are user-space programs which we plan to commit as ports. These read
the data from the log device and output pcapng files, and then let you
analyze the data (and metadata) in the pcapng files.

Reviewed by:	gnn (previous version)
Obtained from:	Netflix, Inc.
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D11085
2018-03-22 09:40:08 +00:00
Conrad Meyer
e9ac27430c Implement getrandom(2) and getentropy(3)
The general idea here is to provide userspace programs with well-defined
sources of entropy, in a fashion that doesn't require opening a new file
descriptor (ulimits) or accessing paths (/dev/urandom may be restricted
by chroot or capsicum).

getrandom(2) is the more general API, and comes from the Linux world.
Since our urandom and random devices are identical, the GRND_RANDOM flag
is ignored.

getentropy(3) is added as a compatibility shim for the OpenBSD API.

truss(1) support is included.

Tests for both system calls are provided.  Coverage is believed to be at
least as comprehensive as LTP getrandom(2) test coverage.  Additionally,
instructions for running the LTP tests directly against FreeBSD are provided
in the "Test Plan" section of the Differential revision linked below.  (They
pass, of course.)

PR:		194204
Reported by:	David CARLIER <david.carlier AT hardenedbsd.org>
Discussed with:	cperciva, delphij, jhb, markj
Relnotes:	maybe
Differential Revision:	https://reviews.freebsd.org/D14500
2018-03-21 01:15:45 +00:00
Mateusz Guzik
c3bf638194 Update my calendar entry to be more specific now that UTF8 turns out to be fine 2018-03-19 00:25:10 +00:00
Devin Teske
5d8a56406b Use full month in dpv(3), figpar(3), and bsdconfig(8) manuals
Reported by:	maxim
2018-03-14 19:09:06 +00:00
Fernando Apesteguía
1827aac8bc Add myself (fernape) to calendar.freebsd
As indicated in Committers guide Chapter 6, point 9
"Optional: Update Ports with Personal Information"

Approved by:	tcberner
Differential Revision:	https://reviews.freebsd.org/D14653
2018-03-11 17:21:48 +00:00
Edward Tomasz Napierala
be3d357e23 Make iscsictl(1) display "Disabled" status for disabled sessions.
MFC after:	2 weeks
2018-03-10 14:33:00 +00:00
Alan Somers
d3953c1f47 tftpd: Flush files as soon as they are fully received
On an RRQ, tftpd doesn't exit as soon as it's finished receiving a file.
Instead, it waits five seconds just in case the client didn't receive the
server's last ACK and decides to resend the final DATA packet.
Unfortunately, this created a 5 second delay from when the client thinks
it's done sending the file, and when the file is available for other
processes.

Fix this bug by closing the file as soon as receipt is finished.

PR:			157700
Reported by:		Barry Mishler <barry_mishler@yahoo.com>
MFC after:		3 weeks
2018-03-09 23:25:18 +00:00
Eitan Adler
bc1407636b calendars: update Judaic calendar to 2018+
This was generated by

∴hebcal --years 10 -r 2018 | awk -F '[/\t]' '{print $3 "/" $1 "/" $2
"*\t" $4}'

MFC After:	1 week
2018-03-08 05:28:43 +00:00
Brooks Davis
75c1df31cf Fix build post r330299 2018-03-02 23:31:55 +00:00
Brooks Davis
6d0fe480a8 Don't declare union semun in userspace unless _WANT_SEMUN is defined.
POSIX explicitly states that the application must declare union semun.
This makes no sense, but it is what it is.  This brings us into line
with Linux, MacOS/Darwin, and NetBSD.

In a ports exp-run a moderate number of ports fail due to a lack of
approprate autotools-like discovery mechanisms or local patches.  A
commit to address them will follow shortly.

PR:		224300, 224443 (exp-run)
Reviewed by:	emaste, jhb, kib
Exp-run by:	antoine
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14492
2018-03-02 22:32:53 +00:00
Simon J. Gerraty
50d2e745fa Update to bmake-201802222
Fixes segfault in Var_Set if val is NULL
Don't treat .info as warning with -W
2018-03-02 01:53:50 +00:00
Conrad Meyer
3049d4ccc0 seq(1): Consistently include 'last' for non-integers
The source of error is a rounded increment being too large and thus the loop
steps slightly past 'last'.  Perform a final comparison using the formatted
string values (truncated precision) to determine if we still need to print
the 'last' value.

PR:		217149
Submitted by:	Fernando Apesteguía <fernando.apesteguia AT gmail.com>,
		Yuri Pankov <yuripv AT icloud.com> (earlier version)
Reported by:	Martijn Dekker <mcdutchie AT hotmail.com>
Sponsored by:	Dell EMC Isilon
2018-02-27 22:01:40 +00:00
Edward Tomasz Napierala
f9f0cd1f00 .Xr rctl(8) and cpuset(1).
PR:		225935
Submitted by:	D. Ebdrup <debdrup at gmail.com> (earlier version)
MFC after:	2 weeks
2018-02-26 18:04:17 +00:00
Ed Maste
a9cf54b0c9 ministat: disallow negative variance / nan Stddev
With all values identical it was possible for Var() to return a negative
value due to limited floating point precision, resulting in "nan"
reported as Stddev.

Variance cannot actually be negative, so just return 0.  We can later
investigate alternate algorithms for calculating variance to reduce the
effect of catastrophic cancellation here.

Reported by:	Arshan Khanifar <arshankhanifar_gmail.com>
Approved by:	phk
Sponsored by:	The FreeBSD Foundation
2018-02-21 15:54:23 +00:00
Alan Somers
d23662ec2e tail: fix "tail -r" for piped input that begins with '\n'
A subtle logic bug, probably introduced in r311895, caused tail to print the
first two lines of piped input in forward order, if the very first character
was a newline.

PR:		222671
Reported by:	Jim Long <freebsd-bugzilla@umpquanet.com>, pprocacci@gmail.com
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
2018-02-19 22:09:49 +00:00
Li-Wen Hsu
ab4a4d40ae Follow r329348 in ipcs for getting rid of the requirement to include SysV IPC
headers with _KERNEL

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D14398
2018-02-16 18:07:04 +00:00
Brooks Davis
27b95863a9 Get rid of the requirement to include SysV IPC headers with _KERNEL
defined in ipcrm by introducing _WANT_SYSVxxx_INTERNALS defines.

Reviewed by:	jhb
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14271
2018-02-16 01:33:01 +00:00
Edward Tomasz Napierala
11db7fa42b Make lock(1) use PAM. This makes the -p option work again. (Well, kind of,
because the whole idea of this utility is rather broken.)

This originally come from NetBSD, and was later reworked a bit.

Reviewed by:	des@ (earlier version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D4981
2018-02-11 13:35:31 +00:00
Justin Hibbits
e4803b1c14 Fix uninitialized warning, and work around a bug in gcc over clobbering
Summary:
r329077 caused gcc to emit uninitialized use warnings.  Attempting to
fix those warnings yielded the following warnings:

usr.bin/tftp/main.c: In function 'main':
usr.bin/tftp/main.c:181: warning: variable 'el' might be clobbered by
'longjmp' or 'vfork'
usr.bin/tftp/main.c:182: warning: variable 'hist' might be clobbered by
'longjmp' or 'vfork'

This is a known bug in gcc, found at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239

Work around that by simply marking hist and el as static.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D14302
2018-02-10 17:17:15 +00:00
Ed Maste
1b49115a40 Promote llvm-cov to a standalone option
Introduce WITH_/WITHOUT_LLVM_COV to match GCC's WITH_/WITHOUT_GCOV.
It is intended to provide a superset of the interface and functionality
of gcov.

It is enabled by default when building Clang, similarly to gcov and GCC.

This change moves one file in libllvm to be compiled unconditionally.
Previously it was included only when WITH_CLANG_EXTRAS was set, but the
complexity of a new special case for (CLANG_EXTRAS | LLVM_COV) is not
worth avoiding a tiny increase in build time.

Reviewed by:	dim, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D142645
2018-02-10 00:22:35 +00:00
Conrad Meyer
51adff9318 tftp(1): Clean up leading and trailing whitespace
Whitespace-only change.

Sponsored by:	Dell EMC Isilon
2018-02-09 20:00:51 +00:00
Conrad Meyer
49fb06154b tftp(1): Fix libedit state corruption involving signals
This bug was first reported 14 years ago.  The problem was understood 8.5
years ago.  A patch that is functionally identical to this one was proposed
almost 8 years ago and languished in the PR system / Bugzilla.

PR:		63197
Submitted by:	lxv AT omut.org, fernando.apesteguia AT gmail.com
Reported by:	freebsd AT nbritton.org
2018-02-09 19:46:51 +00:00
Justin Hibbits
fb3d972447 Temporarily widen count for interrupt rate calculations on 32-bit archs
If the interrupt count is very high (greater than ~42M), notably on one-shot
execution on long running systems, the intermediate multiplication step in the
rate calculation will overflow the width of a 32-bit architecture long (32
bits), causing the rest of the calculation to calculate with a truncated value,
and report very low rates (sometimes 0).

MFC after:	2 weeks
2018-02-08 05:18:30 +00:00
Ed Maste
18f201e79c ld.lld.1: explain long options may use one or two dashes 2018-02-08 00:09:17 +00:00
Ed Maste
c62c1fe23e Update ld.lld.1 based on the version committed upstream 2018-02-07 23:58:00 +00:00
Mark Johnston
7f180c0f80 Fix the WITH_SORT_THREADS build.
PR:		201664
MFC after:	1 week
2018-02-07 20:36:37 +00:00
Alex Richardson
348392153b Fix broken SPDX comment in usr.bin/lex/initparse.c
Approved By:	jhb (mentor)
2018-02-07 17:09:12 +00:00
Alex Richardson
c3a6ea5ba6 Allow compiling usr.bin/find on Linux and Mac
When building FreeBSD the makefiles invoke find with various flags such as
`-s` that aren't supported in the native /usr/bin/find. To fix this I
build the FreeBSD version of find and use that when crossbuilding.

Inserting lots if #ifdefs in the code is rather ugly but I don't see a
better solution.

Reviewed By:	brooks (mentor)
Approved By:	jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D13306
2018-02-06 15:41:26 +00:00
Ed Maste
5725799a3b ld.lld.1: miscellaneous style improvements
Submitted by:	wblock in review D13813
2018-02-02 21:52:00 +00:00
Kyle Evans
839bbb1c21 dtc(1): Revert WARNS change from r328173
WARNS > 3 breaks xtoolchain builds to varying degrees. Revert it.

Reported by:	lwhsu, jhb
MFC after:	3 days
2018-01-31 22:20:33 +00:00
Emmanuel Vadot
2145d321ac nfsstat: Add libxo output
Add libxo output support
Merge exp41_intpr and exp_intpr function. The only difference is to print
NFSV4.1 operations in exp41, add a third arguement to control that.
printtitle was set to 1 and don't have a switch, add a -q options to control it.

Reviewed by:	bapt
Sponsored by:	Gandi.net
Differential Revision:	https://reviews.freebsd.org/D14012
2018-01-30 09:59:52 +00:00
Kyle Evans
2f2d80f730 awk(1): Don't install tests at all
Tests were disconnected so that running `make check` in usr.bin/awk did not
have any effect, but CI runs use installed tests. Fully disconnect tests/
from the build for the time being as a short term solutio

Reported by:	lwhsu
2018-01-29 14:15:44 +00:00
Pedro F. Giffuni
6904ec035e fortune(6): Fix gcc80 -Wbool-operation warnings.
Hinted by:	Dragonfly (git 4d1086765752f0569497d06460d95117c74f33ac)
2018-01-27 17:43:09 +00:00
Alan Somers
cb938d95e2 time(1): use clock_gettime(2) instead of gettimeofday(2)
This is a prerequisite to adding support for the monotonic clock

Reviewed by:	ken, imp
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D14030
2018-01-24 17:12:34 +00:00
Martin Matuska
a2a3407c7e MFV r328323,328324:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #893: delete dead ppmd7 alloc callbacks
  PR #904: Fix archive freeing bug in bsdcat
  PR #961: Fix ZIP format names
  PR #962: Don't modify attributes for existing directories
           when ARCHIVE_EXTRACT_NO_OVERWRITE is set
  PR #964: Fix -Werror=implicit-fallthrough= for GCC 7
  PR #970: zip: Allow backslash as path separator

MFC after:	1 week
2018-01-24 14:24:17 +00:00
Eitan Adler
53362abb8e m4: add annotations to various functions
Explain to the compiler that several functions are either noreturn or
take printf like arguments

Discussed with:	swildner@DragonFlyBSD.org
2018-01-24 07:01:44 +00:00
Brooks Davis
8b75008bea Don't escape '?'s in protocol output.
This isn't required by mandoc and is nonfunctional in groff.

PR:		224632
Reported by:	w.schwarzenfeld@utanet.at
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D13779
2018-01-23 20:07:51 +00:00
Emmanuel Vadot
62de70375f sockstat: add break that was forgot in 328279
Reported by:	garga@
MFC after:	1 week
X-MFC With:	328279
Sponsored by:	Gandi.net
2018-01-23 14:33:19 +00:00
Emmanuel Vadot
ee0afaa9d7 sockstat: Add -q option to suppress the header line
MFC after:	1 week
Sponsored by:	Gandi.net
2018-01-23 13:03:47 +00:00
Eitan Adler
7275057a5e limits(1): fix always true condition
Reviewed by:	imp
MFC After:	1 week
2018-01-21 08:48:26 +00:00
Eitan Adler
5a9fdfb303 limits(1): add missing break
Reported by:	swildner@DragonFlyBSD.org
MFC After:	1 week
2018-01-20 18:27:00 +00:00
Li-Wen Hsu
08c80489cd Silence the gcc warning: 'op' may be used uninitialized in this function
Approved by:	kevans
2018-01-20 15:37:47 +00:00
Kyle Evans
450c7a04f7 od(1): Fix mis-patch from r328188
od_test.sh got duplicated erroneously when it was added in r328188. Dedup.
2018-01-20 03:50:56 +00:00
Kyle Evans
6bb764934c od(1): Fix wrong output for some corner cases in multibyte locales.
Restore the original character to print if we used the look-ahead
buffer, but that didn't help -- we either got an illegal sequence
or still can't complete.

PR:		224552
Submitted by:	Yuri Pankov
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D13963
2018-01-20 02:49:32 +00:00
Kyle Evans
ca84c67cd0 dtc(1): Update to upstream ea3c233
Highlights of this update:
- /__local_fixups__ is now generated to be GPL dtc and libfdt compliant
- Compiling with -@ will now cause dtc to assign phandles to all labelled
  nodes
- /include/ and /incbin/ now handle absolute paths correctly
- The manpage now has information about overlays, including how to apply
  them and how to generate them
- Syntactic sugar for overlays is now supported, allowing an overlay DTS
  like:

=
/dts-v1/;
/plugin/;

&foo {
    foo,status = "okay";
};
=

to generate a fragment targetting <&foo>.
2018-01-19 21:20:24 +00:00
John Baldwin
9a7a98a0dc Update various statements in vmstat(8) to match reality.
- The process stats are actually thread counts rather than process
  counts.
- Simplify various descriptions to remove mention of stats that are
  updated every 5 seconds (all VM related stats are now "instant",
  only the load average is updated every 5 seconds).
- Don't make any mention of special treatment for processes that have
  been active in the last 20 seconds.  We don't track that stat.
- Rework the description of active virtual memory.  Call it mapped
  virtual memory and explicitly point out it is not the same as the
  active page queue (which corresponds to "Active" in top(1)), and
  also hint at the possible bogusness of the value (e.g. if a process
  maps a single page out of a multiple GB file, the entire file's size
  is considered mapped).
- Simplify a few descriptions that implied their output was a value
  per interval.  All of the "rate" values are per-second rates scaled
  across the interval.
- Update a few comments for 'struct vmtotal' along similar lines.

Reported by:	mwlucas (indirectly)
Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D13905
2018-01-18 19:43:02 +00:00
Michael Tuexen
b8ff144e19 Add missing assignment to make sure non-first cmsgs are handled as such. 2018-01-17 10:30:49 +00:00
Alex Richardson
5f40118235 Allow xinstall and makefs to be crossbuilt on Linux and Mac
I need these tools in order to install the crossbuilt FreeBSD and create a
disk image. Linux does not have a st_flags in struct stat so unfortunately
I need a bunch of ugly ifdefs. The resulting binaries allow me to
sucessfully install a MIPS64 world and create a disk-image that boots.

Reviewed By:	brooks, bdrewery, emaste
Approved By:	jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D13307
2018-01-16 21:43:46 +00:00
Michael Tuexen
6accaf4a90 Improve the printing of cmgs when the length is 0. Fix error handling. 2018-01-16 20:02:07 +00:00