]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoAdd partial documentation for dtrace(1)'s -x configuration options.
markj [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 [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
kevans [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.
mav [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 [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
kevans [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.
pfg [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 [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
kevans [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
kevans [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
kevans [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
kevans [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.
imp [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.
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
asomers [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.
trasz [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
kevans [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.
0mp [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
bz [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 [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
emaste [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.
ae [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
emaste [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
eadler [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
tsoome [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
tsoome [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).
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.
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
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
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
kevans [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.
mav [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
brd [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
tsoome [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
tsoome [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
manu [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
tsoome [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
np [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
tsoome [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
kevans [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.
mav [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
kevans [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.
imp [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 [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
mmacy [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
kevans [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
kevans [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
netchild [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
pstef [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
cem [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.
loos [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
brd [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.
loos [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

5 years agoRemove pmap_kenter_section from the arm pmap. It's unused.
andrew [Wed, 15 Aug 2018 14:57:34 +0000 (14:57 +0000)]
Remove pmap_kenter_section from the arm pmap. It's unused.

Sponsored by: DARPA, AFRL

5 years agoMove ssh config file handling into the ssh Makefiles.
brd [Wed, 15 Aug 2018 14:53:42 +0000 (14:53 +0000)]
Move ssh config file handling into the ssh Makefiles.

This helps with pkgbase by using CONFS and tagging these as config files.

Approved by: allanjude (mentor), des
Differential Revision: https://reviews.freebsd.org/D16678

5 years agoRemove ARM_HAVE_SUPERSECTIONS. It was only supported on some XScale CPUs.
andrew [Wed, 15 Aug 2018 14:52:56 +0000 (14:52 +0000)]
Remove ARM_HAVE_SUPERSECTIONS. It was only supported on some XScale CPUs.

Sponsored by: DARPA, AFRL

5 years agoMake code and data only used within the arm pmap code as static.
andrew [Wed, 15 Aug 2018 14:45:01 +0000 (14:45 +0000)]
Make code and data only used within the arm pmap code as static.

Sponsored by: DARPA, AFRL

5 years agoMove all sh and csh files into bin/sh/ or bin/csh/
brd [Wed, 15 Aug 2018 14:41:24 +0000 (14:41 +0000)]
Move all sh and csh files into bin/sh/ or bin/csh/

This simplifies pkgbase by migrating these to CONFS so they are properly
tagged as config files.

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

5 years agoRemove arm pmap variables that are only ever set and never read.
andrew [Wed, 15 Aug 2018 14:29:04 +0000 (14:29 +0000)]
Remove arm pmap variables that are only ever set and never read.

Sponsored by: DARPA, AFRL

5 years agoRemove ARM_MMU_GENERIC, it's the only ARMV4/v5 MMU we support.
andrew [Wed, 15 Aug 2018 14:19:07 +0000 (14:19 +0000)]
Remove ARM_MMU_GENERIC, it's the only ARMV4/v5 MMU we support.

Sponsored by: DARPA, AFRL

5 years agoRemove the ARMv5 pmap function pointers. These were to support XScale so
andrew [Wed, 15 Aug 2018 13:52:31 +0000 (13:52 +0000)]
Remove the ARMv5 pmap function pointers. These were to support XScale so
are now unused.

Sponsored by: DARPA, AFRL

5 years agoRemove checks for now unsupported CPU_* values in arm headers.
andrew [Wed, 15 Aug 2018 13:48:59 +0000 (13:48 +0000)]
Remove checks for now unsupported CPU_* values in arm headers.

Sponsored by: DARPA, AFRL

5 years agoThe interface name must be sanitized before the search to match the existing
loos [Wed, 15 Aug 2018 13:42:22 +0000 (13:42 +0000)]
The interface name must be sanitized before the search to match the existing
netgraph node.

Fixes the search (and use) of VLANs with dot notation.

Obtained from: pfSense
Sponsored by: Rubicon Communications, LLC (Netgate)

5 years agoStart to remove XScale support from the ARMv4/v5 pmap. Support for XScale
andrew [Wed, 15 Aug 2018 13:40:16 +0000 (13:40 +0000)]
Start to remove XScale support from the ARMv4/v5 pmap. Support for XScale
has been removed from the kernel so we can remove it from here to help
simplify the code.

Sponsored by: DARPA, AFRL

5 years agoSet the Execute Never flags in EFI device memory as required by the ARMv8
andrew [Wed, 15 Aug 2018 13:19:15 +0000 (13:19 +0000)]
Set the Execute Never flags in EFI device memory as required by the ARMv8
spec.

Sponsored by: DARPA, AFRL

5 years agoRemove PHYSADDR from kernel configurations that don't need it. The only
andrew [Wed, 15 Aug 2018 13:13:19 +0000 (13:13 +0000)]
Remove PHYSADDR from kernel configurations that don't need it. The only
place we need to set it is when we also have FLASHADDR set.

Sponsored by: DARPA, AFRL

5 years agozfs: add ztest to the kyua test suite.
will [Wed, 15 Aug 2018 13:05:04 +0000 (13:05 +0000)]
zfs: add ztest to the kyua test suite.

This program is currently failing, and has been for >6 months on HEAD.
Ideally, this should be run 24x7 in CI, to discover hard-to-find bugs that
only manifest with concurrent i/o.

Requested by: lwhsu, mmacy

5 years agoRemove the VIRT armv7 kernel config. It is supported by GENERIC.
andrew [Wed, 15 Aug 2018 13:03:01 +0000 (13:03 +0000)]
Remove the VIRT armv7 kernel config. It is supported by GENERIC.

Sponsored by: DARPA, AFRL

5 years agoFix early EFIRT on PCID machines after r337773.
kib [Wed, 15 Aug 2018 12:48:49 +0000 (12:48 +0000)]
Fix early EFIRT on PCID machines after r337773.

Ensure that the valid PCID state is created for proc0 pmap, since it
might be used by efirt enter() before first context switch on the BSP.

Sponsored by: The FreeBSD Foundation
MFC after: 6 days

5 years agoIn the help message at the mountroot prompt, suggest something that
trasz [Wed, 15 Aug 2018 12:12:21 +0000 (12:12 +0000)]
In the help message at the mountroot prompt, suggest something that
actually works and matches the bsdinstall(8) default.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoImprove formatting.
trasz [Wed, 15 Aug 2018 11:39:13 +0000 (11:39 +0000)]
Improve formatting.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agomake.conf(5): Note that src.conf should not be used for ports and documentation.
0mp [Wed, 15 Aug 2018 10:45:24 +0000 (10:45 +0000)]
make.conf(5): Note that src.conf should not be used for ports and documentation.

Reviewed by: bcr, kevans, krion, matthew
Approved by: krion (mentor)
Differential Revision: https://reviews.freebsd.org/D15177

5 years agoAdd SECURITY section to loader(8).
trasz [Wed, 15 Aug 2018 08:45:05 +0000 (08:45 +0000)]
Add SECURITY section to loader(8).

Reviewed by: bcr, jilles, imp (earlier version)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16700

5 years agocd9660 pointer sign issues and missing __packed attribute
tsoome [Wed, 15 Aug 2018 06:42:31 +0000 (06:42 +0000)]
cd9660 pointer sign issues and missing __packed attribute

The isonum_* functions are defined to take unsigend char* as an argument,
but the structure fields are defined as char. Change to u_char where needed.

Probably the full structure should be changed, but I'm not sure about the
side affects.

While there, add __packed attribute.

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

5 years agocxgbe(4): Use two hashes instead of a table to keep track of
np [Wed, 15 Aug 2018 03:03:01 +0000 (03:03 +0000)]
cxgbe(4): Use two hashes instead of a table to keep track of
hashfilters.  Two because the driver needs to look up a hashfilter by
its 4-tuple or tid.

A couple of fixes while here:
- Reject attempts to add duplicate hashfilters.
- Do not assume that any part of the 4-tuple that isn't specified is 0.
  This makes it consistent with all other mandatory parameters that
  already require explicit user input.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

5 years agoFlesh out a comment about what we're doing with read bias and trims.
imp [Wed, 15 Aug 2018 00:15:40 +0000 (00:15 +0000)]
Flesh out a comment about what we're doing with read bias and trims.

Sponsored by: Netflix

5 years agoarm/ralink cleanup
imp [Tue, 14 Aug 2018 20:45:43 +0000 (20:45 +0000)]
arm/ralink cleanup

Remove the non-INTRNG code.
Remove left over cut and paste code from the lpc code that was the start for the port.
Set KERNPHYSADDR and KERNVIRTADDR

Tested on Buffalo_WZR2-G300N

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

5 years agoFix a broken "SEE ALSO" section of hlfsd(8).
0mp [Tue, 14 Aug 2018 20:33:48 +0000 (20:33 +0000)]
Fix a broken "SEE ALSO" section of hlfsd(8).

While here pet mandoc and igor.

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

5 years agoFix a couple whitespace errors in r337814.
dab [Tue, 14 Aug 2018 20:26:54 +0000 (20:26 +0000)]
Fix a couple whitespace errors in r337814.

Reported by: Renato Botelho <garga.bsd@gmail.com>
MFC after: 3 days
X-MFC-with: r337814
Sponsored by: Dell EMC

5 years agoMFV r337818:
cy [Tue, 14 Aug 2018 20:24:10 +0000 (20:24 +0000)]
MFV r337818:

WPA: Ignore unauthenticated encrypted EAPOL-Key data

Ignore unauthenticated encrypted EAPOL-Key data in supplicant
processing. When using WPA2, these are frames that have the Encrypted
flag set, but not the MIC flag.

When using WPA2, EAPOL-Key frames that had the Encrypted flag set but
not the MIC flag, had their data field decrypted without first verifying
the MIC. In case the data field was encrypted using RC4 (i.e., when
negotiating TKIP as the pairwise cipher), this meant that
unauthenticated but decrypted data would then be processed. An adversary
could abuse this as a decryption oracle to recover sensitive information
in the data field of EAPOL-Key messages (e.g., the group key).
(CVE-2018-14526)

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
Obtained from:  git://w1.fi/hostap.git
MFC after:      1 day
Security:       CVE-2018-14526
Security:       VuXML: 6bedc863-9fbe-11e8-945f-206a8a720317

5 years agoFix several (more) memory leaks.
dab [Tue, 14 Aug 2018 19:31:06 +0000 (19:31 +0000)]
Fix several (more) memory leaks.

A follow-up to r337812 to catch a couple more memory leaks that should
have been included in that change.

Reported by: Coverity
CID: 12960641296067 (for real this time)
MFC after: 3 days
X-MFC-with: r337812
Sponsored by: Dell EMC

5 years agoHelp ensure that the copy loop doesn't get converted to a memcpy() call.
markj [Tue, 14 Aug 2018 19:21:31 +0000 (19:21 +0000)]
Help ensure that the copy loop doesn't get converted to a memcpy() call.

Reported and reviewed by: kib
X-MFC with: r337715
Sponsored by: The FreeBSD Foundation

5 years agoFix several memory leaks.
dab [Tue, 14 Aug 2018 19:12:45 +0000 (19:12 +0000)]
Fix several memory leaks.

The libkqueue tests have several places that leak memory by using an
idiom like:

puts(kevent_to_str(kevp));

Rework to save the pointer returned from kevent_to_str() and then
free() it after it has been used.

Reported by: asomers (pointer to Coverity), Coverity
CID: 1296063129606412960651296066129606713502871394960
Sponsored by: Dell EMC

5 years agoDisable the auto negotiation if the port is set to fixed-link.
loos [Tue, 14 Aug 2018 18:58:16 +0000 (18:58 +0000)]
Disable the auto negotiation if the port is set to fixed-link.

Tested on SG-3100 (ARMADA38X) and Espresso.bin (A37x0).  Fixes the network
on espresso.bin.

Sponsored by: Rubicon Communications, LLC (Netgate)

5 years agoMFV r337586: lua: Update to 5.3.5
kevans [Tue, 14 Aug 2018 18:58:01 +0000 (18:58 +0000)]
MFV r337586: lua: Update to 5.3.5

Bugfix release, nothing too major.

Tested with: lualoader via userboot, lualoader live
Differential Revision: https://reviews.freebsd.org/D16665

5 years agoFor our INT64 implementation, we can compare integers and numbers
imp [Tue, 14 Aug 2018 18:45:25 +0000 (18:45 +0000)]
For our INT64 implementation, we can compare integers and numbers
directly because they are the same thing.

Reviewed by: kevans@

5 years agoWhen the LUA floating point model is INT64, we don't need to do the
imp [Tue, 14 Aug 2018 18:45:20 +0000 (18:45 +0000)]
When the LUA floating point model is INT64, we don't need to do the
overflow dance. This avoids compile errors on latter-day gcc compilers
as well as simplifies the generated code.

Reviewed by: kevans@

5 years agoPrevent a wanring about checkdp being unused. It's not needed when we
imp [Tue, 14 Aug 2018 18:45:16 +0000 (18:45 +0000)]
Prevent a wanring about checkdp being unused. It's not needed when we
have INT64 floats and somehow snuck through unused until now.

Reviewed by: kevans@

5 years agoCreate a loader for each interpreter for x86 BIOS and all EFI
imp [Tue, 14 Aug 2018 18:44:41 +0000 (18:44 +0000)]
Create a loader for each interpreter for x86 BIOS and all EFI

Create loader_{4th,lua,simp}{,.efi}. All of these are installed by
default. Create LOADER_DEFAULT_INTERP to specify the default
interpreter when no other is specified. LOADER_INTERP is the current
interpreter language building. Turn building of lua on by default to
match 4th. simploader is a simplified loader build w/o any interpreter
language (but with a simple loader).  This is the historic behavir you
got with WITHOUT_FORTH. Make a hard link to the default loader. This
has to be a hard link rather than the more desirable soft link because
older zfsboot blocks don't support symlinks.

RelNotes: Yes
Differential Revision: https://reviews.freebsd.org/D16705

5 years agobectl(8): Check jailparam_* return values
kevans [Tue, 14 Aug 2018 18:35:33 +0000 (18:35 +0000)]
bectl(8): Check jailparam_* return values

Previous iteration of this assumed that these won't fail because we've
already setup the jail param to this point, but the allocations could still
fail in pretty bad conditions.

Admit that it's possible and return (ENOENT, EINVAL, ENOMEM, or 0) when
deleting arguments. EINVAL shouldn't happen since we're passing optarg;
which may satisfy *optarg == '\0' but never optarg == NULL.

CID: 13948851394901

5 years agolibbe(3): Fix leaky faucets
kevans [Tue, 14 Aug 2018 18:11:06 +0000 (18:11 +0000)]
libbe(3): Fix leaky faucets

Amongst them:
- Resource leaks
- Logically dead code
- Unused values
- Null termination issues

Reported by: asomers (pointer to Coverity), Coverity
CID: 139477713947911394830139484413948721394894,
CID: 1394900139490713949501394965

5 years agoMerge OpenSSL 1.0.2p.
jkim [Tue, 14 Aug 2018 17:48:02 +0000 (17:48 +0000)]
Merge OpenSSL 1.0.2p.

5 years agoUpdate the inet(4) and inet6(4) man pages to reflect the changes made
jtl [Tue, 14 Aug 2018 17:36:21 +0000 (17:36 +0000)]
Update the inet(4) and inet6(4) man pages to reflect the changes made
to the reassembly code in r337778, r337780, r337781, r337782, and
r337783.

Security: FreeBSD-SA-18:10.ip
Security: CVE-2018-6923

5 years agoLower the default limits on the IPv6 reassembly queue.
jtl [Tue, 14 Aug 2018 17:32:07 +0000 (17:32 +0000)]
Lower the default limits on the IPv6 reassembly queue.

Currently, the limits are quite high. On machines with millions of
mbuf clusters, the reassembly queue limits can also run into
the millions. Lower these values.

Also, try to ensure that no bucket will have a reassembly
queue larger than approximately 100 items. This limits the cost to
find the correct reassembly queue when processing an incoming
fragment.

Due to the low limits on each bucket's length, increase the size of
the hash table from 64 to 1024.

Reviewed by: jhb
Security: FreeBSD-SA-18:10.ip
Security: CVE-2018-6923

5 years agoLower the default limits on the IPv4 reassembly queue.
jtl [Tue, 14 Aug 2018 17:30:46 +0000 (17:30 +0000)]
Lower the default limits on the IPv4 reassembly queue.

In particular, try to ensure that no bucket will have a reassembly
queue larger than approximately 100 items. This limits the cost to
find the correct reassembly queue when processing an incoming
fragment.

Due to the low limits on each bucket's length, increase the size of
the hash table from 64 to 1024.

Reviewed by: jhb
Security: FreeBSD-SA-18:10.ip
Security: CVE-2018-6923

5 years agoProvide part of the mitigation for L1TF-VMM.
kib [Tue, 14 Aug 2018 17:29:41 +0000 (17:29 +0000)]
Provide part of the mitigation for L1TF-VMM.

On the guest entry in bhyve, flush L1 data cache, using either L1D
flush command MSR if available, or by reading enough uninteresting
data to fill whole cache.

Flush is automatically enabled on CPUs which do not report RDCL_NO,
and can be disabled with the hw.vmm.l1d_flush tunable/kenv.

Security: CVE-2018-3646
Reviewed by: emaste. jhb, Tony Luck <tony.luck@intel.com>
Sponsored by: The FreeBSD Foundation

5 years agoDrop 0-byte IPv6 fragments.
jtl [Tue, 14 Aug 2018 17:29:22 +0000 (17:29 +0000)]
Drop 0-byte IPv6 fragments.

Currently, we process IPv6 fragments with 0 bytes of payload, add them
to the reassembly queue, and do not recognize them as duplicating or
overlapping with adjacent 0-byte fragments. An attacker can exploit this
to create long fragment queues.

There is no legitimate reason for a fragment with no payload. However,
because IPv6 packets with an empty payload are acceptable, allow an
"atomic" fragment with no payload.

Reviewed by: jhb
Security: FreeBSD-SA-18:10.ip
Security: CVE-2018-6923

5 years agoImplement a limit on on the number of IPv6 reassembly queues per bucket.
jtl [Tue, 14 Aug 2018 17:27:41 +0000 (17:27 +0000)]
Implement a limit on on the number of IPv6 reassembly queues per bucket.

There is a hashing algorithm which should distribute IPv6 reassembly
queues across the available buckets in a relatively even way. However,
if there is a flaw in the hashing algorithm which allows a large number
of IPv6 fragment reassembly queues to end up in a single bucket, a per-
bucket limit could help mitigate the performance impact of this flaw.

Implement such a limit, with a default of twice the maximum number of
reassembly queues divided by the number of buckets. Recalculate the
limit any time the maximum number of reassembly queues changes.
However, allow the user to override the value using a sysctl
(net.inet6.ip6.maxfragbucketsize).

Reviewed by: jhb
Security: FreeBSD-SA-18:10.ip
Security: CVE-2018-6923

5 years agoAdd a limit of the number of fragments per IPv6 packet.
jtl [Tue, 14 Aug 2018 17:26:07 +0000 (17:26 +0000)]
Add a limit of the number of fragments per IPv6 packet.

The IPv4 fragment reassembly code supports a limit on the number of
fragments per packet. The default limit is currently 17 fragments.
Among other things, this limit serves to limit the number of fragments
the code must parse when trying to reassembly a packet.

Add a limit to the IPv6 reassembly code. By default, limit a packet
to 65 fragments (64 on the queue, plus one final fragment to complete
the packet). This allows an average fragment size of 1,008 bytes, which
should be sufficient to hold a fragment. (Recall that the IPv6 minimum
MTU is 1280 bytes. Therefore, this configuration allows a full-size
IPv6 packet to be fragmented on a link with the minimum MTU and still
carry approximately 272 bytes of headers before the fragmented portion
of the packet.)

Users can adjust this limit using the net.inet6.ip6.maxfragsperpacket
sysctl.

Reviewed by: jhb
Security: FreeBSD-SA-18:10.ip
Security: CVE-2018-6923

5 years agoMake the IPv6 fragment limits be global, rather than per-VNET, limits.
jtl [Tue, 14 Aug 2018 17:24:26 +0000 (17:24 +0000)]
Make the IPv6 fragment limits be global, rather than per-VNET, limits.

The IPv6 reassembly fragment limit is based on the number of mbuf clusters,
which are a global resource. However, the limit is currently applied
on a per-VNET basis. Given enough VNETs (or given sufficient customization
on enough VNETs), it is possible that the sum of all the VNET fragment
limits will exceed the number of mbuf clusters available in the system.

Given the fact that the fragment limits are intended (at least in part) to
regulate access to a global resource, the IPv6 fragment limit should
be applied on a global basis.

Note that it is still possible to disable fragmentation for a particular
VNET by setting the net.inet6.ip6.maxfragpackets sysctl to 0 for that
VNET. In addition, it is now possible to disable fragmentation globally
by setting the net.inet6.ip6.maxfrags sysctl to 0.

Reviewed by: jhb
Security: FreeBSD-SA-18:10.ip
Security: CVE-2018-6923