]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agosh/tests: Improve failure messages of expansion/arith15.0
jilles [Thu, 7 Mar 2019 22:51:58 +0000 (22:51 +0000)]
sh/tests: Improve failure messages of expansion/arith15.0

5 years agoCorrect my previous correction to the license. It now matches the text
brooks [Thu, 7 Mar 2019 22:34:45 +0000 (22:34 +0000)]
Correct my previous correction to the license.  It now matches the text
in https://spdx.org/licenses/GPL-2.0.html

5 years agoCorrect license boilerplate, to match the SPDX tag.
brooks [Thu, 7 Mar 2019 22:20:20 +0000 (22:20 +0000)]
Correct license boilerplate, to match the SPDX tag.

The GPL-2.0 tag is a deprecated tag which means that same thing as
GPL-2.0-only.

5 years agoPull in r354937 from upstream clang trunk (by Jörg Sonnenberger):
dim [Thu, 7 Mar 2019 19:33:39 +0000 (19:33 +0000)]
Pull in r354937 from upstream clang trunk (by Jörg Sonnenberger):

  Fix inline assembler constraint validation

  The current constraint logic is both too lax and too strict. It fails
  for input outside the [INT_MIN..INT_MAX] range, but it also
  implicitly accepts 0 as value when it should not. Adjust logic to
  handle both correctly.

  Differential Revision: https://reviews.llvm.org/D58649

Pull in r355491 from upstream clang trunk (by Hans Wennborg):

  Inline asm constraints: allow ICE-like pointers for the "n"
  constraint (PR40890)

  Apparently GCC allows this, and there's code relying on it (see bug).

  The idea is to allow expression that would have been allowed if they
  were cast to int. So I based the code on how such a cast would be
  done (the CK_PointerToIntegral case in
  IntExprEvaluator::VisitCastExpr()).

  Differential Revision: https://reviews.llvm.org/D58821

These should fix assertions and errors when using the inline assembly
"n" constraint in certain ways.

In case of devel/valgrind, a pointer was used as the input for the
constraint, which lead to "Assertion failed: (isInt() && "Invalid
accessor"), function getInt".

In case of math/secp256k1, a very large integer value was used as input
for the constraint, which lead to "error: value '4624529908474429119'
out of range for constraint 'n'".

PR:             236216, 236194
MFC after:      1 month
X-MFC-With:     r344779

5 years agoarm64: allwinner: a64: Add TCON clock
manu [Thu, 7 Mar 2019 19:32:01 +0000 (19:32 +0000)]
arm64: allwinner: a64: Add TCON clock

The tcon clock need a mux table for it's parent, for now just
list the parents twice.

5 years agoarm64: allwinner: Add CCU DE2
manu [Thu, 7 Mar 2019 19:30:37 +0000 (19:30 +0000)]
arm64: allwinner: Add CCU DE2

The Display Engine 2 have it's own Clock and Control Unit, add support
for it.

5 years agoarm: allwinner: Fix NM clock recalc
manu [Thu, 7 Mar 2019 19:28:47 +0000 (19:28 +0000)]
arm: allwinner: Fix NM clock recalc

If the NM clock is using a fractional divider the formula isn't the same.

5 years agostand/common/module: Apply style(9)
manu [Thu, 7 Mar 2019 18:57:43 +0000 (18:57 +0000)]
stand/common/module: Apply style(9)

5 years agoseq(1): Require user-provided format strings to contain a conversion
cem [Thu, 7 Mar 2019 18:24:16 +0000 (18:24 +0000)]
seq(1): Require user-provided format strings to contain a conversion

This matches GNU seq, for example.

For users that are looking for similar functionality, 'jot -b foo N' will
print 'foo' N times.  See jot(1).

PR: 236347
Reported by: <y AT maya.st>
Sponsored by: Dell EMC Isilon

5 years agoMFV r344878:
cy [Thu, 7 Mar 2019 13:36:00 +0000 (13:36 +0000)]
MFV r344878:

4.2.8p12 --> 4.2.8p13

MFC after: immediately
Security: CVE-2019-8936
VuXML: c2576e14-36e2-11e9-9eda-206a8a720317
Obtained from: nwtime.org

5 years agoImport 4.2.8p13.
cy [Thu, 7 Mar 2019 13:01:16 +0000 (13:01 +0000)]
Import 4.2.8p13.

5 years agopf tests: Accelerate tests
kp [Thu, 7 Mar 2019 11:09:29 +0000 (11:09 +0000)]
pf tests: Accelerate tests

Make the tests run slightly faster by having pft_ping.py end the capture
of packets as soon as it sees the expected packet, rather than
continuing to sniff.

MFC after: 2 weeks

5 years agoDo not reference deskutils/cal from cal.1.
0mp [Thu, 7 Mar 2019 11:09:25 +0000 (11:09 +0000)]
Do not reference deskutils/cal from cal.1.

The ports version of cal is an abandonware so in order to minimize the
potential bit rot of our documentation let's not mention it at all.
Interested users are going to find suitable alternatives anyway on their
own.

Reported by: bapt
Approved by: bapt (src)
Approved by: krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D19492

5 years agoDocument that cal(1) cannot start a week with Monday.
0mp [Thu, 7 Mar 2019 10:19:40 +0000 (10:19 +0000)]
Document that cal(1) cannot start a week with Monday.

Reviewed by: bcr
Approved by: bcr (doc)
Approved by: krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D19491

5 years agoFix typo.
ae [Thu, 7 Mar 2019 10:01:32 +0000 (10:01 +0000)]
Fix typo.

MFC after: 1 week

5 years agoAfter removing an entry from the stream scheduler list, set the pointers
tuexen [Thu, 7 Mar 2019 08:43:20 +0000 (08:43 +0000)]
After removing an entry from the stream scheduler list, set the pointers
to NULL, since we are checking for it in case the element gets inserted
again.

This issue was found by running syzkaller.

MFC after: 3 days

5 years agopowerpc: Save stack pointer in savectx
jhibbits [Thu, 7 Mar 2019 04:43:08 +0000 (04:43 +0000)]
powerpc: Save stack pointer in savectx

This allows 'show acttrace' to show backtrace on processes currently running
on CPUs.

Reported by: Brandon Bergren
MFC after: 1 week

5 years agoFix the problem with O_LIMIT states introduced in r344018.
ae [Thu, 7 Mar 2019 04:40:44 +0000 (04:40 +0000)]
Fix the problem with O_LIMIT states introduced in r344018.

dyn_install_state() uses `rule` pointer when it creates state.
For O_LIMIT states this pointer actually is not struct ip_fw,
it is pointer to O_LIMIT_PARENT state, that keeps actual pointer
to ip_fw parent rule. Thus we need to cache rule id and number
before calling dyn_get_parent_state(), so we can use them later
when the `rule` pointer is overrided.

PR: 236292
MFC after: 3 days

5 years agoadd GPL text in addition to SPDX tags as requested by core
mmacy [Thu, 7 Mar 2019 03:53:48 +0000 (03:53 +0000)]
add GPL text in addition to SPDX tags as requested by core

MFC after: 1 week

5 years agoadd gcov to LINT build
mmacy [Thu, 7 Mar 2019 03:50:34 +0000 (03:50 +0000)]
add gcov to LINT build

MFC after: 1 week

5 years agoAdd build time GPL warning when GCOV is enabled
mmacy [Thu, 7 Mar 2019 03:47:41 +0000 (03:47 +0000)]
Add build time GPL warning when GCOV is enabled

MFC after: 1 week

5 years agoAdd respective tunables to few ZFS sysctls.
mav [Thu, 7 Mar 2019 01:24:08 +0000 (01:24 +0000)]
Add respective tunables to few ZFS sysctls.

MFC after: 1 week

5 years agofuse: switch from DFLTPHYS/MAXBSIZE to maxcachebuf
cem [Thu, 7 Mar 2019 00:55:49 +0000 (00:55 +0000)]
fuse: switch from DFLTPHYS/MAXBSIZE to maxcachebuf

On GENERIC kernels with empty loader.conf, there is no functional change.
DFLTPHYS and MAXBSIZE are both 64kB at the moment.  This change allows
larger bufcache block sizes to be used when either MAXBSIZE (custom kernel)
or the loader.conf tunable vfs.maxbcachebuf (GENERIC) is adjusted higher
than the default.

Suggested by: ken@

5 years agoDocument the efivar --load-option option
bcran [Thu, 7 Mar 2019 00:01:28 +0000 (00:01 +0000)]
Document the efivar --load-option option

Reviewed by: imp, kevans
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D19263

5 years agoUpdate for IETF draft-ietf-6man-ipv6only-flag.
bz [Wed, 6 Mar 2019 23:31:42 +0000 (23:31 +0000)]
Update for IETF draft-ietf-6man-ipv6only-flag.

All changes are hidden behind the EXPERIMENTAL option and are not compiled
in by default.

Add ND6_IFF_IPV6_ONLY_MANUAL to be able to set the interface into no-IPv4-mode
manually without router advertisement options.  This will allow developers to
test software for the appropriate behaviour even on dual-stack networks or
IPv6-Only networks without the option being set in RA messages.
Update ifconfig to allow setting and displaying the flag.

Update the checks for the filters to check for either the automatic or the manual
flag to be set.  Add REVARP to the list of filtered IPv4-related protocols and add
an input filter similar to the output filter.

Add a check, when receiving the IPv6-Only RA flag to see if the receiving
interface has any IPv4 configured.  If it does, ignore the IPv6-Only flag.

Add a per-VNET global sysctl, which is on by default, to not process the automatic
RA IPv6-Only flag.  This way an administrator (if this is compiled in) has control
over the behaviour in case the node still relies on IPv4.

5 years agoFUSE: Prevent trivial panic
cem [Wed, 6 Mar 2019 22:56:49 +0000 (22:56 +0000)]
FUSE: Prevent trivial panic

When open(2) was invoked against a FUSE filesystem with an unexpected flags
value (no O_RDONLY / O_RDWR / O_WRONLY), an assertion fired, causing panic.

For now, prevent the panic by rejecting such VOP_OPENs with EINVAL.

This is not considered the correct long term fix, but does prevent an
unprivileged denial-of-service.

PR: 236329
Reported by: asomers
Reviewed by: asomers
Sponsored by: Dell EMC Isilon

5 years agoDrop "All rights reserved" from my copyright statements.
jhb [Wed, 6 Mar 2019 22:11:45 +0000 (22:11 +0000)]
Drop "All rights reserved" from my copyright statements.

Reviewed by: rgrimes
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19485

5 years agoDivorce MK_GDB from MK_BINUTILS.
jhb [Wed, 6 Mar 2019 20:13:02 +0000 (20:13 +0000)]
Divorce MK_GDB from MK_BINUTILS.

This permits legacy GDB to still be built and installed if
WITHOUT_BINUTILS is set (e.g. if base/binutils is installed).

Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19480

5 years agoRegenerate src.conf.5 for recent changes.
jhb [Wed, 6 Mar 2019 20:10:23 +0000 (20:10 +0000)]
Regenerate src.conf.5 for recent changes.

Updates include removal of DRM2 and addition of several options
related to secure booting.

5 years agoPut in a temporary workaround for what is likely a gcc 6 bug (it does
dim [Wed, 6 Mar 2019 18:19:27 +0000 (18:19 +0000)]
Put in a temporary workaround for what is likely a gcc 6 bug (it does
not occur with gcc 7 or later).  This should prevent the following error
from breaking the head-amd64-gcc CI builds:

In file included from /workspace/src/contrib/llvm/tools/lldb/source/API/SBMemoryRegionInfo.cpp:14:0:
/workspace/src/contrib/llvm/tools/lldb/include/lldb/Target/MemoryRegionInfo.h:128:54: error: 'template<class _InputIterator> lldb_private::MemoryRegionInfos::MemoryRegionInfos(_InputIterator, _InputIterator, const allocator_type&)' inherited from 'std::__1::vector<lldb_private::MemoryRegionInfo>'
   using std::vector<lldb_private::MemoryRegionInfo>::vector;
                                                      ^~~~~~
/workspace/src/contrib/llvm/tools/lldb/include/lldb/Target/MemoryRegionInfo.h:128:54: error: conflicts with version inherited from 'std::__1::vector<lldb_private::MemoryRegionInfo>'

Reported by: CI

5 years agoUpdate the core-secretary role.
bcr [Wed, 6 Mar 2019 17:37:56 +0000 (17:37 +0000)]
Update the core-secretary role.

With the last core election, matthew@ stepped down and handed over to jrm@ to
serve as new core secretary. Update this file to match.

Approved by: core (implicit)

5 years agoReorder copyright lines to preserve the source of "All rights reserved."
markj [Wed, 6 Mar 2019 16:50:14 +0000 (16:50 +0000)]
Reorder copyright lines to preserve the source of "All rights reserved."

Reported by: rgrimes
MFC with: r344829, r344830

5 years agoFlush stdout after each iteration.
mav [Wed, 6 Mar 2019 15:19:04 +0000 (15:19 +0000)]
Flush stdout after each iteration.

Without this, if output is redirected from the console, it is buffered for
too long, making tool quite unusable.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

5 years ago[ath_hal_ar9300] Add the missing bits from the previous HAL commit.
adrian [Wed, 6 Mar 2019 08:52:02 +0000 (08:52 +0000)]
[ath_hal_ar9300] Add the missing bits from the previous HAL commit.

Noticed by: 75+ emails telling me I messed up.

5 years ago[athani] Add a simple tool to list and control ANI parameters.
adrian [Wed, 6 Mar 2019 07:58:19 +0000 (07:58 +0000)]
[athani] Add a simple tool to list and control ANI parameters.

This is a WIP tool I'm using to figure out why ANI is weirdly busted in my
home FreeBSD AP/STA setup.  Although athstats (mostly) gets the ANI statistics
correct, ANI is making the radio deaf it doesn't recover without being disabled.

It's very WIP.

Tested:

* Carambola 2,  (AR9331), AP/STA mode.

5 years ago[ath_hal] [ath_hal_ar9300] ANI fixes and preparation for userland control.
adrian [Wed, 6 Mar 2019 07:54:29 +0000 (07:54 +0000)]
[ath_hal] [ath_hal_ar9300] ANI fixes and preparation for userland control.

* The ani function bitmap was being badly used when determining if a command
  could be used.  In hostap modes only a couple of the ANI control parameters
  are enabled.

* The ani function bitmap was not being reset to HAL_ANI_ALL if transitioning
  from AP -> STA.

* Change mrcCckOff to mrcCck - 1 == on, rather than 1 == off.  This matches
  the API used to set the value from userland via the diagnostic API.

* Handle OFDM/CCK noise immunity level commands in ar9300_ani_control().
  These will only come from userland and it will go and program the rest of
  the ANI control parameters with the values in the ANI table.

* Ensure all of the ANI parameters can be tweaked at runtime, even if they're
  disabled.

Tested:

* carambola2 (AR9331), STA/AP modes

5 years agoExtend libsecureboot(old libve) to obtain trusted certificates from UEFI and implemen...
mw [Wed, 6 Mar 2019 06:39:42 +0000 (06:39 +0000)]
Extend libsecureboot(old libve) to obtain trusted certificates from UEFI and implement revocation

UEFI related headers were copied from edk2.

A new build option "MK_LOADER_EFI_SECUREBOOT" was added to allow
loading of trusted anchors from UEFI.

Certificate revocation support is also introduced.
The forbidden certificates are loaded from dbx variable.
Verification fails in two cases:

There is a direct match between cert in dbx and the one in the chain.
The CA used to sign the chain is found in dbx.
One can also insert a hash of TBS section of a certificate into dbx.
In this case verifications fails only if a direct match with a
certificate in chain is found.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: sjg
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D19093

5 years agoAdd retry loop around GetMemoryMap call to fix fragmentation bug
bcran [Wed, 6 Mar 2019 05:39:40 +0000 (05:39 +0000)]
Add retry loop around GetMemoryMap call to fix fragmentation bug

The call to BS->AllocatePages can cause the memory map to become framented,
causing BS->GetMemoryMap to return EFI_BUFFER_TOO_SMALL more than once. For
example this can happen on the MinnowBoard Turbot, causing the boot to stop
with an error. Avoid this by calling GetMemoryMap in a loop.

Reviewed by: imp, tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D19341

5 years agoRemove an empty directory emptied by r343702.
cy [Wed, 6 Mar 2019 02:52:58 +0000 (02:52 +0000)]
Remove an empty directory emptied by r343702.

MFC after: 3 days

5 years agoImplement minidump support for RISC-V.
markj [Wed, 6 Mar 2019 00:01:06 +0000 (00:01 +0000)]
Implement minidump support for RISC-V.

Submitted by: Mitchell Horne <mhorne063@gmail.com>
Differential Revision: https://reviews.freebsd.org/D18320

5 years agoAdd riscv minidump support to libkvm.
markj [Tue, 5 Mar 2019 23:59:55 +0000 (23:59 +0000)]
Add riscv minidump support to libkvm.

Submitted by: Mitchell Horne <mhorne063@gmail.com>
Differential Revision: https://reviews.freebsd.org/D19171

5 years agoInitialize dump_avail[] on riscv.
markj [Tue, 5 Mar 2019 23:58:16 +0000 (23:58 +0000)]
Initialize dump_avail[] on riscv.

Submitted by: Mitchell Horne <mhorne063@gmail.com>
Differential Revision: https://reviews.freebsd.org/D19170

5 years agoAdd pmap_get_tables() for riscv.
markj [Tue, 5 Mar 2019 23:56:40 +0000 (23:56 +0000)]
Add pmap_get_tables() for riscv.

This mirrors the arm64 implementation and is for use in the minidump
code.

Submitted by: Mitchell Horne <mhorne063@gmail.com>
Differential Revision: https://reviews.freebsd.org/D18321

5 years agoRound # partitions up to fill the last GPT table sector
marcel [Tue, 5 Mar 2019 22:55:33 +0000 (22:55 +0000)]
Round # partitions up to fill the last GPT table sector

Set the number of partitions entries in the GPT header to a
multiple of the number of entries that fit in a sector.

PR: 236238
Reviewed by: imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19465

5 years agoAdd a few missed files to the MK_LLVM_TARGET_BPF=yes case, otherwise
dim [Tue, 5 Mar 2019 22:04:23 +0000 (22:04 +0000)]
Add a few missed files to the MK_LLVM_TARGET_BPF=yes case, otherwise
clang and various other executables will fail to link with undefined
symbols.

Reported by: O. Hartmann <ohartmann@walstatt.org>
MFC after: 1 month
X-MFC-With: r344779

5 years agoShow wiring state of map entries in procstat -v.
markj [Tue, 5 Mar 2019 19:45:37 +0000 (19:45 +0000)]
Show wiring state of map entries in procstat -v.

Note that only entries wired by userspace are shown as such.  In
particular, entries transiently wired by sysctl_wire_old_buffer() are
not flagged as wired in procstat -v output.

Reviewed by: kib (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19461

5 years agofreebsd-update.8: update example to contemporary versions
emaste [Tue, 5 Mar 2019 19:17:24 +0000 (19:17 +0000)]
freebsd-update.8: update example to contemporary versions

PR: 235761
Reported by: linimon
MFC after: 1 week

5 years agoRemove references to CONTIGMALLOC_WORKS in iflib and em
erj [Tue, 5 Mar 2019 19:12:51 +0000 (19:12 +0000)]
Remove references to CONTIGMALLOC_WORKS in iflib and em

From Jake:
"The iflib_fl_setup() function tries to pick various buffer sizes based
on the max_frame_size value defined by the parent driver. However, this
code was wrapped under CONTIGMALLOC_WORKS, which was never actually
defined anywhere.

This same code pattern was used in if_em.c, likely trying to match
what iflib uses.

Since CONTIGMALLOC_WORKS is not defined, remove this dead code from
iflib_fl_setup and if_em.c

Given that various iflib drivers appear to be using a similar
calculation, it might be worth making this buffer size a value that the
driver can peek at in the future."

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: shurd@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19199

5 years agolibllvm: promote WithColor and xxhash to SRCS_MIN
emaste [Tue, 5 Mar 2019 16:18:06 +0000 (16:18 +0000)]
libllvm: promote WithColor and xxhash to SRCS_MIN

The armv6 build failed in CI due to missing symbols (from these two
source files) in the bootstrap Clang.

This affected only armv6 because other Clang-using archs are using LLD
as the bootstrap linker, and thus include SRCS_MIW via LLD_BOOTSTRAP.

Reported by: CI, via lwhsu
Sponsored by: The FreeBSD Foundation

5 years agotun tests: Test renaming and destroying a tun interface in a vnet jail
kp [Tue, 5 Mar 2019 15:49:30 +0000 (15:49 +0000)]
tun tests: Test renaming and destroying a tun interface in a vnet jail

There was a problem destroying renamed tun interfaces in vnet jails. This was
fixed in r344794. Test the previously failing scenario.

PR: 235704
MFC after: 2 weeks

5 years agoremove the removed-from-source drm/drm2 parts
netchild [Tue, 5 Mar 2019 15:23:28 +0000 (15:23 +0000)]
remove the removed-from-source drm/drm2 parts

5 years agoFix typos in libusb.
hselasky [Tue, 5 Mar 2019 14:47:15 +0000 (14:47 +0000)]
Fix typos in libusb.

Found by: Denis Ahrens <denis@h3q.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agotun: VIMAGE fix for if_tun cloner
kp [Tue, 5 Mar 2019 13:21:07 +0000 (13:21 +0000)]
tun: VIMAGE fix for if_tun cloner

The if_tun cloner is not virtualised, but if_clone_attach() does use a
virtualised list of cloners.
The result is that we can't find the if_tun cloner when we try to remove
a renamed tun interface. Virtualise the cloner, and move the final
cleanup into a sysuninit so that we're sure this happens after all of
the vnet_sysuninits

Note that we need unit numbers to be system-unique (rather than unique
per vnet, as is done by if_clone_simple()). The unit number is used to
create the corresponding /dev/tunX device node, and this node must match
with the interface.
Switch to if_clone_advanced() so that we have control over the unit
numbers.

Reproduction scenario:
jail -c -n foo persist vnet
jexec test ifconfig tun create
jexec test ifconfig tun0 name wg0
jexec test ifconfig wg0 destroy

PR: 235704
Reviewed by: bz, hrs, hselasky
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19248

5 years agoFix binutils compilation error with Clang 8
jhibbits [Tue, 5 Mar 2019 04:16:50 +0000 (04:16 +0000)]
Fix binutils compilation error with Clang 8

Summary:
This change fixes the following compilation error when using clang 8 to cross
compile base to powerpc64:

```
/usr/src/gnu/usr.bin/binutils/libopcodes/../../../../contrib/binutils/opcodes/ppc-dis.c:100:35:
error: arithmetic on a null pointer treated as a cast from integer to pointer is
a GNU extension [-Werror,-Wnull-pointer-arithmetic]
  info->private_data = (char *) 0 + dialect;
       ~~~~~~~~~~ ^
1 error generated.
*** [ppc-dis.o] Error code 1

make[6]: stopped in /usr/src/gnu/usr.bin/binutils/libopcodes
1 error
```

Test Plan:
- buildworld for x86_64 (native)
- buildworld for powerpc64 (cross)
- buildworld for powerpc64 (native)

Submitted by: alfredo.junior_eldorado.org.br
Reviewed By: emaste, pfg, brooks
Differential Revision: https://reviews.freebsd.org/D19235

5 years agoRevert revision 254095
marcel [Tue, 5 Mar 2019 04:15:34 +0000 (04:15 +0000)]
Revert revision 254095

In revision 254095, gpt_entries is not set to match the on-disk
hdr_entries, but rather is computed based on available space.
There are 2 problems with this:

1.  The GPT backend respects hdr_entries and only reads and writes
    that number of partition entries.  On top of that, CRC32 is
    computed over the table that has hdr_entries elements.  When
    the common code works on what is possibly a larger number, the
    behaviour becomes inconsistent and problematic.  In particular,
    it would be possible to add a new partition that on a reboot
    isn't there anymore.
2.  The calculation of gpt_entries is based on flawed assumptions.
    The GPT specification does not dictate that sectors are layed
    out in a particular way that the available space can be
    determined by looking at LBAs.  In practice, implementations
    do the same thing, because there's no reason to do it any
    other way.  Still, GPT allows certain freedoms that can be
    exploited in some form or shape if the need arises.

PR: 229977
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19438

5 years agoFix grammar.
hrs [Tue, 5 Mar 2019 02:53:41 +0000 (02:53 +0000)]
Fix grammar.

Submitted by: Massimiliano Stucchi

5 years agoAllow for reproducible build
sjg [Mon, 4 Mar 2019 22:04:21 +0000 (22:04 +0000)]
Allow for reproducible build

Use SOURCE_DATE_EPOCH for BUILD_UTC if MK_REPRODUCIBLE_BUILD is yes.
Default SOURCE_DATE_EPOCH to 2019-01-01

Reviewed by: emaste
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D19464

5 years agobridge: Fix spurious warnings about capabilities
mav [Mon, 4 Mar 2019 22:01:09 +0000 (22:01 +0000)]
bridge: Fix spurious warnings about capabilities

Mask off the bits we don't care about when checking that capabilities
of the member interfaces have been disabled as intended.

Submitted by: Ryan Moeller <ryan@ixsystems.com>
Reviewed by: kristof, mav
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D18924

5 years agoAdd -d flag to load command
sjg [Mon, 4 Mar 2019 19:50:59 +0000 (19:50 +0000)]
Add -d flag to load command

When doing load -t manifest -d increments debug level

Reviewed by: stevek

5 years agoUpgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
dim [Mon, 4 Mar 2019 19:39:59 +0000 (19:39 +0000)]
Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
the upstream release_80 branch r355313 (effectively, 8.0.0 rc3).  The
release will follow very soon, but no more functional changes are
expected.

Release notes for llvm, clang and lld 8.0.0 will soon be available here:
<https://releases.llvm.org/8.0.0/docs/ReleaseNotes.html>
<https://releases.llvm.org/8.0.0/tools/clang/docs/ReleaseNotes.html>
<https://releases.llvm.org/8.0.0/tools/lld/docs/ReleaseNotes.html>

PR: 236062
Relnotes: yes
MFC after: 1 month

5 years agoSet tentative merge date, and bump __FreeBSD_version.
dim [Mon, 4 Mar 2019 19:23:11 +0000 (19:23 +0000)]
Set tentative merge date, and bump __FreeBSD_version.

5 years agoMerge ^/head r344549 through r344775.
dim [Mon, 4 Mar 2019 19:14:32 +0000 (19:14 +0000)]
Merge ^/head r344549 through r344775.

5 years agoMerge llvm, clang, compiler-rt, libc++, lld, and lldb release_80 branch
dim [Mon, 4 Mar 2019 19:06:51 +0000 (19:06 +0000)]
Merge llvm, clang, compiler-rt, libc++, lld, and lldb release_80 branch
r355313, resolve conflicts, and bump version numbers.

5 years agotests: Move common (vnet) test functions into a common file
kp [Mon, 4 Mar 2019 18:15:06 +0000 (18:15 +0000)]
tests: Move common (vnet) test functions into a common file

The netipsec and pf tests have a number of common test functions. These
used to be duplicated, but it makes more sense for them to re-use the
common functions.

PR: 236223

5 years agoDon't pass td to nfsvno_open().
trasz [Mon, 4 Mar 2019 14:50:00 +0000 (14:50 +0000)]
Don't pass td to nfsvno_open().

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoDon't pass td to nfsvno_createsub().
trasz [Mon, 4 Mar 2019 14:30:53 +0000 (14:30 +0000)]
Don't pass td to nfsvno_createsub().

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoAdd IBM TS1160 density codes to libmt and the mt(1) man page.
ken [Mon, 4 Mar 2019 14:30:37 +0000 (14:30 +0000)]
Add IBM TS1160 density codes to libmt and the mt(1) man page.

These are taken directly from the density report from a TS1160
tape drive.  (Using mt getdensity)

A TS1160 drive stores 20TB raw (60TB with compression) on a JE tape.

lib/libmt/mtlib.c:
Add 3592A6 encrypted/unencrypted density codes, and bpmm/bpi
values.

usr.bin/mt/mt.1:
Add 3592B5 encrypted/unencrypted density codes, bpmm/bpi
values and number of tracks.  Bump the man page date.

MFC after: 3 days
Sponsored by: Spectra Logic

5 years agoDon't pass td to nfsd_fhtovp(), it's unused.
trasz [Mon, 4 Mar 2019 13:18:04 +0000 (13:18 +0000)]
Don't pass td to nfsd_fhtovp(), it's unused.

Reviewed by: rmacklem (earlier version)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D19421

5 years agoPush down the thread argument in NFS server code, using curthread
trasz [Mon, 4 Mar 2019 13:12:23 +0000 (13:12 +0000)]
Push down the thread argument in NFS server code, using curthread
instead of passing it explicitly. No functional changes

Reviewed by: rmacklem (earlier version)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D19419

5 years agoPush down td in nfsrvd_dorpc() - make it use curthread instead
trasz [Mon, 4 Mar 2019 13:02:36 +0000 (13:02 +0000)]
Push down td in nfsrvd_dorpc() - make it use curthread instead
of it being explicitly passed as an argument. No functional changes.

The big picture here is that I want to get rid of the 'td' argument
being passed everywhere, and this is the first piece that affects
the NFS server.

Reviewed by: rmacklem
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D19417

5 years agoFix double free in case of mount error.
fsu [Mon, 4 Mar 2019 11:33:49 +0000 (11:33 +0000)]
Fix double free in case of mount error.

Reported by:    Christopher Krah <krah@protonmail.com>
Reported as:    FS-9-EXT3-2: Denial Of Service in nmount-5 (vm_fault_hold)
Reviewed by:    pfg
MFC after:      1 week

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

5 years agoDo not read the on-disk inode in case of vnode allocation.
fsu [Mon, 4 Mar 2019 11:27:47 +0000 (11:27 +0000)]
Do not read the on-disk inode in case of vnode allocation.

Reported by:    Christopher Krah <krah@protonmail.com>
Reported as:    FS-6-EXT2-4: Denial Of Service in mkdir-0 (ext2_mkdir/vn_rdwr)
Reviewed by:    pfg
MFC after:      1 week

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

5 years agoFix integer overflow possibility.
fsu [Mon, 4 Mar 2019 11:19:21 +0000 (11:19 +0000)]
Fix integer overflow possibility.

Reported by:    Christopher Krah <krah@protonmail.com>
Reported as:    FS-2-EXT2-1: Out-of-Bounds Write in nmount (ext2_vget)
Reviewed by:    pfg
MFC after:      1 week

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

5 years agoDo not panic if inode bitmap is corrupted.
fsu [Mon, 4 Mar 2019 11:12:19 +0000 (11:12 +0000)]
Do not panic if inode bitmap is corrupted.

admbug:         804
Reported by:    Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by:    pfg
MFC after:      1 week

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

5 years agoValidate block bitmaps.
fsu [Mon, 4 Mar 2019 11:01:23 +0000 (11:01 +0000)]
Validate block bitmaps.

Reviewed by:    pfg
MFC after:      1 week

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

5 years agoAdd additional on-disk inode checks.
fsu [Mon, 4 Mar 2019 10:55:01 +0000 (10:55 +0000)]
Add additional on-disk inode checks.

Reviewed by:    pfg
MFC after:      1 week

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

5 years agoMake superblock reading logic more strict.
fsu [Mon, 4 Mar 2019 10:42:25 +0000 (10:42 +0000)]
Make superblock reading logic more strict.

Add more on-disk superblock consistency checks to ext2_compute_sb_data() function.
It should decrease the probability of mounting filesystems with corrupted superblock data.

Reviewed by:    pfg
MFC after:      1 week

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

5 years ago[ath_hal_ar9300] Add the extra ANI configuration fields for the AR93xx HAL.
adrian [Mon, 4 Mar 2019 06:43:00 +0000 (06:43 +0000)]
[ath_hal_ar9300] Add the extra ANI configuration fields for the AR93xx HAL.

Tested:

* Carambola2 (Ar9331), STA/AP modes

5 years ago[ath_hal] add extra ANI fields for the AR9300 HAL.
adrian [Mon, 4 Mar 2019 06:42:06 +0000 (06:42 +0000)]
[ath_hal] add extra ANI fields for the AR9300 HAL.

I'm trying to debug why reception upstairs here is so terrible and it
turns out ANI is buggy.  (Which is no surprise, ANI is always buggy.)

Tested:

* Carambola2 (AR9331), STA/AP modes

5 years agoAllow to build ifconfig(8) without wireless support
avos [Mon, 4 Mar 2019 03:47:06 +0000 (03:47 +0000)]
Allow to build ifconfig(8) without wireless support

The change removes SIOC[GS]IEEE80211 handling from ifconfig(8)
if WITHOUT_WIRELESS_SUPPORT=yes is set in src.conf(5).

Reviewed by: bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19289

5 years agortwn_usb(4): fix Tx instability with RTL8192CU chipsets
avos [Mon, 4 Mar 2019 03:02:14 +0000 (03:02 +0000)]
rtwn_usb(4): fix Tx instability with RTL8192CU chipsets

- Fix data frames transmission via POWER_STATUS register setup -
it seems to be set by MACID_CONFIG firmware command, which was broken*
in r290439 and later disabled in r307529.

We can re-enable it later if / when firmware rate adaptation will be
ready; however, this step will be required anyway - for firmware-less
builds.

- Force RTS / CTS protection frame rate to CCK1 (this rate works fine
without any additional setup; no better workaround is known yet).

The problem was not observed on the channel 1 or with CCK1 rate enforced
('ifconfig wlan0 ucastrate 1' for 11 b/g; not possible for 11n networks
due to ifconfig(8) bug).

* I'm not sure if it works before r290439 because - AFAIR - I never seen
firmware rate adaptation working for 10-STABLE urtwn(4)
(It needs EN_BCN bit set and RSSI updates at least).

Tested with RTL8188CUS in STA mode
(in regular mode and with disabled MRR - DARFRC*8 is set to 0)

PR: 233949
MFC after: 2 weeks

5 years agortwn_usb(4): fix LED blinking for RTL8192CU during scanning
avos [Mon, 4 Mar 2019 01:54:28 +0000 (01:54 +0000)]
rtwn_usb(4): fix LED blinking for RTL8192CU during scanning

Tested with RTL8188CUS, STA mode.

MFC after: 5 days

5 years agoReduce CTL threads priority to about PUSER.
mav [Mon, 4 Mar 2019 00:49:07 +0000 (00:49 +0000)]
Reduce CTL threads priority to about PUSER.

Since in most configurations CTL serves as network service, we found
that this change improves local system interactivity under heavy load.
Priority of main threads is set slightly higher then worker taskqueues
to make them quickly sort incoming requests not creating bottlenecks,
while plenty of worker taskqueues should be less sensitive to latency.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

5 years agoAllocate an assocition id and register the stcb with holding the lock.
tuexen [Sun, 3 Mar 2019 19:55:06 +0000 (19:55 +0000)]
Allocate an assocition id and register the stcb with holding the lock.
This avoids a race where stcbs can be found, which are not completely
initialized.

This was found by running syzkaller.

MFC after: 3 days

5 years agoRemove bogus assert that I added in r319722. It is a legitimate case
glebius [Sun, 3 Mar 2019 18:57:48 +0000 (18:57 +0000)]
Remove bogus assert that I added in r319722. It is a legitimate case
to call soabort() on a newborn socket created by sonewconn() in case
if further setup of PCB failed. Code in sofree() handles such socket
correctly.

Submitted by: jtl, rrs
MFC after: 3 weeks

5 years agoFix compilation of world with WITHOUT_{INET,INET6}_SUPPORT or both set.
bz [Sun, 3 Mar 2019 10:00:26 +0000 (10:00 +0000)]
Fix compilation of world with WITHOUT_{INET,INET6}_SUPPORT or both set.

Buildworld failed when both WITHOUT_INET6_SUPPORT and INET equivalent were set.
Fix netstat and syslogd by applying appropriate #ifdef INET/INET6 to make world
compile again.

Reviewed by: ngie, hrs, ume
Welcomed by: Michael Dexter (D17040)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D19418

5 years agoUse struct addrinfo instead of struct sockaddr_storage
hrs [Sun, 3 Mar 2019 05:30:15 +0000 (05:30 +0000)]
Use struct addrinfo instead of struct sockaddr_storage
to store peer addresses.

5 years agoAdd ABORTED_BY_REQUEST to the list of things we look at DNR bit and tell why to comme...
imp [Sun, 3 Mar 2019 03:36:33 +0000 (03:36 +0000)]
Add ABORTED_BY_REQUEST to the list of things we look at DNR bit and tell why to comment (code already does this)

5 years agoAllow the sector size of the disk device to be configured using hints or
ian [Sat, 2 Mar 2019 23:20:47 +0000 (23:20 +0000)]
Allow the sector size of the disk device to be configured using hints or
FDT data.  The sector size must be a multiple of the device's page size.
If not configured, use the historical default of the device page size.

Setting the disk sector size to 512 or 4096 allows a variety of standard
filesystems to be used on the device.  Of course you wouldn't want to be
writing frequently to a SPI flash chip like it was a disk drive, but for
data that gets written once (or rarely) and read often, using a standard
filesystem is a nice convenient thing.

5 years agoAdd some comments. Give #define'd names to some scattered numbers. Change
ian [Sat, 2 Mar 2019 22:28:43 +0000 (22:28 +0000)]
Add some comments.  Give #define'd names to some scattered numbers.  Change
some #define'd names to be more descriptive.  When reporting a post-write
compare failure, report the page number, not the byte address of the page.
The latter is the only functional change, it makes the number match the
words of the error message.

5 years agoProperly calculate the last used logical block of a file when checking
mckusick [Sat, 2 Mar 2019 21:30:01 +0000 (21:30 +0000)]
Properly calculate the last used logical block of a file when checking
inodes that reference directories. While here tighten the check for
comparing the last logical block with the end of the file.

Reported by:  Peter Holm
Tested by:    Peter Holm
Sponsored by: Netflix

5 years agoThe size of the UFS soft-updates journal must be a multiple of the
mckusick [Sat, 2 Mar 2019 21:22:56 +0000 (21:22 +0000)]
The size of the UFS soft-updates journal must be a multiple of the
filesystem block size. When a size is specified with the -S flag
to tunefs(8), round it up to the filesystem block size.

Reported by:  Peter Holm
Tested by:    Peter Holm
Sponsored by: Netflix

5 years agopowerpc: fix 'show spr' for ELFv1 powerpc64
jhibbits [Sat, 2 Mar 2019 21:11:46 +0000 (21:11 +0000)]
powerpc: fix 'show spr' for ELFv1 powerpc64

Update and flush the right cache range for the ELFv1 ABI.

MFC after: 1 week

5 years agopowerpc/booke: Depessimize MAS register updates even more
jhibbits [Sat, 2 Mar 2019 20:59:18 +0000 (20:59 +0000)]
powerpc/booke: Depessimize MAS register updates even more

Remove isyncs between MAS register updates in the TLB miss handler, since
it's only needed before the TLB update instructions.

5 years agoBugfix: use a dummy buffer for the inactive side of a transfer.
ian [Sat, 2 Mar 2019 20:58:51 +0000 (20:58 +0000)]
Bugfix: use a dummy buffer for the inactive side of a transfer.

This is especially important for writes.  SPI is inherently a bidirectional
bus; you receive data (even if it's garbage) while writing.  We should not
receive that data into the same buffer we're writing to the device.

When reading it doesn't matter what we send to the device, but using the
dummy buffer for that as well is pleasingly symmetrical.

5 years agoRemove debug output.
tuexen [Sat, 2 Mar 2019 16:10:11 +0000 (16:10 +0000)]
Remove debug output.

MFC after: 3 days

5 years agoAllow SCTP stream reconfiguration operations only in ESTABLISHED
tuexen [Sat, 2 Mar 2019 14:30:27 +0000 (14:30 +0000)]
Allow SCTP stream reconfiguration operations only in ESTABLISHED
state.

This issue was found by running syzkaller.

MFC after: 3 days

5 years agoHandle the case when calling the IPPROTO_SCTP level socket option
tuexen [Sat, 2 Mar 2019 14:15:33 +0000 (14:15 +0000)]
Handle the case when calling the IPPROTO_SCTP level socket option
SCTP_STATUS on an association with no primary path (early state).

This issue was found by running syzkaller.

MFC after: 3 days

5 years agoUse correct buffer sizes in sctp_get[lp]addrs().
tuexen [Sat, 2 Mar 2019 13:16:01 +0000 (13:16 +0000)]
Use correct buffer sizes in sctp_get[lp]addrs().

MFC after: 3 days

5 years agoReport the correct length when using the IPPROTO_SCTP level
tuexen [Sat, 2 Mar 2019 13:12:37 +0000 (13:12 +0000)]
Report the correct length when using the IPPROTO_SCTP level
socket options SCTP_GET_PEER_ADDRESSES and SCTP_GET_LOCAL_ADDRESSES.