Commit Graph

17920 Commits

Author SHA1 Message Date
Antoine Brodin
ccd6ac9f6e Add allow.mlock to jail parameters
It allows locking or unlocking physical pages in memory within a jail

This allows running elasticsearch with "bootstrap.memory_lock" inside a jail

Reviewed by:	jamie@
Differential Revision:	https://reviews.freebsd.org/D16342
2018-07-29 12:41:56 +00:00
Conrad Meyer
522867c218 wpa_supplicant.8: Remove removed option
Our base version of wpa_supplicant does not support the -u option, so remove
it.

PR:		230102
Submitted by:	D Green <dfrg AT xsmail.com>
2018-07-28 23:59:36 +00:00
Brad Davis
4f1521406b Move nscd.conf from etc/ to usr.sbin/nscd/
Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16490
2018-07-28 23:29:36 +00:00
Rick Macklem
076e3c1072 Update nfsd.8 for support of IPv6 addresses for hosts in the "-p" option.
r336795 adds support for handling of IPv6 addresses returned by getaddrinfo(3)
for DS hostnames. This updates the man page for this change.

This is a content change.
2018-07-27 23:38:31 +00:00
Rick Macklem
35f38de3c9 Add support for IPv6 addresses to the pNFS "-p" option.
This patch adds code to handle IPv6 addresses returned by getaddrinfo()
for the host entries in the "-p" command line argument.
If the IPv6 address is a link local address, only use it if it is the
only address for the host. This is done since there is no way to know
if the NFSv4.1 pNFS client is in the same scope zone as the MDS.
inet_ntop() is used for the IPv6 address translation, since the client
will have no use for the scope zone suffix and inet_ntop() does not
put this in the address string.

Discussed with:	bu7cher@yandex.ru
2018-07-27 23:10:28 +00:00
Warner Losh
de26ba4d82 Add -b bootnum to allow creation of a specific boot number (rather
than the auotmatic selection). This is important in some scripting
environments.

Also, remove bogus checks for bootnum != 0. 0 is a valid bootnum.

Sponsored by: Netflix
2018-07-27 18:18:20 +00:00
Ian Lepore
029a2d652e Remove some code that's no longer needed because it's now part of pw_scan(3).
It was also leading to segfaults; pw can be NULL when control reaches these
lines now, because of the way my previous change restructured the loops.

Reported by:	lwhsu@
2018-07-27 15:17:24 +00:00
Ian Lepore
3196b50827 Re-apply r336625 which was reverted with r336638, now that the underlying
pw_scan(3) has been fixed in a way that doesn't perturb other callers of
it or the getpwnam(3) family.

Make pw(8) showuser work the same with or without -R <path> for non-root
users.  Without -R, pw(8) uses getpwnam(3), which will open master.passwd
for the root user or passwd for non-root users.  With -R <path> pw(8) was
always opening <path>/master.passwd, which would fail for a non-root user,
then falsely claim the userid you're trying to show doesn't exist.

Now for a non-root user it opens <path>/passwd, and populates the fields in
the returned struct passwd which aren't present in that file with well-known
canonical values, which duplicates the behavior of getpwnam(3).  The net
effect is that the showuser output is identical whether using -R or not.
2018-07-26 20:03:11 +00:00
Brad Davis
74c3bf4ac0 Move apmd.conf to CONFS in usr.sbin/apmd which simplifies this nicely.
Approved by:	bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D16431
2018-07-26 16:51:23 +00:00
Ed Maste
5b292f9a2d makefs: use FreeBSD brelse function signature
Although the ffs (and later msdosfs) implementation in makefs is
independent of the one in kernel, it makes sense to keep differences to
a minimum in order to ease comparison and porting changes across.

Submitted by:	Siva Mahadevan
Sponsored by:	The FreeBSD Foundation
2018-07-26 13:33:10 +00:00
Navdeep Parhar
ffcf81c99d cxgbetool(8): Require and validate only those inputs that are applicable
to the type of rate limiter being configured.  For example, the class
WRR scheduler doesn't need any kbps limits (it just needs the weights
for each class), the channel scheduler doesn't need anything except the
aggregate kbps to limit the channel to, and so on.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2018-07-25 17:20:54 +00:00
Ed Maste
5add92953e makefs: whitespace cleanup in msdos files
Sponsored by:	The FreeBSD Foundation
2018-07-25 13:27:20 +00:00
Mark Johnston
0e6ebdd88a Build ofwdump on riscv.
Sponsored by:	The FreeBSD Foundation
2018-07-24 20:20:17 +00:00
John Baldwin
6f77212f27 Support compressed crash dumps in crashinfo(8).
Temporarily decompress a copy of a crash dump compressed with either
gzip or zstd and run various tools against the decompressed copy while
generating the crash information.  The uncompressed copy is deleted when
the script exits.

Note that crashinfo is enabled by default, so this will attempt to
decompress the most recent compressed crash dump after a crash that
generates a compressed crash dump.  Users who wish to only do offline
analysis of compressed crash dumps can disable crashinfo in rc.conf.

Tested by:	ler
Reviewed by:	markj
MFC after:	2 weeks
2018-07-23 18:08:56 +00:00
Ian Lepore
d05db9a4ff Revert r336625 until I figure out why it worked with simple testing but
reportedly fails the kyua tests and causes other real-world problems.

Reported by:	cy@ asomers@
2018-07-23 14:58:44 +00:00
Ian Lepore
1a61d99330 Make pw(8) showuser work the same with or without -R <path> for non-root
users.  Without -R, pw(8) uses getpwnam(3), which will open master.passwd
for the root user or passwd for non-root users.  With -R <path> pw(8) was
always opening <path>/master.passwd, which would fail for a non-root user,
then falsely claim the userid you're trying to show doesn't exist.

Now for a non-root user it opens <path>/passwd and zeroes out the 3 fields
that aren't available in the passwd file, which duplicates the behavior of
getpwnam(3).  The net effect is that the showuser output is identical
whether using -R or not.
2018-07-22 23:41:40 +00:00
Alan Somers
d3f229a463 makefs(8): add test case for PR 229929
Fix two failing makefs test cases by adding "-M 1m", which was already used
for every other FFS test case.  Add a new test case for the underlying
issue: with no -M, -m, or -s options, makefs can underestimate image size.

PR:		229929
Reported by:	Jenkins
MFC after:	2 weeks
2018-07-21 17:24:14 +00:00
Mateusz Piotrowski
caba8c7d3f Improve the binmiscctl manual page
- Use "Fl -" instead of "Cm --" for long options.
- Sort options alphabetically.
- Pet "mandoc -Tlint".
- Clean up the description of the "--interpreter" option.
- Clean up the description of the first example in the examples section.
- Use ".Bd -literal -offset indent" for all example code blocks for consistency.
- Use "Nm" instead of "Cm binmiscctl".
- Indent all examples for consistency.

Reviewed by:	allanjude
Approved by:	mat (mentor)
Differential Revision:	https://reviews.freebsd.org/D15589
2018-07-20 22:50:21 +00:00
Alan Somers
5717aa2d2a Allow mounting FUSE filesystems in jails
Reviewed by:	jamie
MFC after:	2 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D16371
2018-07-20 21:35:31 +00:00
Ian Lepore
3496c981ac Make it possible to run ntpd as a non-root user, add ntpd uid and gid.
Code analysis and runtime analysis using truss(8) indicate that the only
privileged operations performed by ntpd are adjusting system time, and
(re-)binding to privileged UDP port 123. These changes add a new mac(4)
policy module, mac_ntpd(4), which grants just those privileges to any
process running with uid 123.

This also adds a new user and group, ntpd:ntpd, (uid:gid 123:123), and makes
them the owner of the /var/db/ntp directory, so that it can be used as a
location where the non-privileged daemon can write files such as the
driftfile, and any optional logfile or stats files.

Because there are so many ways to configure ntpd, the question of how to
configure it to run without root privs can be a bit complex, so that will be
addressed in a separate commit. These changes are just what's required to
grant the limited subset of privs to ntpd, and the small change to ntpd to
prevent it from exiting with an error if running as non-root.

Differential Revision:	https://reviews.freebsd.org/D16281
2018-07-19 23:55:29 +00:00
Conrad Meyer
7bdbd012c6 newsyslog.8: Remove cutesy nonsense
Sponsored by:	Dell EMC Isilon
2018-07-19 16:03:20 +00:00
Kyle Evans
761d344c16 config(8): Invert checks; envmode/hintmode reflect "env provided"1 2018-07-17 15:16:34 +00:00
Kyle Evans
63975809ab Fix GCC 4.2 build after r336415, proper declaration and prototype 2018-07-17 14:34:54 +00:00
Kyle Evans
8e62839eb1 config(8): Add compatibility shims for r335998
Plumb the %VERSREQ from Makefile.<arch> through to the rest of config(8).
We've recorded the config(8) version that we're calling "the end of
envmode and hintmode," and we'll write them out for earlier versions. Later
kernel version bumps will remove envmode/hintmode from the kernel as needed,
which is OK since the current kernel does not use them at all.

These compatibility shims really need to go away when the major version
rolls over...

Discussed with:	imp
2018-07-17 14:14:53 +00:00
Kyle Evans
e47edf50dd Revert r336353 completely based on protest; compatibility shims incoming 2018-07-17 14:11:30 +00:00
Kyle Evans
2df45ae0d0 config(8): Bump major version after r335998
config-generated hints.c/env.c from r335998 and later are incompatible with
earlier kernels due to no longer setting envmode/hintmode. A minor bump for
this is insufficient, as matching major version with a later minor version
is still viewed as backwards-compatible.

This was an MI kernel change, soo all VERSREQ's are bumped.
2018-07-16 19:05:50 +00:00
Devin Teske
e719942791 sysrc(8): Send error message to stderr (not stdout)
PR:		bin/229806
Reported by:	Andreas Sommer <andreas.sommer87@googlemail.com>
MFC after:	3 days
X-MFC-to:	stable/11 stable/10 stable/9
Sponsored by:	Smule, Inc.
2018-07-16 18:53:17 +00:00
Mariusz Zaborski
1afab1fe21 Use capsicum helpers in fstype and ctld.
Reviewed by:	trasz
2018-07-15 17:21:19 +00:00
Warner Losh
ee150a3376 Use EF_SEG_READ_STRING instead of EF_SEG_READ when reading strings.
Normally, we can get away with just reading the 1k buffer for the
string, since the placement of the data is generally no where near the
end of the file. However, it's possible that the string is within the
last 1k of the file, in which case the read will fail, and we'll not
produce the proper records needed for devmatch to work. By reading
using EF_SEG_READ_STRING, we automatically work around these problems
while still retaining safety.

This fix a problem with devmatch where we wouldn't load certain
modules (like ums). This didn't always happen (my tree didn't exhibit
it, while nathan's did because his optimization options were more
agressive).

Reported by: nathanw@
2018-07-15 05:29:39 +00:00
Mark Johnston
a18e40aad4 Use the existing MSR_BIOS_SIGN on AMD.
Reported by:	kib
Sponsored by:	The FreeBSD Foundation
2018-07-13 20:56:20 +00:00
Mark Johnston
a869c2bf22 Use the name added in r336257.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2018-07-13 19:45:12 +00:00
Kyle Evans
44314c3509 kern_environment: Give the static environment a chance to disable MD env
This variable has been given the name "loader_env.disabled" as it's the
primary way most people will have an MD environment. This restores the
previously-default behavior of ignoring the loader(8) environment, which may
be useful for vendor distributions or other scenarios where inheriting the
loader environment may be considered a security issue or potentially
breaking of a more locked-down environment.

As the change to config(5) indicates, disabling the loader environment
should not be a choice made lightly since it may provide ACPI hints and
other useful things that the system can rely on to boot.

An UPDATING entry has been added to mention an upgrade path for those that
may have relied on the previous behavior.

Discussed with:	bde
Relnotes:	yes (maybe)
2018-07-12 02:51:50 +00:00
Cy Schubert
780fb4a2fa MFV r324714:
Update wpa 2.5 --> 2.6.

MFC after:	1 month
2018-07-11 18:53:18 +00:00
Marcelo Araujo
989e062bea Improve bhyve exit(3) error code.
The bhyve(8) exit status indicates how the VM was terminated:

0	rebooted
1	powered off
2	halted
3	triple fault

The problem is when we have wrappers around bhyve that parses the exit
error code and gets an exit(1) for an error but interprets it as "powered off".
So to mitigate this issue and makes it less error prone for third part
applications, I have added a new exit code 4 that is "exited due to an error".

For now the bhyve(8) exit status are:
0	rebooted
1	powered off
2	halted
3	triple fault
4	exited due to an error

Reviewed by:	@jhb
MFC after:	2 weeks.
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D16161
2018-07-11 03:23:09 +00:00
Ben Widawsky
5857fba5fd acpidump(8): Add ACPI LPIT (Low Power Idle Table)
The LPIT is the part of the "standardized" way that one can enumerate
various power state information on Intel platforms.

The documentation for this change can be found here:
http://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf

Reviewed By: jhb
Approved By: jhb
Differential Revision: https://reviews.freebsd.org/D15931
2018-07-11 01:37:01 +00:00
Rick Macklem
eec5cbde71 Update the pnfs(4) man page.
This is a content change.
2018-07-10 22:53:07 +00:00
Rick Macklem
5a039c8373 Document the "-f" option added to pnfsdskill(8) by r336176.
This is a content change.
2018-07-10 18:44:44 +00:00
Rick Macklem
2536ba4306 Add a "-f" option to pnfsdskill(8) to force disabling of a DS.
The pnfsdskill(8) command will normally fail if there is no valid mirror
for the DS to be disabled. However, a system administrator may need to
disable a DS which does not have a valid mirror so that the nfsd threads
can be terminated. This patch adds a "-f" option to pnfsdskill(8) that
uses the kernel changes made by r336141 to implement this "forced" case
of disabling a DS.
This patch only affects the pNFS server.
2018-07-10 18:41:16 +00:00
Brooks Davis
3a20f06a1c Use uintptr_t alone when assigning to kvaddr_t variables.
Suggested by:	jhb
2018-07-10 13:03:06 +00:00
Marcelo Araujo
9add8139b7 Fix style(9) space and tab. 2018-07-10 05:36:32 +00:00
Ed Schouten
30dd2da2a3 Use the FQDN in the newsyslog log message when RFC 5424 is enabled.
The RFC 5424 spec mentions that logging FQDNs over short hostnames is
preferred. Alter this code, so that the hostname doesn't get truncated
on startup. Keep track of the length of the short hostname, so that
fprintf() can do the truncation where necessary.

MFC after:	1 month
2018-07-08 10:08:24 +00:00
Ed Schouten
066a4ba169 Allow the use of slashes in process names of RFC 3164 formatted messages.
Tools such as Postfix use slashes in process names for hierarchy
(postfix/qmgr). By allowing these slashes, syslogd is able to extract
the process name and process ID nicely, so that they can be stored in
RFC 5424 message fields.

MFC after:	1 week
2018-07-07 11:53:39 +00:00
Kyle Evans
3cafc9a654 config(8): Fix broken ABI
r336019 introduced ${SRCTOP}/sys to the include paths in order to pull in a
new sys/{c,}nv.h. This is wrong, because the build tree's ABI isn't
guaranteed to match what's running on the host system.

Fix instead by removing -I${SRCTOP}/sys and installing the libnv headers
with `make -C lib/libnv includes`... this may or may not get re-worked in
the future so that a userland lib isn't installing includes from sys/.

Reported by:	bdrewery
2018-07-06 11:23:14 +00:00
Kyle Evans
88171893e2 config(8): De-dupe hint/env vars within a single file
r335653 flipped the order in which hints/env files are concatenated to match
the order in which vars are processed by the kernel. This is the other
hammer to drop.

Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the
latest value specified for a key. This leaves some duplicates if a variable
is specified in multiple hint/env files or via `envvar` in a kernel config,
but the reversed order of concatenation (from r335653) makes this a
non-issue as the latest-specified version will be seen first.

This change also silently rewrote hint bits to use the same sanitization
process that ian@ wrote for r335642. To the kernel, hints and env vars are
basically the same thing through early boot, then get merged into the
dynamic environment once kmem becomes available and the dynamic environment
is created. They should be subjected to the same restrictions.

libnv has been added to -legacy for the time being to support the build of
config(8) with the new cnvlist API.

Tested with:	universe (11 host & 12 host)
MFC after:	1 month
2018-07-06 01:11:06 +00:00
Kyle Evans
417d105fae Revert r336011,r336012 until I can competently test 2018-07-05 18:55:42 +00:00
Kyle Evans
f1e0a986a8 Fix build after r336011
Add libnv to bootstrap-tools, use ${SRCTOP}/sys headers.
2018-07-05 18:39:02 +00:00
Kyle Evans
51c854f028 config(8): De-dupe hint/env vars within a single file
r335653 flipped the order in which hints/env files are concatenated to match
the order in which vars are processed by the kernel. This is the other
hammer to drop.

Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the
latest value specified for a key. This leaves some duplicates if a variable
is specified in multiple hint/env files or via `envvar` in a kernel config,
but the reversed order of concatenation (from r335653) makes this a
non-issue as the latest-specified version will be seen first.

This change also silently rewrote hint bits to use the same sanitization
process that ian@ wrote for r335642. To the kernel, hints and env vars are
basically the same thing through early boot, then get merged into the
dynamic environment once kmem becomes available and the dynamic environment
is created. They should be subjected to the same restrictions.

MFC after:	1 month
2018-07-05 17:53:51 +00:00
Brooks Davis
f6293d7296 Work around lame warnings in ancient gcc on 32-bit platforms.
Fixes r335979.
2018-07-05 17:02:10 +00:00
Kyle Evans
39d44f7f15 kern_environment: use any provided environments, evict hintmode/envmode
At the moment, hintmode and envmode are used to indicate whether static
hints or static env have been provided in the kernel config(5) and the
static versions are mutually exclusive with loader(8)-provided environment.
hintmode *can* be reconfigured later to pull from the dynamic environment,
thus taking advantage of the loader(8) or post-kmem environment setting.

This changeset fixes both problems at once to move us from a semi-confusing
state to a consistent state: if an environment file, hints file, or
loader(8) environment are provided, we use them in a well-known order of
precedence:

- loader(8) environment
- static environment
- static hints file

Once the dynamic environment is setup this becomes a moot point. The
loader(8) and static environments are merged (respecting the above order of
precedence), and the static hints are merged in on an as-needed basis after
the dynamic environment has been setup.

Hints lookup are changed to respect all of the above. Before the dynamic
environment is setup, lookups use the above-mentioned order and fallback to
the next environment if a matching hint is not found. Once the dynamic
environment is setup, that is used on its own since it captures all of the
above information plus any dynamic kenv settings that came up later in boot.

The following tangentially related changes were made to res_find:

- A hintp cookie is now passed in so that related searches continue using
  the chain of environments (or dynamic environment) without relying on
  global state
- All three environments will be searched if they actually have valid hints
  to use, rather than just choosing the first environment that actually had
  a hint and rolling with that only

The hintmode sysctl has been ripped out. static_{env,hints}.disabled are
still honored and will disable their respective environments from being used
for hint lookups and from being merged into the dynamic environment, as
expected.

MFC after:	1 month (maybe)
Differential Revision:	https://reviews.freebsd.org/D15953
2018-07-05 16:30:32 +00:00
Kyle Evans
e28687347f Revert r335995 due to accidental changes snuck in 2018-07-05 16:28:43 +00:00
Kyle Evans
8ef5886303 kern_environment: use any provided environments, evict hintmode/envmode
At the moment, hintmode and envmode are used to indicate whether static
hints or static env have been provided in the kernel config(5) and the
static versions are mutually exclusive with loader(8)-provided environment.
hintmode *can* be reconfigured later to pull from the dynamic environment,
thus taking advantage of the loader(8) or post-kmem environment setting.

This changeset fixes both problems at once to move us from a semi-confusing
state to a consistent state: if an environment file, hints file, or
loader(8) environment are provided, we use them in a well-known order of
precedence:

- loader(8) environment
- static environment
- static hints file

Once the dynamic environment is setup this becomes a moot point. The
loader(8) and static environments are merged (respecting the above order of
precedence), and the static hints are merged in on an as-needed basis after
the dynamic environment has been setup.

Hints lookup are changed to respect all of the above. Before the dynamic
environment is setup, lookups use the above-mentioned order and fallback to
the next environment if a matching hint is not found. Once the dynamic
environment is setup, that is used on its own since it captures all of the
above information plus any dynamic kenv settings that came up later in boot.

The following tangentially related changes were made to res_find:

- A hintp cookie is now passed in so that related searches continue using
  the chain of environments (or dynamic environment) without relying on
  global state
- All three environments will be searched if they actually have valid hints
  to use, rather than just choosing the first environment that actually had
  a hint and rolling with that only

The hintmode sysctl has been ripped out. static_{env,hints}.disabled are
still honored and will disable their respective environments from being used
for hint lookups and from being merged into the dynamic environment, as
expected.

MFC after:	1 month (maybe)
Differential Revision:	https://reviews.freebsd.org/D15953
2018-07-05 16:25:48 +00:00
Marcelo Araujo
c066c68c57 - Add bhyve NVMe device emulation.
The initial work on bhyve NVMe device emulation was done by the GSoC student
Shunsuke Mie and was heavily modified in performan, functionality and
guest support by Leon Dang.

bhyve:
	-s <n>,nvme,devpath,maxq=#,qsz=#,ioslots=#,sectsz=#,ser=A-Z

	accepted devpath:
		/dev/blockdev
		/path/to/image
		ram=size_in_MiB

Tested with guest OS: FreeBSD Head, Linux Fedora fc27, Ubuntu 18.04,
                      OpenSuse 15.0, Windows Server 2016 Datacenter.
Tested with all accepted device paths: Real nvme, zdev and also with ram.
Tested on: AMD Ryzen Threadripper 1950X 16-Core Processor and
           Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz.

Tests at: https://people.freebsd.org/~araujo/bhyve_nvme/nvme.txt

Submitted by:	Shunsuke Mie <sux2mfgj_gmail.com>,
		Leon Dang <leon_digitalmsx.com>
Reviewed by:	chuck (early version), grehan
Relnotes:	Yes
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D14022
2018-07-05 03:33:58 +00:00
Hartmut Brandt
8e9b3e7071 Update bsnmp to version 1.13. This does not bring user-visible changes.
For developers gensnmptree can now generate functions for enums to convert
between enums and strings and to check the validity of a value.
The sources in FreeBSD are now in sync with the upstream which allows to
bring in IPv6 modifications.
2018-07-03 08:44:40 +00:00
Rick Macklem
0479387e0a Document the "#mds_path" suffix for the "-p" command line option.
r335871 added support for an optional suffix of "#mds_path" that can be
applied to each entry in the "-p" option argument. This specifies that
the DS should be used to store files for the file system on the MDS
at "mds_path".
This patch documents this optional suffix.

This is a content change.
2018-07-02 19:33:26 +00:00
Rick Macklem
ed46427268 Add an optional feature to the pNFS server.
Without this patch, the pNFS server distributes the data storage files across
all of the specified DSs.
A tester noted that it would be nice if a system administrator could control
which DSs are used to store the file data for a given exported MDS file system.
This patch adds an optional suffix for each entry in the "-p" option argument
that specifies "store file data for this MDS file system" in this DS.
The patch should only affect sites using the pNFS server (specified via the
"-p" command line option for nfsd.
The interface between the nfsd and the kernel has changed with this patch,
so anyone using the "-p" option needs to rebuild their nfsd from sources
with this patch applied to them.

Discussed with:	james.rose@framestore.com
2018-07-02 19:26:31 +00:00
Ed Schouten
8ab684e234 Document that syslogd -v has no effect when RFC 5424 mode is enabled.
The variable it sets, LogFacPri, is only used in the RFC 3164 formatting
codepath.

PR:		229457
Reported by:	Andre Albsmeier
MFC after:	1 week
2018-07-02 11:02:27 +00:00
Ed Schouten
8a66bdb414 Restore the order in which RFC 3164 messages with fac/pri are formatted.
The refactoring of the syslogd code to format messages using iovecs
slightly altered the output of syslogd by placing the facility/priority
after the hostname, as opposed to printing it right before. This change
reverts the behaviour to be consistent with how it was before.

PR:		229457
Reported by:	Andre Albsmeier
MFC after:	1 week
2018-07-02 10:57:22 +00:00
Rick Macklem
b3ccfa8a60 Document the new "-m" command line option for pnfsdsfile(8).
This is a content change.
2018-07-01 17:51:52 +00:00
Rick Macklem
7c126cfa95 Add a new "-m" option to pnfsdsfile(8) to prepare a file for mirroring.
When pnfsdscopymr(8) is used to create a mirror of a file on a mirrored
pNFS service, it expects to find an entry in the extended attribute for
IP address 0.0.0.0.
This patch adds a "-m" option which can be used to create these entrie(s).
It also tightens up the checks for use of incompatible command line options.
2018-07-01 17:49:02 +00:00
Edward Tomasz Napierala
775c9076c7 Add basic examples to portsnap(8).
MFC after:	2 weeks
2018-07-01 16:18:38 +00:00
Rick Macklem
2f800e5593 Add a safety belt assignment to the nfsd for when "-p" isn't specified.
The kernel code assumes that nfsdargs.addr == NULL and nfsdargs.addrlen == 0
when there is no "-p" argument used for starting the nfsd.
This small patch ensures this is the case. In practice, I believe this always
happened, since "nfsdargs" was the last element on the stack for "main()",
but this little patch ensures it will be the case.
Spotted by inspection while adding a new optional field for "-p".
2018-06-30 12:14:20 +00:00
Alex Richardson
53ed3b32ae Fix missing files in METALOG with -DNO_ROOT
By using INSTALL_LINK instead of calling ln during install the files
end up in the METALOG file as well if we use -DNO_ROOT and will be
included in a disk image when using makefs with METALOG as the input.
The other file that was not included in METALOG was /var/db/services.db
which is now also included for -DNO_ROOT.

Approved By:	brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D15665
2018-06-29 21:15:17 +00:00
Eitan Adler
48c7315619 powerd: correct ifdef check for ppc
Reviewed by:	jhibbits
2018-06-27 01:28:09 +00:00
Navdeep Parhar
2293e22112 cxgbetool(8): Reject invalid VLAN values.
Submitted by:	Krishnamraju Eraparaju @ Chelsio
MFC after:	1 week
Sponsored by:	Chelsio Communications
2018-06-26 21:56:06 +00:00
Kyle Evans
67fc3f5608 config(8): part of patch disappeared, don't close ifp at the end 2018-06-26 04:06:49 +00:00
Kyle Evans
6ffdd5ef2f config(8): Flip the order of concatenation for hints and env
As previously noted, kernel's processing of these means that the first
appearance of a hint/variable wins. Flipping the order of concatenation
means that later variables override earlier variables, as expected when one
does:

hints x
hints y

Where perhaps x is:

hint.aw_sid.0.disable=1

and y is:

hint.aw_sid.0.disable=0

The expectation would be that a later appearing variable would override an
earlier appearing variable, such as with `device`/`nodevice`, device.hints,
and other similarly structured data files.
2018-06-26 04:02:25 +00:00
Kyle Evans
4edfa9085a config(8): Make 'env' files consistent with other file-accepting options
Previously, only one 'env' file could be specified. Later 'env' directives
would overwrite earlier 'env' directives. This is inconsistent with every
other file-accepting directives which process files in order, including
hints.

A caveat applies to both hints and env that isn't mentioned: they're
concatenated in the order of appearance, so they're not actually applied in
the way one might think by supplying:

hints x
hints y

Hints in x will take precedence over same-name hints in y due to how
the kernel processes them, stopping at the first line that matches the hint
we're searching for. Future work will flip the order of concatenation so
that later files may still properly override earlier files.

In practice, this likely doesn't matter at all due to the nature of the
beast.
2018-06-26 03:56:10 +00:00
Kyle Evans
1aae236569 config(8): Set envmode if we accept an envvar
X-MFC-With:	r335642
2018-06-26 02:05:45 +00:00
Kyle Evans
3b31596dc8 config(8): Add envvar support
envvar allows adding individual environment variables to the kernel's static
environment without the overhead of pulling in a full file. envvar in a
config looks like:

envvar some_var=5

All envvar-provided variables will be added after the env file is processed,
so envvar keys that exist in the previous env will be overwritten by
whatever value is set here in the kernel configuration directly.

As an aside, envvar lines are intentionally tokenized differently from
basically every other line. We used a named state when ENVVAR is encountered
to gobble up the rest of the line, which will later be cleaned and validated
in post-processing by sanitize_envline. This turns out to be the simplest
and cleanest way to allow the flexibility that kenv does while not
compromising on silly hacks.

Reviewed by:	ian (also contributor of sanitize_envline rewrite)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D15962
2018-06-25 17:17:47 +00:00
Ian Lepore
110d4e2df3 Add an example for displaying the manufacturer and size info from a
standard spiflash chip.
2018-06-23 23:08:25 +00:00
Ed Schouten
531b456983 Still parse messages that don't contain an RFC 3164 timestamp.
The changes made in r326573 required that messages always start with an
RFC 3164 timestamp. It looks like certain devices, but also certain
logging libraries (Python 3's "logging" package) simply don't generate
RFC 3164 formatted messages containing a timestamp.

Make timestamps optional again. When the timestamp is missing, also
assume that the message contains no hostname. The first word of the
message likely already belongs to the message payload.

PR:		229236
Reported by:	Michael Grimm & Marek Zarychta
Reviewed by:	glebius (cursory)
MFC after:	1 week
2018-06-22 20:53:39 +00:00
Ian Lepore
917d184626 Eliminate gcc "shadowed declaration" warnings by using idx rather than
index as a variable name.

Reported by:	manu@
2018-06-22 03:40:03 +00:00
Ian Lepore
6666009530 Add spi(8), a utility for communicating with a device on a SPI bus from
userland, conceptually similar to what i2c(8) provides for i2c devices.

Submitted by:	Bob Frazier
Differential Revision:	https://reviews.freebsd.org/D15029
2018-06-22 01:59:19 +00:00
Bryan Drewery
b7a8f5e16f Let -s actually work.
MFC after:	2 weeks
Sponsored by:	Dell EMC
2018-06-22 01:10:05 +00:00
Ed Maste
75e6ea22c5 acpidump.8: include NFIT in the man page list of tables
Was missed in r321298.

Reported by:	Ben Widawsky (in review D15931)
MFC after:	1 week
2018-06-20 19:40:54 +00:00
Mariusz Zaborski
7672a0148f Convert cap_enter() < 0 && errno != ENOSYS to caph_enter() < 0.
No functional change intended.
2018-06-19 23:43:14 +00:00
Sean Bruno
01cebb69be MK_EFI - Add uefisign and friends to this knob and ensure that we don't
try to build them if MK_OPENSSL is unset.

Reviewed by:	emaste imp kevans
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D15211
2018-06-19 21:07:25 +00:00
Ed Schouten
8803b8597a Fix bad logic in iovlist_truncate().
To conform to RFC 5426, this function is intended to truncate messages
if they exceed the message size limits. Unfortunately, the amount of
space was computed the wrong way around, causing messages to be
truncated entirely.

Reported by:	Michael Grimm on stable@
MFC after:	3 days
2018-06-18 06:01:28 +00:00
Devin Teske
389e494006 bsdconfig: Fix a bug when editing users
The usermgmt API was stomping on a global ($user_gid to be specific)
so things would appear to work fine until you tried to make a second
pass into the API with the now-tainted variable contents.

Fixed by localizing menu-specific contents as to not leak outside API.

PR:		bin/208774
Reported by:	Martin Waschbuesch <martin@waschbuesch.de>
MFC after:	1 week
X-MFC-to:	stable/11, stable/10
Sponsored by:	Smule, Inc.
2018-06-17 22:09:43 +00:00
Devin Teske
da89782f7d bsdconfig: Make examples optional
PR:		bin/228485
Submitted by:	Dmitry Wagin <dmitry.wagin@ya.ru>
Reported by:	Dmitry Wagin <dmitry.wagin@ya.ru>
MFC after:	1 week
Sponsored by:	Smule, Inc.
2018-06-17 21:09:21 +00:00
Devin Teske
eca1e88c0b sysrc.subr: Fix a comment for accuracy
PR:		bin/203435
Reported by:	Andreas Sommer <andreas.sommer87@googlemail.com>
MFC after:	6 days
X-MFC-to:	stable/11
X-MFC-with:	r335280
Sponsored by:	Smule, Inc.
2018-06-17 20:32:43 +00:00
Alan Somers
f1ed5c000c praudit(1): add tests
Submitted by:	aniketp
MFC after:	2 weeks
X-MFC-With:	335287
Sponsored by:	Google, Inc. (GSoC 2018)
Differential Revision:	https://reviews.freebsd.org/D15751
2018-06-17 17:31:16 +00:00
Devin Teske
5164504a9e sysrc.subr: Fix display when value is "-n"
PR:		bin/226406
Reported by:	Marius Halden <marius.halden@modirum.com>
MFC after:	1 week
X-MFC-to:	stable/11
Sponsored by:	Smule, Inc.
2018-06-17 06:25:32 +00:00
Devin Teske
181560bbbf sysrc.subr: Fix handling of files with missing newline at EOF
PR:		bin/203435
Reported by:	Andreas Sommer <andreas.sommer87@googlemail.com>
MFC after:	1 week
X-MFC-to:	stable/11
Sponsored by:	Smule, Inc.
2018-06-17 06:03:48 +00:00
Devin Teske
5c165dcf50 sysrc(8): Exit with failure on API error
Fix exit status when f_sysrc_set() fails. Errors in the underlying API
provided by bsdconfig(8) -- /usr/share/bsdconfig/sysrc.subr -- were not
being communicated back to the command-line. This was affecting ansible
modules using sysrc as they were not able to accurately test for error.

PR:		bin/211448
Reported by:	Christian Schwarz <me@cschwarz.com>
MFC after:	3 days
X-MFC-to:	stable/11
Sponsored by:	Smule, Inc.
2018-06-17 03:33:29 +00:00
Rick Macklem
a463bac8dd Use the .Fx macro in the man page.
Reported by:	bjk
2018-06-15 21:07:14 +00:00
Rick Macklem
509a73235b Use the .Fx macro in the man page.
Reported by:	bjk
2018-06-15 21:04:28 +00:00
Rick Macklem
4eda4b667a Use the .Fx macro in the man page.
Reported by:	bjk
2018-06-15 21:02:33 +00:00
Rick Macklem
a520a7cf2f Add a command that copies or migrates a data file from one DS to another.
This command can be used by a sysadmin to either copy or migrate a data
file on one DS to another DS.
Its main use is to recover data files onto a mirrored DS after the DS has
been repaired and brought back online.
2018-06-15 19:45:15 +00:00
Rick Macklem
6cb9ec3cc4 Add a command the displays and modifies the pNFS server's extended attribute.
This command allows a sysadmin to display or modify the pnfsd.dsfile extended
attribute used by the pNFS MDS server in various ways.
Its main use is to set a DS's IP address to 0.0.0.0 when that DS has failed,
so that it will not be used for the file when brought back online after
being repaired.
2018-06-15 19:35:08 +00:00
Ed Maste
f756301851 Remove obsolete asf(8)
kgdb now handles kernel module state internally, so the asf tool serves
no purpose.

PR:		229046
Reviewed by:	brooks
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15827
2018-06-15 17:44:21 +00:00
Ed Maste
d1ded78d8e Add deprecation notice in asf.8
PR:		229046
Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2018-06-15 17:38:07 +00:00
Rick Macklem
725f388bdc Add an entry into the Makefile for pnfsdskill.
pnfsdskill was added by r335192. This commit adds an entry for it to the
Makefile.
2018-06-15 11:54:55 +00:00
Rick Macklem
b3cd498b58 Add a command that disables a pNFS server mirrored DS.
This command can be used by a sysadmin to disable a malfunctioning pNFS server
mirrored DS. It is safe to use when a mirrored DS has already been disabled
via an I/O or network partitioning error.
2018-06-15 11:52:34 +00:00
Rick Macklem
203c00b359 Add a new man page that briefly describes the pNFS variant of the NFSv4.1
protocol.

This is a content change.
2018-06-14 21:12:08 +00:00
Rick Macklem
4c176e18d3 Document the "-p" and "-m" options added to nfsd.c by r335172.
This is a content change.
2018-06-14 20:55:33 +00:00
Rick Macklem
61a835e403 Add the "-p" and "-m" options to nfsd.c for the pNFS service.
The "-p" option specifies that the nfsd should run a pNFS service instead
of a regular NFS service. The "-m" option is only meaningful when used with
"-p" to specify that mirroring on the DSs should be done and on how many of
them.
This change requires the kernel changes committed as r334930.
The man page update will be committed as a separate commit soon.
2018-06-14 20:36:55 +00:00
Marcelo Araujo
f7224b709f Fix style(9) space vs tab.
Reviewed by:	jhb
MFC after:	3 weeks.
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D15768
2018-06-14 01:34:53 +00:00
Marcelo Araujo
f2b5dc3aec While I was investigating CID 1194192 related with a resource leak on mrp memory
allocation, I could identify that actually we use this pointer on pci_emul.c as
well as on vga.c source file.

I have reworked the logic here to make it more readable and also add a warn to
explicit show the function where the memory allocation error could happen,
also sort headers.

Also CID 1194192 was marked as "Intentional".

Obtained from:	TrueOS
MFC after:	4 weeks.
Sponsored by:	iXsystems Inc.
2018-06-13 11:49:34 +00:00
Eitan Adler
38033d4c5c pmc: remove trailing whitespace
Reported by:	swills
2018-06-13 09:17:04 +00:00
Warner Losh
371ba7ec71 Use "$@" instead of $* to cope with parameters that have spaces in
them. "$@" preserves the args with spaces properly.

Differential Revision: https://reviews.freebsd.org/D15784
2018-06-13 06:11:04 +00:00
Marcelo Araujo
35f7c93cc8 When this code was introduced at r300829 the author forgot to add
the BSD license header that is the same as in its C header file.

MFC after:	4 weeks.
Sponsored by:	iXsystems Inc.
2018-06-13 04:00:21 +00:00
Marcelo Araujo
55afc65efa style(9) remove unnecessary blank tabs.
Obtained from:	TrueOS
MFC after:	4 weeks.
Sponsored by:	iXsystems Inc.
2018-06-13 03:35:24 +00:00
Marcelo Araujo
ce80faa498 Add SPDX tags to bhyve(8).
Discussed with:	rgrimes, pfg and mav.
Obtained from:	TrueOS
MFC after:	4 weeks.
Sponsored by:	iXsystems Inc.
2018-06-13 03:22:08 +00:00
Sean Bruno
6e9d170d8a cpucontrol:
- fix debugging for family on AMD cpus and add useful debugging for
  which file is being selected for update.

Reviewed by:	cem
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D15574
2018-06-12 18:58:56 +00:00
Ryan Libby
2ef5e36473 pmc gcc fixups
Fix the build of lib/libpmc and usr.sbin/pmc for gcc on amd64.

Reviewed by:    mmacy
Sponsored by:   Dell EMC Isilon
Differential Revision:  https://reviews.freebsd.org/D15723
2018-06-11 16:09:54 +00:00
Marcelo Araujo
c205be608c More style(9) fixes, space vs tab. 2018-06-11 15:18:31 +00:00
Pedro F. Giffuni
afd66b9d51 style(9): Fix tabs after #define.
No functional change intended.
2018-06-11 14:45:34 +00:00
Marcelo Araujo
f9c005a17f - Add bhyve virtio-scsi storage backend support.
Example of configuration:
ctl.conf:
portal-group pg0 {
        discovery-auth-group no-authentication
        listen 0.0.0.0
        listen [::]
}

target iqn.2012-06.com.example:target0 {
        auth-group no-authentication
        portal-group pg0
        port ioctl/5/3

        lun 0 {
                path /z/test.img
                size 8G
        }
        lun 1 {
                path /z/test1.img
                size 8G
        }
}

bhyve <...> -s 4,virtio-scsi,/dev/cam/ctl5.3,iid=3 <VM_NAME>

From inside guest:
root@:~ # zpool status test
  pool: test
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        test        ONLINE       0     0     0
          da0       ONLINE       0     0     0
          da1       ONLINE       0     0     0

dmesg:
da0 at vtscsi0 bus 0 scbus0 target 0 lun 0
da0: <FREEBSD CTLDISK 0001> Fixed Direct Access SPC-5 SCSI device
da0: Serial Number MYSERIAL0000
da0: 300.000MB/s transfers
da0: Command Queueing enabled
da0: 8192MB (16777216 512 byte sectors)
da1 at vtscsi0 bus 0 scbus0 target 0 lun 1
da1: <FREEBSD CTLDISK 0001> Fixed Direct Access SPC-5 SCSI device
da1: Serial Number MYSERIAL0001
da1: 300.000MB/s transfers
da1: Command Queueing enabled
da1: 8192MB (16777216 512 byte sectors)

Discussed with:		grehan
Reviewed by:		mav
Obtained from:		TrueOS
Relnotes:		Yes
Sponsored by:		iXsystems Inc.
Tested with:		FreeBSD HEAD, Fedora 28 (Workstation) and
			Ubuntu 18.04.
Differential Revision:  https://reviews.freebsd.org/D15276
2018-06-11 02:09:20 +00:00
Warner Losh
a96081bb87 Remove old, dead compat code.
We no longer need to od these things conditionally, and the fallbacks
are to 4.2BSD era defaults, which nobody uses anymore. Vixie cron has
diverged from upstream anyway in our tree, and it's not clear there's
actually a viable upstream anymore. Plus, we don't follow the
vendor-supplied code pattern here.

I'm doing this to reduce false positives from grep.
2018-06-10 02:30:09 +00:00
Eitan Adler
32b68c46fa pmc: mark some dead functions as such
Also change a single instance of the comma operator to a semi-colon.

Reviewed by:	mmacy
2018-06-09 04:54:36 +00:00
Matt Macy
456eeabebc pmc: fix logic in skipping riscv 2018-06-09 02:25:18 +00:00
Matt Macy
6159b91c1f pmc: don't build on riscv where there's no kmod support 2018-06-09 02:15:45 +00:00
Gleb Smirnoff
a08d12d3f2 Add new functionality and syntax to cron(1) to allow to run jobs at a
given interval, which is counted in seconds since exit of the previous
invocation of the job. Example user crontab entry:

@25	sleep 10

The example will launch 'sleep 10' every 35 seconds. This is a rather
useless example above, but clearly explains the functionality.

The practical goal here is to avoid overlap of previous job invocation
to a new one, or to avoid too short interval(s) for jobs that last long
and doesn't have any point of immediate launch soon after previous run.

Another useful effect of interval jobs can be noticed when a cluster of
machines periodically communicates with a single node. Running the task
time based creates too much load on the node. Running interval based
spreads invocations across machines in cluster. Note that -j/-J won't
help in this case.

Sponsored by:	Netflix
2018-06-07 22:38:40 +00:00
Matt Macy
f992dd4b5c pmc: convert native to jsonl and track TSC value of samples
- add '-j' options to filter to enable converting native pmc
  log format to json lines format to enable the use of scripts
  and external tooling

% pmc filter -j pmc.log pmc.jsonl

- Record the tsc value in sampling interrupts as opposed to
  recording nanotime when the sample is copied to a global log
  in hardclock - potentially many milliseconds later.

- At initialize record the tsc_freq and the time of day to give
  us an offset for translating the tsc values in callchain records
2018-06-07 02:03:22 +00:00
Justin Hibbits
60f18ad0b4 Add partition scheme for mpc85xx devices
Some mpc85xx devices with u-boot need MBR partitioning with a FAT boot
partition.  Since the infrastructure is already in place to have a dedicated
boot partition, this adds the necessary bits to use that infrastructure with
mpc85xx boards.

Reviewed By: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D15664
2018-06-07 00:24:10 +00:00
Romain Tartière
69b96cd300 gpioctl.8: Fix man page section
Reviewed by:	manu
Approved by:	manu
2018-06-06 18:52:33 +00:00
Matt Macy
b2ca2e50b9 hwpmc: add summary command and further metadata extensions
metadata changes:
- log pmc sample rate with pmcallocate
- log proc flags with thread / process logging
  to identify user vs kernel threads

fixes:
- use log cpuid to translate event id to event name

Implement rudimentary summary command to track sample
counts by thread and process name within a pmc log.

% make -j4 buildkernel >& /dev/null &
% sudo pmcstat -S unhalted_core_cycles -S llc-misses -O foo sleep 15
% pmc summary foo
cpu_clk_unhalted.thread_p_any:
        idle: 138108207162
        clang-6.0: 105336158004
        sh: 72340108510
        make: 8642012963
        kernel: 7754011631
longest_lat_cache.miss:
        clang-6.0: 87502625
        sh: 40901227
        make: 5500165
        kernel: 3300099
        awk: 2000060

%  pmc summary -f ~/foo
idx: 278 name: cpu_clk_unhalted.thread_p_any rate: 2000003
idle: 69054
clang-6.0: 52668
sh: 36170
make: 4321
kernel: 3877
hwpmc: proc(7445): 3319
awk: 1289
xargs: 357
rand_harvestq: 181
mtree: 102
intr: 53
zfskern: 31
usb: 7
pagedaemon: 4
ntpd: 3
syslogd: 1
acpi_thermal: 1
logger: 1
syncer: 1
snmptrapd: 1
sleep: 1
idx: 17 name: longest_lat_cache.miss rate: 100003
clang-6.0: 875
sh: 409
make: 55
kernel: 33
awk: 20
hwpmc: proc(7445): 14
xargs: 9
idle: 8
intr: 3
zfskern: 2
2018-06-06 02:48:09 +00:00
Matt Macy
ebfaf69cc0 hwpmc: log name->pid, name->tid mappings
By logging all threads and processes 'pmc filter'
can now filter on process or thread name, relieving
the user of the burden of determining which tid or
pid was which when the sample was taken.

% pmc filter -T if_io_tqg -P nginx pmc.log pmc-iflib.log

% pmc filter -x -T idle pmc.log pmc-noidle.log
2018-06-05 04:26:40 +00:00
Navdeep Parhar
a12a06fae2 cxgbetool: Disallow negative values for numeric parameters.
Sponsored by:	Chelsio Communications
2018-06-04 23:17:18 +00:00
Matt Macy
fae7158959 pmc stat: add debug option for intermediate state 2018-06-04 22:39:22 +00:00
Matt Macy
6e69774ad4 pmc stat: fix offset of specified counter 2018-06-04 21:42:21 +00:00
Justin Hibbits
fdb600af60 Set kernelname in bootconfig to the kernel file
Summary:
The kernel reads 'kernelname' to set the kern.bootfile sysctl.  By setting this,
'make installkernel' will backup the running kernel as appropriate.

Reviewed by:	nwhitehorn
Differential Revision: https://reviews.freebsd.org/D15660
2018-06-04 14:42:13 +00:00
Matt Macy
b79ce32e4e pmc filter: avoid spurious gcc uninitialized warning 2018-06-04 06:30:35 +00:00
Matt Macy
bfb46e2ba8 pmc: add filter command
pmc filter allows the user to select event types, threads, and processes from
a sample.

% pmcstat -S unhalted_core_cycles -S llc-misses -S -S  resource_stalls.any -O pmc.log
% pmc filter -e llc-misses pmc.log pmc-llc-misses.log
% pmc filter -e unhalted_core_cycles -t 100339  pmc.log pmc-core-cycles.log
etc...
% pmcstat -R pmc-core-cycles.log -G pmc-core-cycles.stacks
2018-06-04 04:59:48 +00:00
Matt Macy
5de96e33d6 hwpmc: support sampling both kernel and user stacks when interrupted in kernel
This adds the -U options to pmcstat which will attribute in-kernel samples
back to the user stack that invoked the system call. It is not the default,
because when looking at kernel profiles it is generally more desirable to
merge all instances of a given system call together.

Although heavily revised, this change is directly derived from D7350 by
Jonathan T. Looney.

Obtained from: jtl
Sponsored by: Juniper Networks, Limelight Networks
2018-06-04 01:10:23 +00:00
Eitan Adler
91339aaf7b service(1): Improve manual page
* Sort options..
* Fix some typos.
* Use one Bd macro for code blocks instead of a bunch of Dl macros.
* Improve formatting.
* Clarify 'jail' argument

PR:		228552
Submitted by:	0mp
MFC After:	3 weeks
2018-06-01 04:14:16 +00:00
Matt Macy
c8d23c138f pmc: add list-events command 2018-06-01 00:45:59 +00:00
Matt Macy
fbf962e6bb libpmc: allow substring for list and add function for printing event details 2018-06-01 00:45:53 +00:00
Hans Petter Selasky
5fd1ea0810 Re-apply r190640.
- Restore local change to include <net/bpf.h> inside pcap.h.
This fixes ports build problems.
- Update local copy of dlt.h with new DLT types.
- Revert no longer needed <net/bpf.h> includes which were added
as part of r334277.

Suggested by:	antoine@, delphij@, np@
MFC after:	3 weeks
Sponsored by:	Mellanox Technologies
2018-05-31 09:11:21 +00:00
Matt Macy
2708737d38 pmc stat: fix format strings for 32-bit 2018-05-30 22:03:02 +00:00
Warner Losh
b98d2b35df devinfo_init() returns an errno, but doesn't set errno, so the error
message when it fails reflects some random thing rather than what it
returned. Set errno to the return value.
2018-05-30 15:08:59 +00:00
Matt Macy
82c78f803d pmc: don't break build with format issues 2018-05-30 00:06:17 +00:00
Matt Macy
5244f3c6ae pmc: silence scan-build warnings 2018-05-29 21:02:08 +00:00
Matt Macy
3554f22e67 pmc: Add new sub-command structured "pmc" utility
This will manage pmc functionality with a more
manageable structure of subcommands rather than the
gradually accreted spaghetti logic of overlapping flags
that exists in pmcstat.

This is intended to ultimately have all the same functionality
as pmcannotate+pmccontrol+pmcstat. Currently it just has
"stat" and "system-stat" - counters for the process itself and counters
for the system as a whole respectively (i.e. system-stat includes kernel
threads). Note that the rusage results (page faults/context switches/
user/sys) for stat-system will not account for the system as a whole -
only for the child process specified on the command line.

Implementing stat was suggested by mjg@ and the output is based on that
from Linux's "perf stat".

% pmc stat -- make -j32 buildkernel -DNO_MODULES  -ss > /dev/null
         9598393  page faults           #       0.674 M/sec
          387085  voluntary csw         #       0.027 M/sec
          106989  involuntary csw       #       0.008 M/sec
   2763965982317  cycles
   2542953049760  instructions          #       0.920 inst/cycle
    511562750157  branches
     12917006881  branch-misses         #       2.525%
     17944429878  cache-references      #       0.007 refs/inst
      2205119560  cache-misses          #       12.289%
           43.74  real                  #       2019.72% cpu
          795.09  user                  #       1817.72% cpu
           88.35  sys                   #       202.00% cpu

% make -j32 buildkernel -DNO_MODULES  -ss > /dev/null &
% sudo pmc stat-system cat
^C             103  page faults         #       0.811 M/sec
               4  voluntary csw         #       0.031 M/sec
               0  involuntary csw       #       0.000 M/sec
   2843639070514  cycles
   2606171217438  instructions          #       0.916 inst/cycle
    522450422783  branches
     13092862839  branch-misses         #       2.506%
     18592101113  cache-references      #       0.007 refs/inst
      2562878667  cache-misses          #       13.785%
           44.85  real                  #       0.00% cpu
            0.00  user                  #       0.00% cpu
            0.00  sys                   #       0.00% cpu
2018-05-29 20:28:34 +00:00
Marcelo Araujo
6dd8233d5d Simplify macros EFPRINTF and EFFLUSH. [0]
Also stdarg(3) says that each invocation of va_start() must be paired
with a corresponding invocation of va_end() in the same function. [1]

Reported by:	Coverity
CID:		1194318[0] and 1194332[1]
Discussed with:	jhb
MFC after:	4 weeks.
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D15548
2018-05-29 01:46:00 +00:00
Devin Teske
a03d5f8b02 sysrc(8): Test variable names for invalid characters
PR:		bin/187461
Reported by:	ebay@looksharp.net
MFC after:	4 weeks
X-MFC-to:	stable/11 (after 11.2-R)
Sponsored by:	Smule, Inc.
2018-05-28 23:34:23 +00:00
Hans Petter Selasky
609169becc Buildfix for GCC after r334277.
MFC after:	1 month
Sponsored by:	Mellanox Technologies
2018-05-28 09:41:44 +00:00
Hans Petter Selasky
b00ab7548b MFV r333789: libpcap 1.9.0 (pre-release)
MFC after:	1 month
Sponsored by:	Mellanox Technologies
2018-05-28 08:12:18 +00:00
Eric van Gyzen
8a114a66b5 bhyve: guarantee NUL termination
Use strlcpy to guarantee NUL termination of the path to a
virtio console socket.

Reported by:	Coverity
CID:		1362874
Sponsored by:	Dell EMC
2018-05-28 03:09:09 +00:00
Eric van Gyzen
054e6e1335 bhyve: fix small memory leak in virtio console
Reported by:	Coverity
CID:		1363284
Sponsored by:	Dell EMC
2018-05-28 03:05:01 +00:00
Eric van Gyzen
1de11cd4e1 tcpdrop: ensure NUL termination of a string
strncpy did not guarantee NUL termination of the "stack" string.
Use strlcpy instead.  While I'm here, avoid unnecessary memset
and strnlen calls.

Reported by:	Coverity
CID:		1381035
Sponsored by:	Dell EMC
2018-05-28 01:58:49 +00:00
Matt Macy
ae266f9f94 pmcstat: suppress uninitialized warning of event 2018-05-27 17:49:27 +00:00
Matt Macy
959826ca1b pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the
vendor provided pmu-events tables and sundry cleanups.

The vendor pmu-events tables provide counter descriptions, default
sample rates, event, umask, and flag values for all the counter
configuration permutations. Using this gives us:

- much simpler kernel code for the MD component
- helpful long and short event descriptions
- simpler user code
- sample rates that won't overload the system

Update man page with newer sample types and remove unused sample type.
2018-05-26 19:29:19 +00:00
Matt Macy
5506ceb87f Revert r334242 "pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the"
because of squash commit messages
2018-05-26 19:26:19 +00:00
Matt Macy
4928135658 pmc(3)/hwpmc(4): update supported Intel processors to rely fully on the
vendor provided pmu-events tables and sundry cleanups.

The vendor pmu-events tables provide counter descriptions, default
sample rates, event, umask, and flag values for all the counter
configuration permutations. Using this gives us:

- much simpler kernel code for the MD component
- helpful long and short event descriptions
- simpler user code
- sample rates that won't overload the system

Update man page with newer sample types and remove unused sample type.

Squashed commit of the following:

commit 4459d43eff815bec08ccc5533dbe5de846f03128
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Sat May 26 00:06:31 2018 -0700

    libpmc: fix pmu function signatures for non amd64

commit a2cb8bbc586c65d41f9b291430a2261ec67b59fe
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 22:38:11 2018 -0700

    pmcstat: fix indentation of usage

commit f686954b15ff56a833ac80404898977cb80a265b
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 22:19:49 2018 -0700

    pmclog(3): add callchain and pmcallocatedyn, remove pcsample

commit 73e13a0d2e9498c81c150d14d022050cee7511bb
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 22:19:00 2018 -0700

    pmclog.h: GC pcsample field

commit 3e93ffd65da641fa657539dad3c48e281f8b5798
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 22:05:57 2018 -0700

    hwpmc: make Intel core CPUs use external event tables

commit 634f5fae1e1644ac324003136c66cd9c619d1c93
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 22:00:06 2018 -0700

    pmclog: update log record types, bump PMC_MAJOR
    - explicitly make log record types a multiple of 8 bytes
    - hook in pmu event types for pmc_allocate records
    - remove references to no longer PCSAMPLE record

commit 83d84fcd2d65bdf6ddcb2e155a22f0cfa2a9c225
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 21:52:10 2018 -0700

    libpmc: add support for having vendor table driven pmc_allocate

commit 9e6ad63c40c2fce8404847ace5078ca6cb33a736
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 19:11:33 2018 -0700

    hwpmc_core: add accessors for EVSEL & UMASK, make IAP_UMASK useful to user

commit 859dceb93daa6419a48c794db99b6758e5b041c9
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 19:09:45 2018 -0700

    pmcstat: update usage and man page as well as make -L consistent with pmccontrol

commit 79c7d8597e28c2eb13f5f9113e65ec2792ca57b1
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 18:07:03 2018 -0700

    pmu_util: add support for all current intel event keywords

commit d8089c7f6a6c8527f38324252b1ffb47004694c6
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 17:45:00 2018 -0700

    add description for new arguments

commit 058336740bab53c62ec88a3a026ea848cf3878c6
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 17:38:15 2018 -0700

    libpmc: move pmu_events table and pmu_utils out of libpmcstat so that they can be used by pmc_allocate

commit 049b66b382e2f833c3f47bc8df9e750cb265709f
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 16:12:41 2018 -0700

    pmcstat: hook pmu_events counter description utility routines in

commit f5e01e7b37a691dc045e1aa16b3ebdd162515de8
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 16:11:59 2018 -0700

    pmu_events: add utility routines for listing counters and their descriptions

commit cba4d4f8907f772279f86f18f915e0d74d33ac56
Author: Matt Macy <mmacy@mattmacy.io>
Date:   Fri May 25 16:09:50 2018 -0700

    pmu-events: expand out skylake regex to simplify string matches
2018-05-26 18:12:50 +00:00
Marcelo Araujo
13ee81bed5 We don't need check if str is NULL as free(3) will handle NULL
argument.

Reported by:	kib@
2018-05-25 19:12:30 +00:00
Marcelo Araujo
635a2c892c After a long discussion about assert(3), we gonna use a HardenedBSD
approach to chek strdup(3) memory allocation.

Submitted by:	Shaw Webb <shawn.webb@hardenedbsd.org>
Reported by:	brooks
Obtained from:	HardenedBSD
2018-05-25 18:54:40 +00:00
Sean Bruno
e22ee9b247 pmcstat(8)
- Document per thread filtering.

Submitted by:	kbowling
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D15549
2018-05-25 18:11:13 +00:00
Marcelo Araujo
ea089f8c71 Fix a memory leak on topology_parse().
strdup(3) allocates memory for a copy of the string, does the copy and
returns a pointer to it. If there is no sufficient memory NULL is returned
and the global errno is set to ENOMEM.
We do a sanity check to see if it was possible to allocate enough memory.

Also as we allocate memory, we need to free this memory used. Or it will
going out of scope leaks the storage it points to.

Reviewed by:	rgrimes
MFC after:	3 weeks.
X-MFC:		r332298
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D15550
2018-05-25 02:07:05 +00:00
Matt Macy
0a87e3ff64 pmcstat: add usage strings for -L and -I 2018-05-24 07:18:49 +00:00
Matt Macy
4bd2a4b58e pmcstat top mode + -I - use fully qualified address 2018-05-24 06:47:04 +00:00
Matt Macy
357405d985 pmcstat: don't compare signed and unsigned 2018-05-24 04:43:40 +00:00
Matt Macy
e98bbcf9ca libpmcstat: compile in events based on json description 2018-05-24 04:30:06 +00:00
Matt Macy
95104040a3 pmc: bump PMC major version to reflect ABI breakage and make warning not require verbose 2018-05-23 19:55:47 +00:00
Matt Macy
0b5dc7f64f hwpmc: add thread id field to callchain and context switch records to allow filtering
on thread in post-processing.

To generate stacks for just ${THREADID}:

pmcstat -R ${PREFIX}.pmcstat -L ${THREADID} -z100 -G ${PREFIX}.stacks

Sponsored by:	Limelight Networks
2018-05-23 17:25:00 +00:00
Eitan Adler
c739854c38 mpsutil: correct style
Reported by:	bapt
2018-05-23 09:46:21 +00:00
Marcelo Araujo
5f4c83abf5 pthread_rwlock_unlock(3) returns 0 if successful, otherwise an error number
will be returned to indicate the error, so I'm applying an assert(3) to do
a sanity check of the return value.

Reported by:	Coverity CID: 1391235, 1193654 and 1193651
Reviewed by:	grehan
MFC after:	4 weeks.
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D15533
2018-05-23 09:34:51 +00:00
Eitan Adler
9059c77ef2 mpsutil: add missing braces
Obtained from:	DragonFly (c5d53f11a9510c5c79e196857a1200925fffacc8)
2018-05-23 07:38:58 +00:00
Marcelo Araujo
92046bf113 Revert: r334016
Revert for now this change, it in somehow breaks init_pci.
2018-05-22 06:02:11 +00:00
Marcelo Araujo
2d03aa5999 Include atkbdc header where there are declared the prototype functions
atkbdc_event and atkbdc_init.

MFC after:	4 weeks.
Sponsored by:	iXsystems Inc.
2018-05-22 05:21:53 +00:00
Matt Macy
821a352a77 pmcstat: add option to not decode the leaf function in top mode
-I will allow the user to see the hot instruction in question
as opposed getting the name of the function
2018-05-22 04:45:46 +00:00
Marcelo Araujo
b5e3928d6d We must free the variable str.
Spotted by:	clang's static analyzer
Submitted by:	Tom Rix <trix_juniper.net>
Reviewed by:	grehan
MFC after:	4 weeks
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D10009
2018-05-22 04:08:08 +00:00
Eitan Adler
d67c790d71 mtest: build with WARNS=3 2018-05-19 20:57:22 +00:00
Nathan Whitehorn
fb4f0dcae9 Use sysrc(8) in the documentation rather than echoing things to rc.conf
in order to encourage good habits.

PR:		228325
Submitted by:	Mateusz Piotrowski
MFC after:	2 weeks
2018-05-18 17:46:40 +00:00
Nathan Whitehorn
8c7de243f4 Fix math error in the computation of the free space after the last partition
on a disk. This resulted in one sector always remaining free at the end.

PR:		bin/228322
Submitted by:	Rikiya Yonemoto
MFC after:	2 weeks
2018-05-18 17:43:15 +00:00
Andrew Gallatin
b4cc08389a Teach pmcannotate about $TMPDIR and _PATH_TMP
Convert pmcannotate to using $TMPDIR and _PATH_TMP rather than hard
coding /tmp for temporary files.  Pmcannotate sometimes needs quite a
lot of space to store the output from objdump, and will fail in odd
ways if that output is truncated due to lack of space in /tmp.

Reviewed by:	jtl
Sponsored by:	Netflix
2018-05-18 14:14:04 +00:00
Rodney W. Grimes
d96ee3e017 Add missing newline to end of -c usage string .
Pointy hat:	me
Submitted by:	novel
Approved by:	bde(mentor), grehan (maintainer)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D15421
2018-05-17 12:18:41 +00:00
Ed Maste
ab6f27aac1 makefs: ANSIfy 2018-05-16 02:58:05 +00:00
Ed Maste
4fa9985611 Sort mlx5tool correctly in usr.sbin/Makefile 2018-05-16 02:51:30 +00:00
Marcelo Araujo
bc1019a238 vq_getchain() can return -1 if some descriptor(s) are invalid and prints
a diagnostic message. So we do a sanity checking on the return value
of vq_getchain().

Spotted by:	gcc49
Reviewed by:	avg
MFC after:	4 weeks
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D15388
2018-05-15 05:55:29 +00:00
Navdeep Parhar
36ea2fe3bf cxgbetool(8): Provide user interface for hashfilters, hardware NAT, and
other filtering related features that were recently added to the driver.

Sponsored by:	Chelsio Communications
2018-05-15 04:31:11 +00:00
Dag-Erling Smørgrav
202ec22078 If the sole non-option command line argument is "none", remove any
pre-existing forwarder configuration and set Unbound up to recurse.

PR:		222902
MFC after:	1 week
2018-05-12 18:07:53 +00:00
Dag-Erling Smørgrav
b70d78d6e8 Rename all Unbound binaries and man pages from unbound* to local-unbound*.
PR:		222902
2018-05-12 17:10:36 +00:00
Ed Maste
09e24fbe18 cpucontrol: improve Intel microcode revision check
According to the Intel SDM (Volme 3, 9.11.7) the BIOS signature MSR
should be zeroed before executing cpuid (although in practice it does
not seem to matter).

PR:		192487
Submitted by:	Dan Lukes
Reported by:	Henrique de Moraes Holschuh
MFC after:	3 days
2018-05-12 15:34:35 +00:00
Dag-Erling Smørgrav
65b390aa03 Upgrade Unbound to 1.6.2. More to follow. 2018-05-12 14:15:39 +00:00
Dag-Erling Smørgrav
d7d1dffb61 Upgrade Unbound to 1.6.1. More to follow. 2018-05-12 14:04:30 +00:00
Stephen Hurd
71cf0564f8 Fix mld6query(8) and add a new -g option
The mld6query command relies on KAME behaviour which allows the
ipv6mr_multiaddr member of the request object in a IPV6_JOIN_GROUP
setsockopt() call to be INADDR6_ANY. The FreeBSD stack doesn't allow
this, so mld6query has been non-functional.

Also, add a -g option which sends a General Query (query INADDR6_ANY)

Reviewed by:	sbruno, mmacy
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D15384
2018-05-11 19:37:18 +00:00
Dag-Erling Smørgrav
6bff85ff9a Reduce <sys/queue.h> pollution.
While <sys/sysctl.h> includes <sys/queue.h> unconditionally, it is only
actually used in code which is conditional on _KERNEL.  Make the #include
itself conditional as well, and fix userland code that uses <sys/queue.h>
for other purposes but relied on <sys/sysctl.h> to bring it in.

MFC after:	1 week
2018-05-11 00:01:43 +00:00
Xin LI
b6f7731dba Remove "All rights reserved" from my files.
See r333391 for the rationale.

MFC after:	1 week
2018-05-10 06:41:08 +00:00
Marcelo Araujo
8951f05525 Rework CTL frontend & backend options to use nv(3), allow creating multiple
ioctl frontend ports.

This revision introduces two changes to CTL:
- Changes the way options are passed to CTL_LUN_REQ and CTL_PORT_REQ ioctls.
  Removes ctl_be_arg structure and associated logic and replaces it with
  nv(3)-based logic for passing in and out arguments.
- Allows creating multiple ioctl frontend ports using either ctladm(8) or
  ctld(8).
  New frontend ports are represented by /dev/cam/ctl<pp>.<vp> nodes, eg /dev/cam/ctl5.3.
  Those device nodes respond only to CTL_IO ioctl.

New command-line options for ctladm:
# creates new ioctl frontend port with using free pp and vp=0
ctladm port -c
# creates new ioctl frontend port with pp=10 and vp=0
ctladm port -c -O pp=10
# creates new ioctl frontend port with pp=11 and vp=12
ctladm port -c -O pp=11 -O vp=12
# removes port with number 4 (it's a "targ_port" number, not pp number)
ctladm port -r -p 4

New syntax for ctl.conf:
target ... {
    port ioctl/<pp>
    ...
}

target ... {
    port ioctl/<pp>/<vp>
    ...

Note: Most of this work was made by jceel@, thank you.

Submitted by:	jceel
Reworked by:	myself
Reviewed by:	mav (earlier versions and recently during the rework)
Obtained from:  FreeNAS and TrueOS
Relnotes:	Yes
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D9299
2018-05-10 03:50:20 +00:00
Niclas Zeising
480e017cc8 Remove "all rights reserved" on files where I have copyright.
According to r333391 it is not needed any more.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D15370
2018-05-09 17:06:52 +00:00
Sean Bruno
57b4936514 nxge(4):
Remove nxge(4) and associated man page and tools in FreeBSD 12.0.

Submitted by:	kbowling
Reviewed by:	brooks
Relnotes:	yes
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D1529
2018-05-08 21:14:29 +00:00
Warner Losh
83caf7e590 Remove ignored command line options
The --device and --part command line options were planned for Linux
compatibility mode. However, that mode will never happen, so remove
them as last vestiges of a false start.

Submitted by: Vlad Movchan
2018-05-08 20:02:44 +00:00
Warner Losh
39c0a13bc7 efibootmgr.8: fix example
The example given was for the old, and now deleted, Linux
compatibility mode. Update the example for the current code.

Submitted by: Vlad Movchan
2018-05-08 20:02:39 +00:00
Warner Losh
51922c697b Improve printing the boot variables.
Print the boot variables in the order in the BootOrder variable, if it
exists, and then in verbose mode print any unreferneced BootXXXX
variables. If BootOrder isn't set, fall back to printing all the
variables.

Sponsored by: Netflix
2018-05-08 19:43:57 +00:00
Warner Losh
12f409ff75 Inline print_order(). It's used one palce. 2018-05-08 18:25:37 +00:00
Jamie Gritton
0e5c6bd436 Make it easier for filesystems to count themselves as jail-enabled,
by doing most of the work in a new function prison_add_vfs in kern_jail.c
Now a jail-enabled filesystem need only mark itself with VFCF_JAIL, and
the rest is taken care of.  This includes adding a jail parameter like
allow.mount.foofs, and a sysctl like security.jail.mount_foofs_allowed.
Both of these used to be a static list of known filesystems, with
predefined permission bits.

Reviewed by:	kib
Differential Revision:	D14681
2018-05-04 20:54:27 +00:00
Peter Grehan
51688c129f Allow arbitrary numbers of columns for VNC server screen resolution.
The prior code only allowed multiples of 32 for the
numbers of columns. Remove this restriction to allow
a forthcoming UEFI firmware update to allow arbitrary
x,y resolutions.

(the code for handling rows already supported non mult-32 values)

Reviewed by:	Leon Dang (original author)
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D15274
2018-05-04 01:36:49 +00:00
Michael Tuexen
44aaf08ba7 Fix in the documentation that the default hop limit is not 30, but
the value of the sysctl variable net.inet6.ip6.hlim.
This is true since
https://svnweb.freebsd.org/base?view=revision&revision=122574
The default of 30 (which was correct up to r122574) was incorrectly
documented in
https://svnweb.freebsd.org/base?view=revision&revision=130268

Thanks to Timo Voelker for makeing me aware of the inconsistency
between to code and the documentation.

MFC after:	3 days
2018-05-02 19:36:46 +00:00
Sean Bruno
2695c9c109 Retire ixgb(4)
This driver was for an early and uncommon legacy PCI 10GbE for a single
ASIC, Intel 82597EX. Intel quickly shifted to the long lived ixgbe family.

Submitted by:	kbowling
Reviewed by:	brooks imp jeffrey.e.pieper@intel.com
Relnotes:	yes
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D15234
2018-05-02 15:59:15 +00:00
Ed Maste
e6a376d196 Retire lmc(4)
This driver supports legacy, 32-bit PCI devices, and had an ambiguous
license.  Supported devices were already reported to be rare in 2003
(when an earlier version of the driver was removed in r123201).

Reviewed by:	rgrimes
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15245
2018-05-01 16:30:48 +00:00
John Baldwin
cd377eb369 Initial debug server for bhyve.
This commit adds a new debug server to bhyve.  Unlike the existing -g
option which provides an efficient connection to a debug server
running in the guest OS, this debug server permits inspection and
control of the guest from within the hypervisor itself without
requiring any cooperation from the guest.  It is similar to the debug
server provided by qemu.

To avoid conflicting with the existing -g option, a new -G option has
been added that accepts a TCP port.  An IPv4 socket is bound to this
port and listens for connections from debuggers.  In addition, if the
port begins with the character 'w', the hypervisor will pause the
guest at the first instruction until a debugger attaches and
explicitly continues the guest.  Note that only a single debugger can
attach to a guest at a time.

Virtual CPUs are exposed to the remote debugger as threads.  General
purpose register values can be read for each virtual CPU.  Other
registers cannot currently be read, and no register values can be
changed by the debugger.

The remote debugger can read guest memory but not write to guest
memory.  To facilitate source-level debugging of the guest, memory
addresses from the debugger are treated as virtual addresses (rather
than physical addresses) and are resolved to a physical address using
the active virtual address translation of the current virtual CPU.
Memory reads should honor memory mapped I/O regions, though the debug
server does not attempt to honor any alignment or size constraints
when accessing MMIO.

The debug server provides limited support for controlling the guest.
The guest is suspended when a debugger is attached and resumes when a
debugger detaches.  A debugger can suspend a guest by sending a Ctrl-C
request (e.g. via Ctrl-C in GDB).  A debugger can also continue a
suspended guest while remaining attached.  Breakpoints are not yet
supported.  Single stepping is supported on Intel CPUs that support
MTRAP VM exits, but is not available on other systems.

While the current debug server has limited functionality, it should
at least be usable for basic debugging now.  It is also a useful
checkpoint to serve as a base for adding additional features.

Reviewed by:	grehan
Differential Revision:	https://reviews.freebsd.org/D15022
2018-05-01 15:17:46 +00:00
Ed Maste
c20dbeb676 pwd_mkdb: retire legacy v3 db support (-l option)
pwd_mkdb has emitted v4 password database records since 2003 (r113596)
in addition to v3, and as of r283981 by default it emitted only v4.
As described in r283981, retire the -l legacy option.

The -B and -L options were originally added to set the endianness of v3
records emitted by pwd_mkdb, but they also set the db hash endiannes and
so have been retained temporarily.

Announced on the FreeBSD-Current and FreeBSD-Stable lists.  In stable/11
the man page contains a deprecation notice, and pwd_mkdb will emit a
deprecation notice if the -l option is specified.

Reviewed by:	delphij, lidl, rgrimes
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15144
2018-05-01 00:53:46 +00:00
Vladimir Kondratyev
44af5666d9 bthidd(8): Add evdev protocol support for bluetooth keyboards and mouses
User-visible changes:

"-u" is added to to list of command line options supported by bthidd.
Use it to enable evdev support. uinput and evdev modules should be
kld-loaded or compiled into the kernel in that case.

bthidd_evdev_support rc.conf variable is added to control enabling of
evdev support in bthidd startup script. Possible values are: "YES", "NO",
"AUTO"(default). Setting bthidd_evdev_support to "AUTO" inserts "-u" option
if kernel is compiled with EVDEV_SUPPORT option enabled.

Support for consumer HID usage page keyboard events is implemented. Most of
them are available only through evdev protocol.

kern.evdev.rcpt_mask sysctl is checked, so "sysctl kern.evdev.rcpt_mask=12"
should be executed if EVDEV_SUPPORT is compiled into kernel.

It is recommended to regenerate bthidd.conf entries with bthidcontrol(8)
"Query" command to set user-friendly names of bluetooth devices.

Reviewed by:	emax, gonzo, wblock (docs), bcr (docs, early version)
Differential Revision:	https://reviews.freebsd.org/D13456
2018-04-30 12:16:54 +00:00
Vladimir Kondratyev
e650806966 bthidd(8): Add internal support for user-friendly name of remote devices.
Extend bthidd.conf format to store name of remote Bluetooth HID devices and
implement querying of this information with bthidcontrol(8) "Query" command.

Reviewed by:		emax
Differential Revision:	https://reviews.freebsd.org/D13456
2018-04-30 10:49:29 +00:00
Edward Tomasz Napierala
41adbaa596 Clean up the EXAMPLES section of usbconfig(8). This removes parts that
become redundant after documenting all the subcommands, and switches
to the new syntax, without the '-d'.

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-04-29 10:45:09 +00:00
Pedro F. Giffuni
e2ec2f75f2 makefs: Use ENODATA instead of ENOMSG as a translation for missing ENOATTR.
This is consistent with what some linux filesystems do and has been
adopted in our linuxulator.

MFC after:	3 days
2018-04-25 02:43:53 +00:00
Xin LI
703a6a3b14 Use calloc() instead of malloc+bzero.
Reviewed by:	ken, emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D15166
2018-04-24 04:07:51 +00:00
Ed Maste
e936bb9f69 pwd_mkdb: default to network (big) endian hash order
For cross-architecture reproducibility.  The db(3) functions work with
hashes of either endianness, and the current (v4) version password db
entries already store integers in network order.  Do so with the hash as
well so that identical password databases can be created on big- and
little-endian hosts.

The -B and -L flags exist to set the endianness for legacy (v3) entries
when the -l flag is used, and they will still control hash endianness
(at least until the backwards compatibility infrastructure is removed).

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2018-04-24 01:22:57 +00:00
Xin LI
5992da2c7b Correct size for allocation and bzero of fdsr.
MFC after:	2 weeks
2018-04-23 07:15:49 +00:00
Ed Maste
60dd682329 pwd_mkdb: add deprecation notice in manpage too
Followon to r332789; as reported on the -current and -stable lists and
in review D15144 the -l option will be removed before FreeBSD 12.0.
2018-04-22 23:10:37 +00:00
Ed Maste
daddfa7cc7 makefs: tidy up reach-over source
- cd9660 relies on an #include "iso.h" but does not build any .c files
  out of source, so remove reach-over .PATH
- ffs does not rely on any sys/ headers, so remove -I from CFLAGS.
- ffs_tables from sys/ is used by ffs; move the SRCS entry from the top-
  level Makefile to ffs' Makefile.inc.

Sponsored by:	The FreeBSD Foundation
2018-04-20 22:23:38 +00:00
Ed Maste
97303f37f8 pwd_mkdb: warn that legacy support is deprecated (if specified)
r283981 switched pwd_mkdb to emit only v4 database entries by default,
and introduced a -l (legacy) option emit v3 entries in addition.  The
commit message claims that legacy support will be removed in 12.0, so
emit a warning now if it is used.
2018-04-19 20:25:19 +00:00
Allan Jude
0484aa6d85 Make iostat -xC print CPU information on its own line
Requested by:	mahrens
Reviewed by:	kenm (maintainer), mahrens
MFC after:	1 week
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D15076
2018-04-18 02:25:03 +00:00
Edward Tomasz Napierala
912280b4b4 Make it possible to pass the ugenX.Y to usbconfig(8) without using "-d",
eg "usbconfig ugen1.2 dump_all_desc".

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-04-17 19:39:47 +00:00
Andriy Gapon
020d6f96e3 mountd: fix a crash when getgrouplist reports too many groups
Previously the code only warned about the condition and then happily
proceeded to use the too large value resulting in the array
out-of-bounds access.

Obtained from:	Panzura (Chuanbo Zheng)
MFC after:	10 days
Sponsored by:	Panzura
2018-04-16 09:17:36 +00:00
Ian Lepore
c1ee3587a1 Fix cut-and-pasted line to have the right option letter.
Reported by:	0mp@
Pointy hat:	ian@
2018-04-16 03:35:43 +00:00
Ian Lepore
37820b8746 Add an option to daemon(8) to specify a delay between restarts of a
supervised program.  The existing -r option has a hard-coded delay of one
second.  This change adds a -R option which takes a delay in seconds.  This
can be used to prevent log spam and rapid restarts, similar to init(8)'s
behavior of adding a delay between rapid restarts when it's supervising a
program.
2018-04-15 21:46:08 +00:00
Navdeep Parhar
0d7404ba76 Fix typo in cxgbetool.8. 2018-04-15 19:23:37 +00:00
Ed Schouten
5caf54c7a4 Use proper alphabetic sorting of options. 2018-04-15 08:44:26 +00:00
Ed Schouten
1a874a126a Add RFC 5424 syslog message output to syslogd.
- Move all of the code responsible for transmitting log messages into a
  separate function, fprintlog_write().
- Instead of manually modifying a list of iovecs, add a structure
  iovlist with some helper functions.
- Alter the F_FORW (UDP message forwarding) case to also use iovecs like
  the other cases. Use sendmsg() instead of sendto().
- In the case of F_FORW, truncate the message to a size dependent on the
  address family (AF_INET, AF_INET6), as proposed by RFC 5426.
- Move all traditional message formatting into fprintlog_bsd(). Get rid
  of some of the string copying and snprintf()'ing. Simply emit more
  iovecs to get the job done.
- Increase ttymsg()'s limit of 7 iovecs to 32. Add a definition for this
  limit, so it can be reused by iovlist.
- Add fprintlog_rfc5424() to emit RFC 5424 formatted log entries.
- Add a "-O" command line option to enable RFC 5424 formatting. It would
  have been nicer if we supported "-o rfc5424", just like on NetBSD.
  Unfortunately, the "-o" flag is already used for a different purpose
  on FreeBSD.
- Don't truncate hostnames in the RFC 5424 case, as suggested by that
  specific RFC.

For people interested in using this, this feature can be enabled by
adding the following line to /etc/rc.conf:

  syslogd_flags="-s -O rfc5424"

Differential Revision:	https://reviews.freebsd.org/D15011
2018-04-15 08:34:16 +00:00
Navdeep Parhar
1131c927c4 cxgbe(4): Add support for Connection Offload Policy (aka COP).
COP allows fine-grained control on whether to offload a TCP connection
using t4_tom, and what settings to apply to a connection selected for
offload.  t4_tom must still be loaded and IFCAP_TOE must still be
enabled for full TCP offload to take place on an interface.  The
difference is that IFCAP_TOE used to be the only knob and would enable
TOE for all new connections on the inteface, but now the driver will
also consult the COP, if any, before offloading to the hardware TOE.

A policy is a plain text file with any number of rules, one per line.
Each rule has a "match" part consisting of a socket-type (L = listen,
A = active open, P = passive open, D = don't care) and a pcap-filter(7)
expression, and a "settings" part that specifies whether to offload the
connection or not and the parameters to use if so.  The general format
of a rule is: [socket-type] expr => settings

Example.  See cxgbetool(8) for more information.
[L] ip && port http => offload
[L] port 443 => !offload
[L] port ssh => offload
[P] src net 192.168/16 && dst port ssh => offload !nagle !timestamp cong newreno
[P] dst port ssh => offload !nagle ecn cong tahoe
[P] dst port http => offload
[A] dst port 443 => offload tls
[A] dst net 192.168/16 => offload !timestamp cong highspeed

The driver processes the rules for each new listen, active open, or
passive open and stops at the first match.  There is an implicit rule at
the end of every policy that prohibits offload when no rule in the
policy matches:
[D] all => !offload

This is a reworked and expanded version of a patch submitted by
Krishnamraju Eraparaju @ Chelsio.

Sponsored by:	Chelsio Communications
2018-04-14 19:07:56 +00:00
Baptiste Daroussin
8e877d85dc pkg: accept -y and --yes from arguments
By popular demand, pkg now walks thought the arguments passed and
if it finds -y or --yes it does accept those as equivalent of
ASSUME_ALWAYS_YES env var.

Requested by:	many
MFC after:	1 week
2018-04-13 18:25:00 +00:00
Kyle Evans
a97c64453d cron(8): Correct test sense
We're about to use the result of fstat(2) either way, so don't do that if it
fails...

X-MFC-With: r332429
2018-04-12 14:32:26 +00:00
Kyle Evans
1cb7491a3f cron(8): Reload database if an existing job in cron.d changed as well
Directory mtime will only change if a file is added or removed, not
modified. For /var/cron/tabs, this is fine because of how crontab(1) manages
it using temp files so all crontab(1) changes will trigger a reload of the
database.

For /etc/cron.d and /usr/local/etc/cron.d, this is not necessarily the case.
Instead of checking their mtime, we should descend into them and check mtime
on all jobs also.

Reported by:	des
Reviewed by:	bapt
MFC after:	1 week
2018-04-12 13:52:55 +00:00
Edward Tomasz Napierala
53ed4b300e Strip trailing whitespace.
MFC after:	2 weeks
2018-04-10 08:14:31 +00:00
Rodney W. Grimes
01d822d33b Add the ability to control the CPU topology of created VMs
from userland without the need to use sysctls, it allows the old
sysctls to continue to function, but deprecates them at
FreeBSD_version 1200060 (Relnotes for deprecate).

The command line of bhyve is maintained in a backwards compatible way.
The API of libvmmapi is maintained in a backwards compatible way.
The sysctl's are maintained in a backwards compatible way.

Added command option looks like:
bhyve -c [[cpus=]n][,sockets=n][,cores=n][,threads=n][,maxcpus=n]
The optional parts can be specified in any order, but only a single
integer invokes the backwards compatible parse.  [,maxcpus=n] is
hidden by #ifdef until kernel support is added, though the api
is put in place.

bhyvectl --get-cpu-topology option added.

Reviewed by:	grehan (maintainer, earlier version),
Reviewed by:	bcr (manpages)
Approved by:	bde (mentor), phk (mentor)
Tested by:	Oleg Ginzburg <olevole@olevole.ru> (cbsd)
MFC after:	1 week
Relnotes:	Y
Differential Revision:	https://reviews.freebsd.org/D9930
2018-04-08 19:24:49 +00:00
Ed Schouten
671d700167 Fix enough warnings that we can build syslogd on all targets at WARNS=6.
This also fixes the build on MIPS.

Reported by:	cy (MIPS build failure)
2018-04-07 09:03:51 +00:00
Ed Schouten
b484e3fee4 Push RFC 5424 message format from logmsg() into fprintlog().
Now that all of parsemsg() parses both RFC 3164 and 5424 messages and
hands them to logmsg(), alter the latter to properly forward all RFC
5424 message attributes to fprintlog(). While there, make some minor
cleanups to this code:

- Instead of extending the existing code that compares hostnames and
  message bodies for deduplication, print all of the relevant message
  fields into a single string that we can compare ('saved').

- No longer let the behaviour of fprintflog() depend on whether
  'msg == NULL' to print repetition messages, Simply decompose this
  function into fprintlog_first() and fprintlog_successive(). This
  makes the interpretation of function arguments less magical and also
  allows us to get consistent behaviour across RFC 3164 and 5424 when
  adding support for the RFC 5424 output format.

- As RFC 5424 syslog messages have a dedicated application name field,
  alter the repetition messages to be printed on behalf of syslogd on
  the current system. Change these messages to use the local hostname,
  so that it's obvious which syslogd instance detected the repetition.
  Remove f_prevhost, as it has now become unnecessary.

- Remove a useless strdup(). Deconsting the message string is safe in
  this specific case.
2018-04-06 17:16:50 +00:00
Ed Schouten
228e9d5bd8 Remove some places where error messages are prefixed with "syslogd".
Due to using RFC 5424, the application name is stored in a dedicated
field. It can simply be passed as an argument to logmsg() now.
2018-04-06 16:26:46 +00:00
Ed Schouten
10b154332d Properly respect the passed in hostname for RFC 5424 messages.
Only override the hostname in case none is provided or when remote
hostnames should be ignored.
2018-04-06 16:24:03 +00:00
Ed Schouten
77f0ef9a96 Add RFC 5424 syslog message parsing to syslogd.
Syslogd currently uses the RFC 3164 format for its log messages.One
limitation of RFC 3164 is that it cannot be used to log entries with
sub-second precision timestamps. One of our users has expressed a desire
for doing this for doing some basic performance measurements.

This change attempts to make a first cut at switching to RFC 5424 based
logging. The first step is to alter syslogd's input path to properly
parse such messages. It alters the logmsg() prototype to match the
fields of RFC 5424. The parsemsg() function is extended to parse both
RFC 3164 and 5424 messages and call into logmsg() accordingly.

Additional changes include:

- Introducing proper parsing of timestamps, so that they can be printed
  in any desired output format. This means we need to infer the year and
  timezone for RFC 3164 timestamps.
- Removing ISKERNEL. This can now be realised by simply providing an
  APP-NAME (== "kernel").
- Extending RFC 3164 parsing to trim off the TAG prefix and using that
  to derive APP-NAME and PROCID.
- Increase MAXLINE. RFC 5424 mentions we should support 2k messages.

Differential Revision:	https://reviews.freebsd.org/D14926
2018-04-06 12:57:01 +00:00
Benno Rice
756e49c303 Synchronise with NetBSD's version of EFI handling for El Torito images.
When I implemented my EFI support I failed to check if the upstream version
of makefs in NetBSD had done the same. Override my version with theirs to
make it easier to stay in sync with them in the future.

Reviewed by:	imp, mav
Obtained from:	NetBSD
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D14913
2018-03-31 15:04:41 +00:00
Ed Maste
c93ff841aa makefs: sync fragment and block size with newfs
r222319 in newfs raised the default blocksize for UFS/FFS filesystems
from 16K to 32K and the default fragment size from 2K to 4K, with a
rationale that most disks were now running with 4K sectors.

MFC after:	2 weeks
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2018-03-30 03:38:08 +00:00
Brooks Davis
69f0fecbd6 Remove infrastructure for token-ring networks.
Reviewed by:	cem, imp, jhb, jmallett
Relnotes:	yes
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14875
2018-03-28 23:33:26 +00:00
Conrad Meyer
811d25e014 wpa_supplicant.conf.5: Document minimal eduroam configuration
PR:		226939
Submitted by:	Mateusz Piotrowski (0mp@)
Sponsored by:	Dell EMC Isilon
2018-03-26 22:10:20 +00:00
John-Mark Gurney
3762b440dc minor work smithing... 2018-03-24 04:21:22 +00:00
Benno Rice
633cb765d8 Don't try to modify El Torito section headers if there aren't any.
MFC after:	1 week
2018-03-23 22:59:45 +00:00
Benno Rice
ebf1c08960 Correctly mark the last El Torito section header.
Reported by:	Thomas Schmitt <scdbackup@gmx.net>
Reviewed by:	emaste, imp
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D14812
2018-03-23 22:52:26 +00:00
Benno Rice
8dbc390581 Allow makefs to properly tag UEFI El Torito boot images. Use them in amd64 ISOs.
UEFI booting requires an EFI System Partition (ESP). On most storage devices
this will be in a specific partition type. To allow booting from CD/ISO
filesystems, UEFI will look for an ESP in the form of a FAT filesystem image
embedded in the image. Historically FreeBSD has added one of these to its
amd64 ISO images but marked it as simply another i386 boot image. Luckily for
us most UEFI implementations are rather forgiving and work this out for us.

This change adds the ability to mark a boot image as being a UEFI image. It
also modifies our ISO generation to use this marking for the UEFI image we
embed.

Reported by:	Thomas Schmitt <scdbackup@gmx.net>
Reviewed by:	emaste, imp
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D14809
2018-03-23 20:56:18 +00:00
Gleb Smirnoff
c176562d38 Fix whitespace issues in r330034. No functional changes. 2018-03-20 22:00:58 +00:00
Xin LI
3e09403f77 Plug a possible memory leak.
MFC after:	2 weeks
2018-03-19 05:49:26 +00:00
Ed Maste
d8ba45e213 Revert r313780 (UFS_ prefix) 2018-03-17 12:59:55 +00:00
Ed Maste
1e2b9afca9 Prefix UFS symbols with UFS_ to reduce namespace pollution
Followup to r313780.  Also prefix ext2's and nandfs's versions with
EXT2_ and NANDFS_.

Reported by:	kib
Reviewed by:	kib, mckusick
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9623
2018-03-17 01:48:27 +00:00
Warner Losh
3fcd5d6e92 Make not getting BootOrder a warning, not a fatal error when printing.
Sponsored by: Netflix
2018-03-16 18:16:31 +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
Navdeep Parhar
ae9b401786 cxgbetool(8): Add the ability to decode hardware TCBs.
Obtained from:	Chelsio Communications
MFC after:	1 week
Sponsored by:	Chelsio Communications
2018-03-14 00:04:58 +00:00
Edward Tomasz Napierala
cd1fd29c26 Add "usbconfig dump_all_desc", a subcommand to dump all device and config
descriptors.

Reviewed by:	hselasky@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-03-13 19:49:06 +00:00
Scott Long
b3995bb872 Add a new 'debug' command tree and 'dump_reqs' command to grab and parse
command and chain frames of in-flight I/O from the driver.

Sponsored by:	Netflix
2018-03-12 05:03:32 +00:00
Garance A Drosehn
02e8b7b2e7 Fix the resource leak of a 'FILE *' which could happen in routine
ctl_readcf() if a call to malloc failed.

PR:		204955
Reported by:	David Binderman
2018-03-12 01:41:16 +00:00
Peter Grehan
a2d14dcac5 Add CR2 get/set support.
Reported/Tested by:  Fabian Freyer
Reviewed by:	araujo
Differential Revision:	https://reviews.freebsd.org/D14648
MFC after:	3 weeks
2018-03-11 08:27:11 +00:00
Hans Petter Selasky
f3365f07a3 Check that the address is specified in mlx5tool(8).
Submitted by:	kib@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-03-08 15:28:13 +00:00
Hans Petter Selasky
e808190a59 Add kernel and userspace code to dump the firmware state of supported
ConnectX-4/5 devices in mlx5core.

The dump is obtained by reading a predefined register map from the
non-destructive crspace, accessible by the vendor-specific PCIe
capability (VSC). The dump is stored in preallocated kernel memory and
managed by the mlx5tool(8), which communicates with the driver using a
character device node.

The utility allows to store the dump in format
    <address> <value>
into a file, to reset the dump content, and to manually initiate the
dump.

A call to mlx5_fwdump() should be added at the places where a dump
must be fetched automatically. The most likely place is right before a
firmware reset request.

Submitted by:	kib@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-03-08 15:21:56 +00:00
Alan Somers
66a981f278 spray: fix the spelling in an output string
MFC after:	3 weeks
2018-03-05 16:13:29 +00:00
Hiroki Sato
7ef6eb24c9 - Remove extra NULL check before free().
- Fix null pointer dereference in netbuffree() and use netbuffree()
  where applicable.
2018-03-05 03:38:31 +00:00
Hiroki Sato
c5814cf61c Partially back out changes in r327464. stdlib.h is used when
RPCBIND_DEBUG is enabled.
2018-03-05 03:34:01 +00:00
David Bright
32bd1c2bb3 Allow the "@" and "!" characters in passwd file GECOS fields.
Two PRs (152084 & 210187) request allowing the "@" and/or "!"
characters in the passwd file GECOS field. The man page for pw does
not mention that those characters are disallowed, Linux supports those
characters in this field, and the "@" character in particular would be
useful for storing email addresses in that field.

PR:		152084, 210187
Submitted by:	jschauma@netmeister.org, Dave Cottlehuber <dch@freebsd.org>
Reported by:	jschauma@netmeister.org, Dave Cottlehuber <dch@freebsd.org>
Reviewed by:	delphij (secteam), vangyzen
MFC after:	1 week
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D14519
2018-03-01 17:47:28 +00:00
Xin LI
0910025859 MFV r330102: ntp 4.2.8p11 2018-02-28 07:59:55 +00:00
David Bright
9176635592 Fix two memory leaks in syslogd
A memory leak in syslogd for processing of forward actions was
reported. This modification adapts the patch submitted with that bug
to fix the leak. While testing the modification, another leak was also
found and fixed.

PR:		198385
Submitted by:	Sreeram <sreeramabs@yahoo.com>
Reported by:	Sreeram <sreeramabs@yahoo.com>
Reviewed by:	hrs
MFC after:	1 week
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D14510
2018-02-26 19:27:59 +00:00