]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMETALOG, unless manually overwritten, is defined as ${DESTDIR}/${DISTDIR}/METALOG
Bjoern A. Zeeb [Fri, 17 Aug 2018 21:19:18 +0000 (21:19 +0000)]
METALOG, unless manually overwritten, is defined as ${DESTDIR}/${DISTDIR}/METALOG

In the create-world-packages target we manually piece this together (unless
it is undefined), without the DISTDIR.  Normally DISTDIR is empty (unset) and
no one notices.  Now DISTDIR is a well known long-standing PORTS environment
variable and if that is set in the local environment the path to METALOG
is wrong as it no longer is ${DESTDIR}/METALOG.

Long-term we should start to avoid "publicly well known" names for global
variables, for now just piece ${DISTDIR} in as well.  This allows
create-world-packages to continue if DISTDIR is set in the env.

5 years agoFix LORs between vn_start_write() and vn_lock() in the pNFS server.
Rick Macklem [Fri, 17 Aug 2018 21:12:16 +0000 (21:12 +0000)]
Fix LORs between vn_start_write() and vn_lock() in the pNFS server.

When coding the pNFS server, I added several vn_start_write() calls done
while the vnode was locked, not realizing I had introduced LORs and
possible deadlock when an exported file system on the MDS is suspended.
This patch fixes this by removing the added vn_start_write() calls and
modifying the code so that the extant vn_start_write() call before the
NFS RPC/operation is done when needed by the pNFS server.
Flags are changed so that LayoutCommit and LayoutReturn now get a
vn_start_write() done for them.
When the pNFS server is enabled, the code now also changes the flags for
Getattr, so that the vn_start_write() is done for Getattr, since it may
need to do a vn_set_extattr(). The nfs_writerpc flag array was made global
to the NFS server and renamed nfsrv_writerpc, which is consistent naming
for globals in the NFS server.
Thanks go to kib@ for reporting that doing vn_start_write() while the vnode is
locked results in a LOR.
This patch only affects the behaviour of the pNFS server.

5 years agoCopy the boot loader from the new location for the co-existing
Warner Losh [Fri, 17 Aug 2018 20:41:50 +0000 (20:41 +0000)]
Copy the boot loader from the new location for the co-existing
loaders.

Reviewed by: gjb@

5 years agocxgbe(4): Adjust ntids to account for nhptids in the TOE case too.
Navdeep Parhar [Fri, 17 Aug 2018 20:28:31 +0000 (20:28 +0000)]
cxgbe(4):  Adjust ntids to account for nhptids in the TOE case too.
This should have been part of r337538.

5 years agocxgbe/tom: Put the ifnet or VLAN's PCP value in the 802.1Q tag of frames
Navdeep Parhar [Fri, 17 Aug 2018 19:22:46 +0000 (19:22 +0000)]
cxgbe/tom: Put the ifnet or VLAN's PCP value in the 802.1Q tag of frames
generated by the TOE.  Works with vid 0 (no VLAN, just priority) too.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoFix sys/netipsec/tunnel tests after r337736
Alan Somers [Fri, 17 Aug 2018 18:37:22 +0000 (18:37 +0000)]
Fix sys/netipsec/tunnel tests after r337736

Originally, these tests accidentally used broadcast addresses when they
should've used unicast addresses.  That the tests passed prior to r337736
was accidental.

Submitted by: ae
Reviewed by: olivier
MFC after: 2 weeks

5 years agoAdd pthread_get_name_np(3).
Konstantin Belousov [Fri, 17 Aug 2018 18:34:07 +0000 (18:34 +0000)]
Add pthread_get_name_np(3).

The function retrieves the thread name previously set by
pthread_set_name_np(3). The name is cached in the process memory.

Requested by: Willem Jan Withagen <wjw@digiware.nl>
Man page update: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: ian (previous version)
Discussed with: arichardson, bjk (man page)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D16702

5 years agoReorder alphabetically.
Konstantin Belousov [Fri, 17 Aug 2018 18:24:11 +0000 (18:24 +0000)]
Reorder alphabetically.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D16702

5 years agoAdd a man page for ratecheck(9) and ppsratecheck(9).
Dag-Erling Smørgrav [Fri, 17 Aug 2018 17:16:38 +0000 (17:16 +0000)]
Add a man page for ratecheck(9) and ppsratecheck(9).

5 years agoRework rtld's TLS Variant I implementation to match r326794
Brooks Davis [Fri, 17 Aug 2018 16:19:47 +0000 (16:19 +0000)]
Rework rtld's TLS Variant I implementation to match r326794

The above commit fixed handling overaligned TLS segments in libc's
TLS Variant I implementation, but rtld provides its own implementation
for dynamically-linked executables which lacks these fixes.  Thus,
port these changes to rtld.

Submitted by: James Clarke
Reviewed by: kbowling
Testing byL kbowling (powerpc64), br (riscv), kevans (armv7)
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16510

5 years agoTypo.
Mark Johnston [Fri, 17 Aug 2018 16:07:06 +0000 (16:07 +0000)]
Typo.

X-MFC with: r337974

5 years agoAdd INVARIANTS-only fences around lockless vnode refcount updates.
Mark Johnston [Fri, 17 Aug 2018 15:41:01 +0000 (15:41 +0000)]
Add INVARIANTS-only fences around lockless vnode refcount updates.

Some internal KASSERTs access the v_iflag field without the vnode
interlock held after such a refcount update.  The fences are needed for
the assertions to be correct in the face of store reordering.

Reported and tested by: jhibbits
Reviewed by: kib, mjg
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16756

5 years agoAdd Modbus Application Protocol to /etc/services
Alan Somers [Fri, 17 Aug 2018 15:18:57 +0000 (15:18 +0000)]
Add Modbus Application Protocol to /etc/services

IANA reassigned ports 502 and 802 on 2014-06-10

PR: 213276
Submitted by: Mark.Martinec@ijs.si
MFC after: 2 weeks

5 years ago9751 Allocation throttling misplacing ditto blocks
Alexander Motin [Fri, 17 Aug 2018 15:17:09 +0000 (15:17 +0000)]
9751 Allocation throttling misplacing ditto blocks

Relax allocation throttling for ditto blocks.  Due to random imbalances
in allocation it tends to push block copies to one vdev, that looks
slightly better at the moment.  Slightly less strict policy allows both
improve data security and surprisingly write performance, since we don't
need to touch extra metaslabs on each vdev to respect the min distance.

Sponsored by: iXsystems, Inc.

5 years agopf tests: Verify that pf limits the number of fragments per packet
Kristof Provost [Fri, 17 Aug 2018 15:02:58 +0000 (15:02 +0000)]
pf tests: Verify that pf limits the number of fragments per packet

Test the limitation on number of frames per packet introduced in pf in r337969.

Sponsored by: Klara Systems

5 years ago9738 Fix third block copy allocations, broken at 9112.
Alexander Motin [Fri, 17 Aug 2018 15:00:41 +0000 (15:00 +0000)]
9738 Fix third block copy allocations, broken at 9112.

Use METASLAB_WEIGHT_CLAIM weight to allocate tertiary blocks.
Previous use of METASLAB_WEIGHT_SECONDARY for that caused errors
later on metaslab_activate_allocator() call, leading to massive
load of unneeded metaslabs and write freezes.

Reviewed by: Paul Dagnelie <pcd@delphix.com>

5 years agopf: Limit the maximum number of fragments per packet
Kristof Provost [Fri, 17 Aug 2018 15:00:10 +0000 (15:00 +0000)]
pf: Limit the maximum number of fragments per packet

Similar to the network stack issue fixed in r337782 pf did not limit the number
of fragments per packet, which could be exploited to generate high CPU loads
with a crafted series of packets.

Limit each packet to no more than 64 fragments. This should be sufficient on
typical networks to allow maximum-sized IP frames.

This addresses the issue for both IPv4 and IPv6.

MFC after: 3 days
Security: CVE-2018-5391
Sponsored by: Klara Systems

5 years agoConsistently use NULL to terminate the argv; no functional changes.
Edward Tomasz Napierala [Fri, 17 Aug 2018 14:57:13 +0000 (14:57 +0000)]
Consistently use NULL to terminate the argv; no functional changes.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoGPT is standard in x86 and arm64 land. Add it to DEFAULTS with the
Warner Losh [Fri, 17 Aug 2018 14:47:21 +0000 (14:47 +0000)]
GPT is standard in x86 and arm64 land. Add it to DEFAULTS with the
others.

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

5 years agoFix style nits.
Mariusz Zaborski [Fri, 17 Aug 2018 14:37:13 +0000 (14:37 +0000)]
Fix style nits.

5 years agocapsicum: allow the setproctitle(3) function in capability mode
Mariusz Zaborski [Fri, 17 Aug 2018 14:35:10 +0000 (14:35 +0000)]
capsicum: allow the setproctitle(3) function in capability mode

Capsicum in past allowed to change the process title.
This was broken with r335939.

PR: 230584
Submitted by: Yuichiro NAITO <naito.yuichiro@gmail.com>
Reported by: ian@niw.com.au
MFC after: 1 week

5 years agodtc(1): Update to 97d2d5715eeb45108cc60367fdf6bd5b2046b050
Kyle Evans [Fri, 17 Aug 2018 13:24:48 +0000 (13:24 +0000)]
dtc(1): Update to 97d2d5715eeb45108cc60367fdf6bd5b2046b050

Notable fixes:
- Overlays may now be generated properly without -@
- /__local_fixups__ were not including unit address in their structure
- The error reporting a magic token was misleading, reporting
  "Bad magic token in header.  Got d00dfeed expected 0xd00dfeed"
  if the token was missing. This has been split out into a separate message.

MFC after: 1 week

5 years agoDon't set a file's size for the MDS file of a pNFS service.
Rick Macklem [Fri, 17 Aug 2018 12:32:38 +0000 (12:32 +0000)]
Don't set a file's size for the MDS file of a pNFS service.

When a pNFS service is running, the size of the files created on the MDS
are normally 0, since the data is written to the data files on the DS(s).
However, without this patch, if a Setattr with a non-zero size was done by
a client, the MDS file was set to that size.  This was thought to be benign,
but it turns out that files with a non-zero size plus extended attributes
can cause a "ffs_truncate3" panic in UFS. Although the exact cause of this
panic() has not been isolated, this patch avoids the panic() and leaves
the MDS files in a consistent state of always having a size == 0.
Note that these MDS files never store data. The patch also includes an
unnecessary initialization of savsize in case some compiler or static
analyser complains it might not be initialized.
This patch only affects the NFS server when pNFS is enabled via the "-p"
command line option on nfsd.

5 years agoAdd the possibility to mark packets urgent based on their length.
Nick Hibma [Fri, 17 Aug 2018 10:18:45 +0000 (10:18 +0000)]
Add the possibility to mark packets urgent based on their length.

This allows preferring small (e.g. ACK) packets, in upload heavy
environments.

It was already possible to mark packets urgent based on destination
port. This option piggy backs on that feature.

5 years agobuild: skip the database check when generating install media
Roger Pau Monné [Fri, 17 Aug 2018 07:27:15 +0000 (07:27 +0000)]
build: skip the database check when generating install media

There are several scripts and targets solely used to generate install
media, make sure DB_FROM_SRC is used in that case in order to prevent
checking the host database, which is irrelevant when generating
install binaries.

Sponsored by: Citrix Systems R&D
PR: 230459
Reviewed by: gjb
Differential revision: https://reviews.freebsd.org/D16638

5 years agocryptosoft: Reduce generality of supported algorithm composition
Conrad Meyer [Fri, 17 Aug 2018 04:40:01 +0000 (04:40 +0000)]
cryptosoft: Reduce generality of supported algorithm composition

Fix a regression introduced in r336439.

Rather than allowing any linked list of algorithms, allow at most two
(typically, some combination of encrypt and/or MAC).  Removes a WAITOK
malloc in an unsleepable context (classic LOR) by placing both software
algorithm contexts within the OCF-managed session object.

Tested with 'cryptocheck -a all -d cryptosoft0', which includes some
encrypt-and-MAC modes.

PR: 230304
Reported by: sef@

5 years agoAdd efidev(4)/efirt(9)
Kyle Evans [Fri, 17 Aug 2018 04:17:51 +0000 (04:17 +0000)]
Add efidev(4)/efirt(9)

Document efidev(4), provider of userland access to EFI Runtime Services. A link is created to efirtc(4), which handles the time-of-day clock side.

efirt(9) is the kernel side of this.

Reviewed by: imp, kib (earlier version)
Differential Revision: https://reviews.freebsd.org/D16696

5 years agols(1): Add --color=when
Kyle Evans [Fri, 17 Aug 2018 04:15:51 +0000 (04:15 +0000)]
ls(1): Add --color=when

--color may be set to one of: 'auto', 'always', and 'never'.

'auto' is the default behavior- output colors only if -G or COLORTERM are
set, and only if stdout is a tty.

'always' is a new behavior- output colors always. termcap(5) will be
consulted unless TERM is unset or not a recognized terminal, in which case
ls(1) will fall back to explicitly outputting ANSI escape sequences.

'never' to turn off any environment variable and -G usage.

Reviewed by: cem, 0mp (both modulo last-minute manpage changes
Differential Revision: https://reviews.freebsd.org/D16741

5 years agorandom: Add PowerPC 'darn' instruction entropy source
Justin Hibbits [Fri, 17 Aug 2018 03:49:07 +0000 (03:49 +0000)]
random: Add PowerPC 'darn' instruction entropy source

Summary:
PowerISA 3.0 adds a 'darn' instruction to "deliver a random number".  This
driver was modeled after (rather, copied and gutted of) the Ivy Bridge
rdrand driver.

This uses the "Conditional Random Number" behavior to remove input bias.

From the ISA reference the 'darn' instruction, and the random number
generator backing it, conforms to the NIST SP800-90B and SP800-90C
standards, compliant to the extent possible at the time the hardware was
designed, and guarantees a minimum 0.5 bits of entropy per bit returned.

Reviewed By: markm, secteam (delphij)
Approved by: secteam (delphij)
Differential Revision: https://reviews.freebsd.org/D16552

5 years agosubr_prf: Don't write kern.boot_tag if it's empty
Kyle Evans [Fri, 17 Aug 2018 03:42:57 +0000 (03:42 +0000)]
subr_prf: Don't write kern.boot_tag if it's empty

This change allows one to set kern.boot_tag="" and not get a blank line
preceding other boot messages. While this isn't super critical- blank lines
are easy to filter out both mentally and in processing dmesg later- it
allows for a mode of operation that matches previous behavior.

I intend to MFC this whole series to stable/11 by the end of the month with
boot_tag empty by default to make this effectively a nop in the stable
branch.

5 years agobectl(8): Add batch mode to jail subcommand
Kyle Evans [Fri, 17 Aug 2018 01:59:19 +0000 (01:59 +0000)]
bectl(8): Add batch mode to jail subcommand

Adding batch mode to the jail `bectl(8)` subcommand enables jailing of
ZFS Boot Environments in a scriptable fashion.

Submitted by: Shawn Webb
Obtained from: HardenedBSD (9e72d1c59a and ef7b6d9e1c with minor edit)

5 years agoRiscv: Include crypto for IPSec
Conrad Meyer [Fri, 17 Aug 2018 01:08:22 +0000 (01:08 +0000)]
Riscv: Include crypto for IPSec

Similar to r337944.  I think this is the last configuration that includes IPsec
but not crypto.

5 years agoarm: Define crypto option on platforms that include IPsec
Conrad Meyer [Fri, 17 Aug 2018 01:04:02 +0000 (01:04 +0000)]
arm: Define crypto option on platforms that include IPsec

Missed in r337940.

(It's not like there are any crypto files IPsec doesn't pull in, so it is
unclear what not defining the crypto option was supposed to achieve.)

Reported by: np@

5 years agoif_vlan(4): A VLAN always has a PCP and its ifnet's if_pcp should be set
Navdeep Parhar [Fri, 17 Aug 2018 01:03:23 +0000 (01:03 +0000)]
if_vlan(4): A VLAN always has a PCP and its ifnet's if_pcp should be set
to the PCP value in use instead of IFNET_PCP_NONE.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoAdd test cases for Poly1305 from RFC 7539
Conrad Meyer [Fri, 17 Aug 2018 00:32:00 +0000 (00:32 +0000)]
Add test cases for Poly1305 from RFC 7539

5 years agocrypto(4): Add cryptosoft, cryptodev support for Poly-1305
Conrad Meyer [Fri, 17 Aug 2018 00:31:06 +0000 (00:31 +0000)]
crypto(4): Add cryptosoft, cryptodev support for Poly-1305

5 years agoAdd xform-conforming auth_hash wrapper for Poly-1305
Conrad Meyer [Fri, 17 Aug 2018 00:30:04 +0000 (00:30 +0000)]
Add xform-conforming auth_hash wrapper for Poly-1305

The wrapper is a thin shim around libsodium's Poly-1305 implementation.  For
now, we just use the C algorithm and do not attempt to build the
SSE-optimized variant for x86 processors.

The algorithm support has not yet been plumbed through cryptodev, or added
to cryptosoft.

5 years agoBring in compatibility glue for libsodium
Conrad Meyer [Fri, 17 Aug 2018 00:27:56 +0000 (00:27 +0000)]
Bring in compatibility glue for libsodium

The idea is untouched upstream sources live in sys/contrib/libsodium.

sys/crypto/libsodium are support routines or compatibility headers to allow
building unmodified upstream code.

This is not yet integrated into the build system, so no functional change.

5 years agoBring in libsodium to sys/contrib
Conrad Meyer [Fri, 17 Aug 2018 00:23:50 +0000 (00:23 +0000)]
Bring in libsodium to sys/contrib

Bring in https://github.com/jedisct1/libsodium at
461ac93b260b91db8ad957f5a576860e3e9c88a1 (August 7, 2018), unmodified.

libsodium is derived from Daniel J. Bernstein et al.'s 2011 NaCl
("Networking and Cryptography Library," pronounced "salt") software library.
At the risk of oversimplifying, libsodium primarily exists to make it easier
to use NaCl.  NaCl and libsodium provide high quality implementations of a
number of useful cryptographic concepts (as well as the underlying
primitics) seeing some adoption in newer network protocols.

I considered but dismissed cleaning up the directory hierarchy and
discarding artifacts of other build systems in favor of remaining close to
upstream (and easing future updates).

Nothing is integrated into the build system yet, so in that sense, no
functional change.

5 years agoRename head from ALPHA1 to ALPHA2 in preparation for the next set
Glen Barber [Thu, 16 Aug 2018 23:58:22 +0000 (23:58 +0000)]
Rename head from ALPHA1 to ALPHA2 in preparation for the next set
of snapshot builds.

Hashtag: MaximumEffort
Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoFix sys/opencrypto/blake2_test when kern.cryptodevallowsoft=0
Alan Somers [Thu, 16 Aug 2018 23:49:56 +0000 (23:49 +0000)]
Fix sys/opencrypto/blake2_test when kern.cryptodevallowsoft=0

Two of these testcases require software crypto to be enabled. Curiously, it
isn't by default.

PR: 230671
Reported by: Jenkins
Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16755

5 years agoAdd the ability to look up the 3b PCP of a VLAN interface. Use it in
Navdeep Parhar [Thu, 16 Aug 2018 23:46:38 +0000 (23:46 +0000)]
Add the ability to look up the 3b PCP of a VLAN interface.  Use it in
toe_l2_resolve to fill up the complete vtag and not just the vid.

Reviewed by: kib@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D16752

5 years agoSpecify DB_FROM_SRC=yes when doing any installation target.
Warner Losh [Thu, 16 Aug 2018 22:13:43 +0000 (22:13 +0000)]
Specify DB_FROM_SRC=yes when doing any installation target.

We want to use the UIDs from the installed system, not the host
system, when installing things.

Sponsored by: Netflix

5 years agoRevert r337929
Alan Somers [Thu, 16 Aug 2018 22:04:00 +0000 (22:04 +0000)]
Revert r337929

FreeBSD's mkstemp sets the temporary file's permissions to 600, and has ever
since mkstemp was added in 1987.  Coverity's warning is still relevant for
portable programs since OpenGroup does not require that behavior, and POSIX
didn't until 2008.  But none of these programs are portable.

5 years agoFix Coverity warnings about mkstemp in tests
Alan Somers [Thu, 16 Aug 2018 21:36:19 +0000 (21:36 +0000)]
Fix Coverity warnings about mkstemp in tests

umask(2) should always be used prior to mkstemp(3) so the temporary file
won't be created with insecure permissions.

Reported by: Coverity
CID: 1331605 1347173 1375366 1339800 1331604 1296056 1296060
CID: 1296057 1296062
MFC after: 2 weeks

5 years agoFix build after r337852: Don't rebuild moduli based on unrelated moduli.c
Bryan Drewery [Thu, 16 Aug 2018 19:48:07 +0000 (19:48 +0000)]
Fix build after r337852: Don't rebuild moduli based on unrelated moduli.c

Reported by: many, delphij (moduli.c issue)

5 years agoAdd ashldi3 and ashrdi3 to mips.
Warner Losh [Thu, 16 Aug 2018 19:39:02 +0000 (19:39 +0000)]
Add ashldi3 and ashrdi3 to mips.

Now that we're using -Os, mips needs these routines.

5 years agoAdd partial documentation for dtrace(1)'s -x configuration options.
Mark Johnston [Thu, 16 Aug 2018 19:28:44 +0000 (19:28 +0000)]
Add partial documentation for dtrace(1)'s -x configuration options.

Some options are still missing descriptions, but they can be filled in
over time.

Submitted by: raichoo <raichoo@googlemail.com>
Reviewed by: 0mp (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16671

5 years agoRevert r337922, except for some documention-only bits. This needs to wait
Jamie Gritton [Thu, 16 Aug 2018 19:09:43 +0000 (19:09 +0000)]
Revert r337922, except for some documention-only bits.  This needs to wait
until user is changed to stop using jail(2).

Differential Revision: D14791

5 years agolibbe(3): Impose dataset length restrictions on boot env name validation
Kyle Evans [Thu, 16 Aug 2018 18:58:34 +0000 (18:58 +0000)]
libbe(3): Impose dataset length restrictions on boot env name validation

Previously, we only validated names for character restrictions. This is
helpful, but we should've also checked length restrictions- dataset names
must be restricted to MAXNAMELEN.

While here, move validation before doing a bunch of concatenations and fix
error handling in be_rename. It was previously setting the error state based
on return value from a libzfs function, which is wrong: libzfs errors don't
necessarily match cleanly to libbe errors. This would cause the assertion in
be_error to hit when the error was printed.

5 years agoMake vfs.zfs.zio.dva_throttle_enabled sysctl writable.
Alexander Motin [Thu, 16 Aug 2018 18:44:50 +0000 (18:44 +0000)]
Make vfs.zfs.zio.dva_throttle_enabled sysctl writable.

Not sure what I thought originally, but as I see now runtime changes are
working fine, and the code seems like even designed for this.

5 years agoPut jail(2) under COMPAT_FREEBSD11. It has been the "old" way of creating
Jamie Gritton [Thu, 16 Aug 2018 18:40:16 +0000 (18:40 +0000)]
Put jail(2) under COMPAT_FREEBSD11.  It has been the "old" way of creating
jails since FreeBSD 7.

Along with the system call, put the various security.jail.allow_foo and
security.jail.foo_allowed sysctls partly under COMPAT_FREEBSD11 (or
BURN_BRIDGES).  These sysctls had two disparate uses: on the system side,
they were global permissions for jails created via jail(2) which lacked
fine-grained permission controls; inside a jail, they're read-only
descriptions of what the current jail is allowed to do.  The first use
is obsolete along with jail(2), but keep them for the second-read-only use.

Differential Revision: D14791

5 years agolibbe(3): Prefer safer versions of strcat/strcpy
Kyle Evans [Thu, 16 Aug 2018 18:37:47 +0000 (18:37 +0000)]
libbe(3): Prefer safer versions of strcat/strcpy

Or, in the activate case, just use snprintf since that's effectively what
we're doing anyways.

5 years agoRevert r337419.
Pedro F. Giffuni [Thu, 16 Aug 2018 18:35:39 +0000 (18:35 +0000)]
Revert r337419.

The fix is only partial and causes an asymmetry which breaks a test in
multi_test.sh.

We should consider both parts of the issue found in OpenBSD[1], but for now
just revert the change.

[1] http://undeadly.org/cgi?action=article;sid=20180728110010

Reported by: asomers

5 years agosecurity.jail.enforce_statfs is handled by jail_set(2), so handling it in
Jamie Gritton [Thu, 16 Aug 2018 18:30:49 +0000 (18:30 +0000)]
security.jail.enforce_statfs is handled by jail_set(2), so handling it in
userspace jail(8) is redundant.

Differential Revision: D14791

5 years agobectl(8): Kit-kat bar
Kyle Evans [Thu, 16 Aug 2018 18:27:43 +0000 (18:27 +0000)]
bectl(8): Kit-kat bar

5 years agobectl(8): Implement the 'create a snapshot' variant of create
Kyle Evans [Thu, 16 Aug 2018 18:26:43 +0000 (18:26 +0000)]
bectl(8): Implement the 'create a snapshot' variant of create

5 years agobectl(8): Appease clang-scan
Kyle Evans [Thu, 16 Aug 2018 17:59:49 +0000 (17:59 +0000)]
bectl(8): Appease clang-scan

Use strlcpy instead of a plain strcpy

5 years agolibbe(3)/bectl(8): Hit rewind on a bunch of off-by-ones
Kyle Evans [Thu, 16 Aug 2018 17:56:03 +0000 (17:56 +0000)]
libbe(3)/bectl(8): Hit rewind on a bunch of off-by-ones

While here, use sizeof() in some places that it makes sense to reduce room
for error and prefer strlcpy to strncpy

5 years agoInstall links for loader.efi.
Warner Losh [Thu, 16 Aug 2018 16:30:23 +0000 (16:30 +0000)]
Install links for loader.efi.

Submitted by: ben wilber

5 years agoFix a module Makefile error on amd64 so the IPMI HW interfaces are built.
Doug Ambrisko [Thu, 16 Aug 2018 15:59:02 +0000 (15:59 +0000)]
Fix a module Makefile error on amd64 so the IPMI HW interfaces are built.
When the module is being unloaded and no HW interfaces were created don't
clean up.  This was exposed by the amd64 module build issue.

5 years agoFix the sys/opencrypto/runtests test when aesni(4) is already loaded
Alan Somers [Thu, 16 Aug 2018 15:44:48 +0000 (15:44 +0000)]
Fix the sys/opencrypto/runtests test when aesni(4) is already loaded

Apparently kldstat requires the full module name, including busname

Reported by: Jenkins
MFC after: 2 weeks

5 years agoFix typo.
Edward Tomasz Napierala [Thu, 16 Aug 2018 14:46:49 +0000 (14:46 +0000)]
Fix typo.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agobuild(7): Document KERNCONFDIR - directory in which KERNCONF resides
Kyle Evans [Thu, 16 Aug 2018 13:42:08 +0000 (13:42 +0000)]
build(7): Document KERNCONFDIR - directory in which KERNCONF resides

MFC after: 1 week

5 years agoTidy up the ports.7 manual page.
Mateusz Piotrowski [Thu, 16 Aug 2018 13:29:23 +0000 (13:29 +0000)]
Tidy up the ports.7 manual page.

  - Use "Dq Li" for inline commands as we do in other manuals.
  - Pet "igor" and "mandoc -Tlint".
  - Reword some parts for clarity.
  - Add missing Xr macros.
  - Reformat SEE ALSO to make the section more readable.

Reviewed by: eadler, krion, mat
Approved by: krion (mentor), mat (mentor)
Differential Revision: https://reviews.freebsd.org/D15350

5 years agoAllow the use of TCP instead of UDP for queries by setting options usevc
Bjoern A. Zeeb [Thu, 16 Aug 2018 13:18:40 +0000 (13:18 +0000)]
Allow the use of TCP instead of UDP for queries by setting options usevc
in resolv.conf which sets RES_USEVC.

Reviewed by: ume
MFC after: 17 days
Differential Revision: https://reviews.freebsd.org/D16607

5 years agoRemove the L1 and L2 xscale page defines and rename the generic macros to
Andrew Turner [Thu, 16 Aug 2018 10:00:51 +0000 (10:00 +0000)]
Remove the L1 and L2 xscale page defines and rename the generic macros to
the common name. While here move the macros to check these into pmap-v4.c
as they're only used there.

Sponsored by: DARPA, AFRL

5 years agosrc.conf.5: regen after r337899 WITH_LLD_IS_LD on armv7
Ed Maste [Thu, 16 Aug 2018 09:36:59 +0000 (09:36 +0000)]
src.conf.5: regen after r337899 WITH_LLD_IS_LD on armv7

5 years agoProperly initialize IP version in IPv6 header. This was missed in r334673.
Andrey V. Elsukov [Thu, 16 Aug 2018 09:19:06 +0000 (09:19 +0000)]
Properly initialize IP version in IPv6 header. This was missed in r334673.

Reported by: Lars Schotte <lars at gustik dot eu>

5 years agoEnable LLD_IS_LD by default on armv7
Ed Maste [Thu, 16 Aug 2018 09:11:34 +0000 (09:11 +0000)]
Enable LLD_IS_LD by default on armv7

lld should now be a usable linker for armv7, and is already used as the
bootstrap linker (for linking the kernel and userland).  Also enable as
the system linker now (/usr/bin/ld) for further testing and evaluation.
(This change will be reverted in case of unexpected fallout.)

Approved by: manu
Sponsored by: The FreeBSD Foundation

5 years ago[pci_vendors] Update pci_vendors to 2018.08.12
Eitan Adler [Thu, 16 Aug 2018 07:34:10 +0000 (07:34 +0000)]
[pci_vendors] Update pci_vendors to 2018.08.12

5 years agolibi386: bd_io_workaround() is to be called for reads only
Toomas Soome [Thu, 16 Aug 2018 07:13:36 +0000 (07:13 +0000)]
libi386: bd_io_workaround() is to be called for reads only

bd_io() can perform either reads or writes, we only need bd_io_workaround()
for reads.

5 years agolibi386: small style updates in biosdisk
Toomas Soome [Thu, 16 Aug 2018 06:50:53 +0000 (06:50 +0000)]
libi386: small style updates in biosdisk

Use break instead of return in for loop, as done earlier. Insert and remove
some blank lines. No functional changes intended.

5 years agoFix a resource leak when using strdup(3) and also fix few style(9).
Marcelo Araujo [Thu, 16 Aug 2018 06:38:01 +0000 (06:38 +0000)]
Fix a resource leak when using strdup(3) and also fix few style(9).

Reported by: Coverity
CID: 1394929
MFC after: 1 week
Sponsored by: iXsystems Inc.

5 years agoRemove duplicated code.
Marcelo Araujo [Thu, 16 Aug 2018 06:35:44 +0000 (06:35 +0000)]
Remove duplicated code.

Reported by: Coverity
CID: 1394893
MFC after: 1 week
Sponsored by: iXsystems Inc.

5 years agoAdd a comment explaining how the PSN works and why there is no need for
Marcelo Araujo [Thu, 16 Aug 2018 06:31:54 +0000 (06:31 +0000)]
Add a comment explaining how the PSN works and why there is no need for
a null terminator. Also mark CID 1394825 as intentional.

Reported by: Coverity
CID: 1394825
MFC after: 1 week
Sponsored by: iXsystems Inc.

5 years agoIncrease the mask from 15 to 255 or otherwise NVME_FEAT_SOFTWARE_PROGRESS
Marcelo Araujo [Thu, 16 Aug 2018 06:20:25 +0000 (06:20 +0000)]
Increase the mask from 15 to 255 or otherwise NVME_FEAT_SOFTWARE_PROGRESS
will never be reached.

Discussed with: Leon Dang and Darius Mihai <dariusmihaim@gmail.com>
MFC after: 1 week.
Sponsored by: iXsystems Inc.

5 years agols(1): Fix color env var checking
Kyle Evans [Thu, 16 Aug 2018 01:27:16 +0000 (01:27 +0000)]
ls(1): Fix color env var checking

CLICOLOR will behavior as always- if present at all in the environment,
allow colors.

COLORTERM, recently enforced, will have to be both present and not empty.

Submitted by: imp

5 years agoAdd couple tunables/sysctl, missed in r336949.
Alexander Motin [Thu, 16 Aug 2018 00:50:14 +0000 (00:50 +0000)]
Add couple tunables/sysctl, missed in r336949.

5 years agoRevert parts of r337849 and r337857
Brad Davis [Wed, 15 Aug 2018 23:18:34 +0000 (23:18 +0000)]
Revert parts of r337849 and r337857

This fixes the build and I will redo these changes as part of a future review
that organizes them differently.  The way I tried to do it here could be done
better.  Sorry for the noise.

Approved by: will (mentor)
Differential Revision: https://reviews.freebsd.org/D16737

5 years agolibi386: use BD_RD and BR_WR constants
Toomas Soome [Wed, 15 Aug 2018 22:40:09 +0000 (22:40 +0000)]
libi386: use BD_RD and BR_WR constants

Use BD_RD and BD_WR instead of 0 and 1.

Reported by: ian

5 years agolibi386: remove bd_read() and bd_write() wrappers
Toomas Soome [Wed, 15 Aug 2018 22:25:05 +0000 (22:25 +0000)]
libi386: remove bd_read() and bd_write() wrappers

Those wroappers are nice, but do not really add much value.

5 years agoam335x: Add pocketbeagle DTS to the build
Emmanuel Vadot [Wed, 15 Aug 2018 21:47:03 +0000 (21:47 +0000)]
am335x: Add pocketbeagle DTS to the build

U-Boot works for this board since 2018.07 and the DTS is now present
in the tree.

5 years agolibsa: zfs_probe() needs to set spa to NULL
Toomas Soome [Wed, 15 Aug 2018 21:38:06 +0000 (21:38 +0000)]
libsa: zfs_probe() needs to set spa to NULL

Silence the warning about possibly uninitialized use of spa.

5 years agocxgbe(4): Use VLAN_TRUNKDEV instead of private cookie to figure out the
Navdeep Parhar [Wed, 15 Aug 2018 21:24:05 +0000 (21:24 +0000)]
cxgbe(4): Use VLAN_TRUNKDEV instead of private cookie to figure out the
parent of a VLAN ifnet.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agolibi386: remove BD_SUPPORT_FRAGS
Toomas Soome [Wed, 15 Aug 2018 21:21:16 +0000 (21:21 +0000)]
libi386: remove BD_SUPPORT_FRAGS

BD_SUPPORT_FRAGS is preprocessor knob to allow partial reads in bioscd/biosdisk
level. However, we already have support for partial reads in bcache, and there
is no need to have duplication via preprocessor controls.

Note that bioscd/biosdisk interface is assumed to perform IO in 512B blocks,
so the only translation we have to do is 512 <-> native block size.

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

5 years agopkgfs_init: Initialize pkg
Kyle Evans [Wed, 15 Aug 2018 21:13:10 +0000 (21:13 +0000)]
pkgfs_init: Initialize pkg

new_package may not set *pp if it errors out, leaving pkg uninitialized.

Reported by: GCC

5 years agoFix mismerge in r337196.
Alexander Motin [Wed, 15 Aug 2018 21:01:57 +0000 (21:01 +0000)]
Fix mismerge in r337196.

ZoL did the same mistake, and fixed it with separate commit 863522b1f9:

dsl_scan_scrub_cb: don't double-account non-embedded blocks

We were doing count_block() twice inside this function, once
unconditionally at the beginning (intended to catch the embedded block
case) and once near the end after processing the block.

The double-accounting caused the "zpool scrub" progress statistics in
"zpool status" to climb from 0% to 200% instead of 0% to 100%, and
showed double the I/O rate it was actually seeing.

This was apparently a regression introduced in commit 00c405b4b5e8,
which was an incorrect port of this OpenZFS commit:

    https://github.com/openzfs/openzfs/commit/d8a447a7

Reviewed by: Thomas Caputi <tcaputi@datto.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Closes #7720
Closes #7738

Reported by: sef

5 years agodd(1): Kill off duplicate progress definition following r337865
Kyle Evans [Wed, 15 Aug 2018 20:50:38 +0000 (20:50 +0000)]
dd(1): Kill off duplicate progress definition following r337865

Reported by: mmacy

5 years agostand: Use -Oz/-Os for all loader/stand builds.
Warner Losh [Wed, 15 Aug 2018 20:31:11 +0000 (20:31 +0000)]
stand: Use -Oz/-Os for all loader/stand builds.

While we're not super size constrained, the x86 BIOS /boot/loader has
to be less than about 520k-530k to be reliable. The LUA loader is at
this size today. -Oz saves 15-20% on the size, keeping us safely small
enough (comparable to where we were with the 4th loader). This will
also help with sjg's work on bringing in bearssl, though we may again
be looking for space in the LUA loader.

Size table for clang 6.0.0:
default -O1 -Os -Oz
4th 442368 417792 389120 376832
lua 524288 479232 446464 430080

Tested by: kevans91@ (ubldr on armv7), dhw@ (loader on amdy64)
Differential Revision: https://reviews.freebsd.org/D16724

5 years agoDon't let clobber jailparam values when checking for modification of
Jamie Gritton [Wed, 15 Aug 2018 20:23:17 +0000 (20:23 +0000)]
Don't let clobber jailparam values when checking for modification of
init-only parameters.

Compare string parameter values with strncmp, not memcmp.

PR: 230487
Reported by: Jason Mader
MFC after: 3 days

5 years agoFix in6_multi double free
Matt Macy [Wed, 15 Aug 2018 20:23:08 +0000 (20:23 +0000)]
Fix in6_multi double free

This is actually several different bugs:
- The code is not designed to handle inpcb deletion after interface deletion
  - add reference for inpcb membership
- The multicast address has to be removed from interface lists when the refcount
  goes to zero OR when the interface goes away
  - decouple list disconnect from refcount (v6 only for now)
- ifmultiaddr can exist past being on interface lists
  - add flag for tracking whether or not it's enqueued
- deferring freeing moptions makes the incpb cleanup code simpler but opens the
  door wider still to races
  - call inp_gcmoptions synchronously after dropping the the inpcb lock

Fundamentally multicast needs a rewrite - but keep applying band-aids for now.

Tested by: kp
Reported by: novel, kp, lwhsu

5 years agodd: Incorporate some changes from imp for status=progress
Kyle Evans [Wed, 15 Aug 2018 19:46:13 +0000 (19:46 +0000)]
dd: Incorporate some changes from imp for status=progress

Notable changes from what landed in r337505:
- sigalarm handler isn't setup unless we're actually using it
- Humanized versions of the amount of data transferred in the progress
  update

Submitted by: imp
Reviewed by: kevans
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16642

5 years agoAdd post-mortem note to UPDATING about r337506
Kyle Evans [Wed, 15 Aug 2018 19:28:48 +0000 (19:28 +0000)]
Add post-mortem note to UPDATING about r337506

MFC after: 3 days

5 years ago- Add exec hook "exec.created". This is called when the jail is
Alexander Leidinger [Wed, 15 Aug 2018 18:35:42 +0000 (18:35 +0000)]
- Add exec hook "exec.created". This is called when the jail is
  created and before exec.start is called. [1]
- Bump __FreeBSD_version.

This allows to attach ZFS datasets and various other things to be
done before any command/service/rc-script is started in the new
jail.

PR: 228066 [1]
Reviewed by: jamie [1]
Submitted by: Stefan Grönke <stefan@gronke.net> [1]
Differential Revision: https://reviews.freebsd.org/D15330 [1]

5 years agoindent(1): bug fix after r336333
Piotr Pawel Stefaniak [Wed, 15 Aug 2018 18:19:45 +0000 (18:19 +0000)]
indent(1): bug fix after r336333

The bug was that isalnum() is not exactly equivalent to previous code which
also allowed characters "$" and "_", so check for those explicitly.

Reported by: tuexen@

5 years agoFUSE: Document global sysctl knobs
Conrad Meyer [Wed, 15 Aug 2018 17:41:19 +0000 (17:41 +0000)]
FUSE: Document global sysctl knobs

So that I don't have to keep grepping around the codebase to remember what each
one does.  And maybe it saves someone else some time.

Fix a trivial whitespace issue while here.

No functional change.

Sponsored by: Dell EMC Isilon

5 years agoFix a typo in comment.
Luiz Otavio O Souza [Wed, 15 Aug 2018 16:36:29 +0000 (16:36 +0000)]
Fix a typo in comment.

MFC after: 3 days
X-MFC with: r321316
Sponsored by: Rubicon Communications, LLC (Netgate)

5 years agoFix build after r337849
Brad Davis [Wed, 15 Aug 2018 16:22:12 +0000 (16:22 +0000)]
Fix build after r337849

This moves the symlink creation to after where the files are installed.

This also inverts the shell change so that it only happens if MK_TCSH is on.

Approved by: will (mentor)
Differential Revision: https://reviews.freebsd.org/D16725

5 years agoLate style follow up on r312770.
Luiz Otavio O Souza [Wed, 15 Aug 2018 15:44:30 +0000 (15:44 +0000)]
Late style follow up on r312770.

Submitted by: glebius
X-MFC with: r312770
MFC after: 3 days