]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r344692:
Kristof Provost [Tue, 5 Mar 2019 08:45:07 +0000 (08:45 +0000)]
MFC r344692:

pf tests: Test CVE-2019-5597

Generate a fragmented packet with different header chains, to provoke
the incorrect behaviour of pf.
Without the fix this will trigger a panic.

Obtained from: Corentin Bayet, Nicolas Collignon, Luca Moro at Synacktiv

5 years agoMFC r344561:
Jason A. Harmening [Tue, 5 Mar 2019 08:33:14 +0000 (08:33 +0000)]
MFC r344561:

Fix incorrect assertion in vnode_pager_generic_getpages()

5 years agoMFC r344666:
Bryan Drewery [Mon, 4 Mar 2019 21:10:40 +0000 (21:10 +0000)]
MFC r344666:

  bsd.nls.mk isn't optional.

PR: 232527

5 years agoMFC r344245:
Andriy Voskoboinyk [Mon, 4 Mar 2019 03:38:43 +0000 (03:38 +0000)]
MFC r344245:
snmp_hostres(3): fix a typo in sanity checks in handle_chunk()

PR: 204253
Submitted by: David Binderman <dcb314@hotmail.com>

5 years agoMFC r344244:
Andriy Voskoboinyk [Mon, 4 Mar 2019 03:30:39 +0000 (03:30 +0000)]
MFC r344244:
Fix memory / resource leaks in usr.sbin/rpc.ypupdated/update.c

Re-apply r343909 to this file to get the issue fixed.

PR: 204956
Reported by: David Binderman <dcb314@hotmail.com>

5 years agoMFC r344491: An IPv6 address matching should be fixed.
Hajimu UMEMOTO [Sun, 3 Mar 2019 03:40:11 +0000 (03:40 +0000)]
MFC r344491: An IPv6 address matching should be fixed.
Specifying an IPv6 address by the -a option was broken
since r309933.

5 years agoMFC r344480: Remove disabled CTL_LEGACY_STATS support.
Alexander Motin [Sat, 2 Mar 2019 03:17:23 +0000 (03:17 +0000)]
MFC r344480: Remove disabled CTL_LEGACY_STATS support.

It was not only disabled for quite a while, but also appeared to be broken
at r325517, when maximum number of ports was made configurable.

5 years agoMFC r343978:
Kristof Provost [Fri, 1 Mar 2019 22:33:24 +0000 (22:33 +0000)]
MFC r343978:

pfctl: Fix ifa_grouplookup()

Setting the length of the request got lost in r343287, which means SIOCGIFGMEMB
gives us the required length, but does not copy the names of the group members.
As a result we don't get a correct list of group members, and 'set skip on
<ifgroup>' broke.

This produced all sorts of very unexpected results, because we would end up
applying 'set skip' to unexpected interfaces.

5 years agoMFC r344691:
Kristof Provost [Fri, 1 Mar 2019 18:12:05 +0000 (18:12 +0000)]
MFC r344691:

pf: IPv6 fragments with malformed extension headers could be erroneously passed by pf or cause a panic

We mistakenly used the extoff value from the last packet to patch the
next_header field. If a malicious host sends a chain of fragmented packets
where the first packet and the final packet have different lengths or number of
extension headers we'd patch the next_header at the wrong offset.
This can potentially lead to panics or rule bypasses.

Reported by: Corentin Bayet, Nicolas Collignon, Luca Moro at Synacktiv
Approved by: so
Obtained from: OpenBSD
Security: CVE-2019-5597

5 years agoMFC r344592:
Konstantin Belousov [Fri, 1 Mar 2019 11:29:18 +0000 (11:29 +0000)]
MFC r344592:
procctl(2): fix -width parameter to .Bl.

5 years agoMFC r344477:
Hans Petter Selasky [Fri, 1 Mar 2019 08:04:17 +0000 (08:04 +0000)]
MFC r344477:
Add new USB quirk.

PR: 235897
Sponsored by: Mellanox Technologies

5 years agoMFC r343118: new small tool trim(1) to delete contents for blocks
Eugene Grosbein [Fri, 1 Mar 2019 05:02:09 +0000 (05:02 +0000)]
MFC r343118: new small tool trim(1) to delete contents for blocks
on flash based storage devices that use wear-leveling algorithms.

5 years agoMFC r344474-r344476
Ben Widawsky [Fri, 1 Mar 2019 02:16:37 +0000 (02:16 +0000)]
MFC r344474-r344476

r344474:
nvdimm: split spa dev into a separate entity

Separate code for exposing a device backed by a system physical
address range away from the NVDIMM spa code. This will allow a
future patch to add support for NVDIMM namespaces while using the
same device code.

Submitted by: D Scott Phillips <d.scott.phillips@intel.com>
Reviewed by: bwidawsk
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D18736

r344475:
nvdimm: Read NVDIMM namespace labels

When attaching to NVDIMM devices, read and verify the namespace
labels from the special namespace label storage area. A later
change will expose NVDIMM namespaces derived from this label data.

Submitted by: D Scott Phillips <d.scott.phillips@intel.com>
Discussed with: kib
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D18735

r344476:
nvdimm: Simple namespace support

Add support for simple NVDIMM v1.2 namespaces from the UEFI
version 2.7 specification. The combination of NVDIMM regions and
labels can lead to a wide variety of namespace layouts. Here we
support a simple subset of namespaces where each NVDIMM SPA range
is composed of a single region per member dimm.

Submitted by: D Scott Phillips <d.scott.phillips@intel.com>
Discussed with: kib
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D18736

5 years agoMFC r344063,r344088:
Martin Matuska [Thu, 28 Feb 2019 22:55:44 +0000 (22:55 +0000)]
MFC r344063,r344088:

MFC r344063:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1085: Fix a null pointer dereference bug in zip writer
  PR #1110: ZIP reader added support for XZ, LZMA, PPMD8 and BZIP2
            decopmpression
  PR #1116: Add support for 64-bit ar format
  PR #1120: Fix a 7zip crash [1] and a ISO9660 infinite loop [2]
  PR #1125: RAR5 reader - fix an invalid read and a memory leak
  PR #1131: POSIX reader - do not fail when tree_current_lstat() fails
            due to ENOENT [3]
  PR #1134: Delete unnecessary null pointer checks before calls of free()
  OSS-Fuzz 10843: Force intermediate to uint64_t to make UBSAN happy.
  OSS-Fuzz 11011: Avoid buffer overflow in rar5 reader

MFC r344088:
  archive_read_disk_posix.c: initialize delayed_errno

PR: 233006 [3]
Security: CVE-2019-1000019 [1], CVE-2019-1000020 [2]

5 years agoMFC r343877,r343880:
Bryan Drewery [Thu, 28 Feb 2019 20:57:36 +0000 (20:57 +0000)]
MFC r343877,r343880:

  r343877:
    ipfw table list: Fix showing header outside of 'all'.
  r343880:
    Fix build of r343877

Relnotes: yes

5 years agoMFC r344510
Vincenzo Maffione [Thu, 28 Feb 2019 09:40:26 +0000 (09:40 +0000)]
MFC r344510

netmap: remove redundant call to nm_set_native_flags()

This redundant call was introduced by mistake in r343772.

Sponsored by:   Sunny Valley Networks

5 years agoMFC r344444:
Dimitry Andric [Thu, 28 Feb 2019 06:53:18 +0000 (06:53 +0000)]
MFC r344444:

Pull in r353299 from upstream lld trunk (by George Rimar):

  Recommit r353293 "[LLD][ELF] - Set DF_STATIC_TLS flag for i386 target."

  With the following changes:
  1) Compilation fix:
  std::atomic<bool> HasStaticTlsModel = false; ->
  std::atomic<bool> HasStaticTlsModel{false};

  2) Adjusted the comment in code.

  Initial commit message:

  DF_STATIC_TLS flag indicates that the shared object or executable
  contains code using a static thread-local storage scheme.

  Patch checks if IE/LE relocations were used to check if the code uses
  a static model. If so it sets the DF_STATIC_TLS flag.

  Differential revision: https://reviews.llvm.org/D57749

Pull in r353378 from upstream lld trunk (by George Rimar):

  [LLD][ELF] - Set DF_STATIC_TLS flag for X64 target

  This is the same as D57749, but for x64 target.

  "ELF Handling For Thread-Local Storage" p41 says
  (https://www.akkadia.org/drepper/tls.pdf):
  R_X86_64_GOTTPOFF relocation is used for IE TLS models.
  Hence if linker sees this relocation we should add DF_STATIC_TLS flag.

  Differential revision: https://reviews.llvm.org/D57821

This adds support to lld for the DF_STATIC_TLS flag in shared objects,
which signals to the dynamic linker that the shared object requires
static thread local storage.

See also: https://reviews.freebsd.org/D19072

5 years agoMFC r344437: Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB.
Alexander Motin [Thu, 28 Feb 2019 00:30:13 +0000 (00:30 +0000)]
MFC r344437: Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB.

Its a hack, we can't know/list all DMA engines, but this covers all
I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw.

5 years agoMFC r344441: Fix few issues in ioat(4) driver.
Alexander Motin [Thu, 28 Feb 2019 00:28:44 +0000 (00:28 +0000)]
MFC r344441: Fix few issues in ioat(4) driver.

 - Do not explicitly count active descriptors.  It allows hardware reset
to happen while device is still referenced, plus simplifies locking.
 - Do not stop/start callout each time the queue becomes empty.  Let it
run to completion and rearm if needed, that is much cheaper then to touch
it every time, plus also simplifies locking.
 - Decouple submit and cleanup locks, making driver reentrant.
 - Avoid memory mapped status register read on every interrupt.
 - Improve locking during device attach/detach.
 - Remove some no longer used variables.

Sponsored by: iXsystems, Inc.

5 years agoMFC r344473:
David Bright [Wed, 27 Feb 2019 22:29:12 +0000 (22:29 +0000)]
MFC r344473:

CID 1332000: Logically dead code in sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c

A pointer is first tested for NULL. If non-NULL, another pointer is
set equal to the first. The second pointer is then checked for NULL
and an error path taken if so. This second test and the associated
path is dead code as the pointer value, having just been checked for
NULL, cannot be NULL at this point. Remove the dead code.

Sponsored by: Dell EMC Isilon

5 years agoMFC r344381:
Dimitry Andric [Wed, 27 Feb 2019 22:12:04 +0000 (22:12 +0000)]
MFC r344381:

Fix more AddressSanitizer violations in usr.bin/top

In line_update(), set lastcol correctly after moving to any non-zero
column, so the "overwrite old stuff" part does not attempt to address
negative offsets in the current line.

Rewrite setup_buffer() to always allocate at least 80 characters,
otherwise various calls to summary_format() will overwrite the end of
the buffers, if the screen width gets small enough.

5 years agoMFC r344503:
Dimitry Andric [Wed, 27 Feb 2019 22:02:46 +0000 (22:02 +0000)]
MFC r344503:

Pull in r354756 from upstream llvm trunk (by Craig Topper):

  [X86] Fix tls variable lowering issue with large code model

  Summary:
  The problem here is the lowering for tls variable. Below is the DAG
  for the code. SelectionDAG has 11 nodes:

  t0: ch = EntryToken
t8: i64,ch = load<(load 8 from `i8 addrspace(257)* null`,
addrspace 257)> t0, Constant:i64<0>, undef:i64
  t10: i64 = X86ISD::WrapperRIP TargetGlobalTLSAddress:i64<i32*
  @x> 0 [TF=10]
t11: i64,ch = load<(load 8 from got)> t0, t10, undef:i64
      t12: i64 = add t8, t11
    t4: i32,ch = load<(dereferenceable load 4 from @x)> t0, t12,
    undef:i64
  t6: ch = CopyToReg t0, Register:i32 %0, t4

  And when mcmodel is large, below instruction can NOT be folded.

    t10: i64 = X86ISD::WrapperRIP TargetGlobalTLSAddress:i64<i32* @x> 0
    [TF=10]
  t11: i64,ch = load<(load 8 from got)> t0, t10, undef:i64

  So "t11: i64,ch = load<(load 8 from got)> t0, t10, undef:i64" is
  lowered to " Morphed node: t11: i64,ch = MOV64rm<Mem:(load 8 from
  got)> t10, TargetConstant:i8<1>, Register:i64 $noreg,
  TargetConstant:i32<0>, Register:i32 $noreg, t0"

  When llvm start to lower "t10: i64 = X86ISD::WrapperRIP
  TargetGlobalTLSAddress:i64<i32* @x> 0 [TF=10]", it fails.

  The patch is to fold the load and X86ISD::WrapperRIP.

  Fixes PR26906

  Patch by LuoYuanke

  Reviewers: craig.topper, rnk, annita.zhang, wxiao3

  Reviewed By: rnk

  Subscribers: llvm-commits

  Tags: #llvm

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

This should fix "fatal error: error in backend: Cannot select" messages
when compiling <ctype.h> functions using -mcmodel=large.

Reported by: phk
PR: 233143

5 years agoMFC r344218: mdmfs(8): use -o reserve with malloc-backed md(4)
Kyle Evans [Wed, 27 Feb 2019 17:00:14 +0000 (17:00 +0000)]
MFC r344218: mdmfs(8): use -o reserve with malloc-backed md(4)

Mentioned in mdconfig(8), malloc-backed md(4) can be unstable unless
required memory is allocated up front with -o reserve. Furthermore, panics
have been observed with md used in fstab on 12.0-RELEASE. Choose the stable
route and pass -o reserve.

5 years agoMFC: r344602
Jung-uk Kim [Tue, 26 Feb 2019 19:34:42 +0000 (19:34 +0000)]
MFC: r344602

Merge OpenSSL 1.1.1b.

5 years agoMFC r344305, r344365:
Mark Johnston [Tue, 26 Feb 2019 15:03:59 +0000 (15:03 +0000)]
MFC r344305, r344365:
Impose a limit on the number of GEOM_CTL arguments.

admbug: 854

5 years agoMFC r344307:
Mark Johnston [Tue, 26 Feb 2019 14:56:01 +0000 (14:56 +0000)]
MFC r344307:
Limit the number of entries allocated for a REPORT_ZONES command.

5 years agoMerge ENA OOO RX fixes
Marcin Wojtas [Tue, 26 Feb 2019 12:22:53 +0000 (12:22 +0000)]
Merge ENA OOO RX fixes

MFC r344150-r344151

Obtained from: Semihalf
Sponsored by: Amazon, Inc.

5 years agoMFC r344256:
Konstantin Belousov [Tue, 26 Feb 2019 09:51:53 +0000 (09:51 +0000)]
MFC r344256:
amd64: cleanup pmap_init_pat().

5 years agoMFC r344315:
Colin Percival [Tue, 26 Feb 2019 01:29:40 +0000 (01:29 +0000)]
MFC r344315:
  Fix sed script to insert Amazon NTP server into ntp.conf once rather
  than twice.

5 years agoMFC r344369:
Mark Johnston [Mon, 25 Feb 2019 15:51:31 +0000 (15:51 +0000)]
MFC r344369:
Remove an obsolete comment.

5 years agoMFC r344232:
Mark Johnston [Mon, 25 Feb 2019 15:50:59 +0000 (15:50 +0000)]
MFC r344232:
Fix refcount leaks in the SGX Linux compat ioctl handler.

5 years agoMFC r344231, r344440:
Mark Johnston [Mon, 25 Feb 2019 15:50:28 +0000 (15:50 +0000)]
MFC r344231, r344440:
Remove a redundant flag variable.

5 years agoMFC r344428:
Michael Tuexen [Mon, 25 Feb 2019 12:35:52 +0000 (12:35 +0000)]
MFC r344428:

This patch addresses an issue brought up by bz@ in D18968:
When TCP_REASS_LOGGING is defined, a NULL pointer dereference would happen,
if user data was received during the TCP handshake and BB logging is used.

A KASSERT is also added to detect tcp_reass() calls with illegal parameter
combinations.

Reported by: bz@
Reviewed by: rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D19254

5 years agoMFC r343439:
Michael Tuexen [Mon, 25 Feb 2019 12:33:11 +0000 (12:33 +0000)]
MFC r343439:

Don't include two header files when not needed.

This allows the part of the rewrite of TCP reassembly in this
files to be MFCed to stable/11 with manual change.

Sponsored by: Netflix, Inc.

5 years agoMFC r343920:
Michael Tuexen [Mon, 25 Feb 2019 12:25:44 +0000 (12:25 +0000)]
MFC r343920:

Ensure that when using the TCP CDG congestion control and setting the
sysctl variable net.inet.tcp.cc.cdg.smoothing_factor to 0, the smoothing
is disabled. Without this patch, a division by zero orrurs.

PR: 193762
Reviewed by: lstewart@, rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D19071

5 years agoMFC r344253
Vincenzo Maffione [Mon, 25 Feb 2019 08:50:25 +0000 (08:50 +0000)]
MFC r344253

netmap: don't schedule kqueue notify task when kqueue is not used

This change adds a counter (kqueue_users) to keep track of how many
kqueue users are referencing a given struct nm_selinfo.
In this way, nm_os_selwakeup() can schedule the kevent notification
task only when kqueue is actually being used.
This is important to avoid wasting CPU in the common case where
kqueue is not used.

Reviewed by:    Aleksandr Fedorov <aleksandr.fedorov@itglobal.com>
Differential Revision:  https://reviews.freebsd.org/D19177

5 years agoMFC r343924:
Justin Hibbits [Sun, 24 Feb 2019 20:51:47 +0000 (20:51 +0000)]
MFC r343924:

Correct the CPU target for powerpcspe

The MPC8540 is actually e500v1, which doesn't have double-precision floating
point support.  The 8548 does, so use that as the CPU target.

5 years agoMFC r343763, r343944, r343946
Justin Hibbits [Sun, 24 Feb 2019 20:49:16 +0000 (20:49 +0000)]
MFC r343763, r343944, r343946

r343763: powerpc: Don't idle with the wait instruction on booke
r343944: powerpc: Split out the e500mc idling from rest of Book-E
r343946: powerpc: Fix AIM build

5 years agoMFC r342811, r343168-r343169
Justin Hibbits [Sun, 24 Feb 2019 20:29:11 +0000 (20:29 +0000)]
MFC r342811, r343168-r343169

r342811:
dtsec: Fix formatting of addresses in translation error messages

Don't clamp addresses to 8 hex digits, particularly since this is primarily
used now on a 64-bit platform.

r343168:
powerpc/dpaa: Handle DMAP virtual addresses in DPAA

sendfile(2) appears to now use DMAP wherever possible.  These addresses are not
managed by pmap, so pmap_kextract() returns a 0 physical address, causing
failure.

This change fixes nginx running on P5020 SoC.

r343169:
dpaa: fix 32-bit build

Book-E powerpc uses 64-bit vm_paddr_t, and 32-bit powerpc has 32-bit pointers,
so gcc errors with cast to pointer from integer of different size.  As this will
not actually be used in reality anyway, simply quiet the warning by casting
through uintptr_t.

5 years agoMFC r343078:
Justin Hibbits [Sun, 24 Feb 2019 20:15:16 +0000 (20:15 +0000)]
MFC r343078:

powerpc: Fix FPU fsqrt emulation special case results

If fsqrts is emulated with +INF as its argument, the 0 return value causes a
NULL pointer dereference, panicking the system.  Follow the PowerISA and
return +INF with no FP exception.

5 years agoMFC r339707: Allow fdisk(8) to deal with sectors larger than 2048
Rodney W. Grimes [Sun, 24 Feb 2019 01:56:35 +0000 (01:56 +0000)]
MFC r339707: Allow fdisk(8) to deal with sectors larger than 2048
especially for 4Kn drives with PMBR's

Approved by: bde (mentor, implicit)

5 years agoMFC r344386:
Dimitry Andric [Sat, 23 Feb 2019 14:27:09 +0000 (14:27 +0000)]
MFC r344386:

Pull in r354515 from upstream libc++ trunk:

  Fix the build with gcc when `-Wredundant-decls` is passed

  Summary:

  gcc warns that `__throw_runtime_error` is declared both in
  `<__locale>` and `<stdexcept>`, if `-Wredundant-decls` is passed on
  the command line; this is the case with FreeBSD when ${WARNS} == 6.

  Since `<__locale>` gets its first declaration via a transitive
  include of `<stdexcept>`, and the second declaration is after the
  first invocation of `__throw_runtime_error`, delete that second
  declaration.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
  Reviewers: kristina, MaskRay, EricWF, ldionne, ngie

  Reviewed By: EricWF

  Subscribers: krytarowski, brooks, emaste, dim, christof, jdoerfert, libcxx-commits

  Tags: #libc

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

Submitted by: ngie

5 years agoMFC r344162:
Stephen Hurd [Fri, 22 Feb 2019 18:02:46 +0000 (18:02 +0000)]
MFC r344162:

iflib: Improve return values of interrupt handlers.

iflib was returning FILTER_HANDLED, in cases where FILTER_STRAY was more
correct. This potentially caused issues with shared legacy interrupts.

Driver filters returning FILTER_STRAY are now properly handled.

Submitted by: Augustin Cavalier <waddlesplash@gmail.com>
Reviewed by: marius, gallatin
Obtained from: Haiku (a84bb9, 4947d1)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D19201

5 years agoMFC r344303:
Konstantin Belousov [Fri, 22 Feb 2019 12:27:25 +0000 (12:27 +0000)]
MFC r344303:
Minor cleanup for mkuzip(8) man page.

5 years agoMFC r344296:
Konstantin Belousov [Fri, 22 Feb 2019 12:26:28 +0000 (12:26 +0000)]
MFC r344296:
Provide convenience C wrappers for RDPKRU and WRPKRU instructions.

5 years agoMFC r344293:
Konstantin Belousov [Fri, 22 Feb 2019 12:12:01 +0000 (12:12 +0000)]
MFC r344293:
Add definition for %cr4 PKRU enable bit.

5 years agoRevert r344436, which was the merge of r344120.
Konstantin Belousov [Fri, 22 Feb 2019 10:06:34 +0000 (10:06 +0000)]
Revert r344436, which was the merge of r344120.

Currently stable/12 i386 installs old ld.bfd as ld (WITHOUT_LLD_IS_LD),
which prevents ifunc relocations from working properly.  If a static
binary is linked, then it looses libc relocations needed.

The stable i386 branch uses ld.lld for the world build (WITH_LLD_BOOTSTRAP),
which is why static binaries from the base do not have the issue.

Reported and diagnosted by: antoine

5 years agoMFC r344214:
Andriy Voskoboinyk [Fri, 22 Feb 2019 08:04:50 +0000 (08:04 +0000)]
MFC r344214:
Refresh OptionalObsoleteFiles.inc for MK_PMC:

- Add missing /usr/sbin/pmc, pmcformat.h, libpmcstat.h and pmc.haswellxeon.3
to the list.
- Correct man page section for pmcstudy.8.
- Include recently added libipt and libopencsd for corresponding TARGET_ARCH

5 years agoMFC r344201:
Andriy Voskoboinyk [Thu, 21 Feb 2019 23:53:52 +0000 (23:53 +0000)]
MFC r344201:
Remove vi(1)-related files via 'make delete-old' when WITHOUT_VI=1 is set.

5 years agoMFC r344120:
Konstantin Belousov [Thu, 21 Feb 2019 12:13:27 +0000 (12:13 +0000)]
MFC r344120:
Unify i386 and amd64 getcontextx.c, and use ifuncs while there.

5 years agoMFC r344119:
Konstantin Belousov [Thu, 21 Feb 2019 12:10:56 +0000 (12:10 +0000)]
MFC r344119:
x86 __vdso_gettc(): use machine/cpufunc.h function for CPUID.

5 years agoMFC r344118:
Konstantin Belousov [Thu, 21 Feb 2019 12:09:04 +0000 (12:09 +0000)]
MFC r344118:
Provide userspace versions of do_cpuid() and cpuid_count() on i386.

5 years agoMFC r344198:
Andriy Voskoboinyk [Thu, 21 Feb 2019 09:54:10 +0000 (09:54 +0000)]
MFC r344198:
GC ATA_REQUEST_TIMEOUT option remnants

It was removed from code in r249083 and from sys/conf/options in r249213.

PR: 193935, 222170

5 years agoMFC r344264:
Dimitry Andric [Thu, 21 Feb 2019 07:22:05 +0000 (07:22 +0000)]
MFC r344264:

Add one additional file to libllvmminimal, since in some cases (e.g.
upgrading from stable/10 to stable/11) symbols from it are needed to
link llvm-tblgen and clang-tblgen.

Reported by: kib

5 years agoMFC r344261:
Dimitry Andric [Thu, 21 Feb 2019 07:20:17 +0000 (07:20 +0000)]
MFC r344261:

Pull in r345199 from upstream libc++ trunk (by Petr Hosek):

  Revert "Teach __libcpp_is_floating_point that __fp16 and _Float16 are
  floating-point types."

  This reverts commits r333103 and r333108. _Float16 and __fp16 are C11
  extensions and compilers other than Clang don't define these for C++.

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

This prevents "_Float16 is not supported on this target" errors in
libc++'s type_traits header, in some cases.

Reported by: Charlie Li

5 years agoMFC r343827:
Jason A. Harmening [Thu, 21 Feb 2019 06:40:15 +0000 (06:40 +0000)]
MFC r343827:

r342089 changed cap_syslog(3) to preserve the stdio descriptors inherited
from its parent so that LOG_PERROR would work.  However, this caused
dhclient(8)'s stdio streams to remain open across daemonization, breaking
the ability to capture its foreground output as done in netconfig_ipv4.

Fix this by reverting r341692 and instead passing the parent's stderr
descriptor as an argument to cap_openlog() only when LOG_PERROR is specified
in logopt.

PR: 234514

5 years agoMFC r343125 (by cem): ioat(4): Set __result_use_check on ioat_acquire_reserve
Alexander Motin [Thu, 21 Feb 2019 00:17:24 +0000 (00:17 +0000)]
MFC r343125 (by cem): ioat(4): Set __result_use_check on ioat_acquire_reserve

Even M_WAITOK callers must check for failure.  For example, if the device is
quiescing, either due to automatic error-recovery induced reset, or due to
administrative detach, the routine will return ENXIO and the acquire
reference will not be held.  So, there is no mode in which it is safe to
assume the routine succeeds without checking.

5 years agoMFC r344024:
David Bright [Wed, 20 Feb 2019 22:48:38 +0000 (22:48 +0000)]
MFC r344024:

CID 1009492: Logically dead code in sys/cam/scsi/scsi_xpt.c

In `probedone()`, for the `PROBE_REPORT_LUNS` case, all paths that
fall to the bottom of the case set `lp` to `NULL`, so the test for a
non-NULL value of `lp` and call to `free()` if true is dead code as
the test can never be true. Fix by eliminating the whole if
statement. To guard against a possible future change that accidentally
violates this assumption, use a `KASSERT()` to catch if `lp` is
non-NULL.

Sponsored by: Dell EMC Isilon

5 years agoMFC r343165 (by jhibbits):
Dimitry Andric [Wed, 20 Feb 2019 20:28:48 +0000 (20:28 +0000)]
MFC r343165 (by jhibbits):

Fix top(1) long options handling

getopt_long(3) requires the long options be terminated by a NULL block.
Without the terminator, an invalid long option results in a segmentation
fault.

Reported by: Brandon Bergren

MFC r343957:

Fix multiple warnings in usr.bin/top about discarded qualifiers from
both clang and gcc, by either constifying variables, or when that is not
possible, using __DECONST.

MFC r343958:

Fix multiple warnings in usr.bin/top about variables shadowing global
declarations from base gcc, by renaming those variables.

MFC r343959:

Fix the first couple of AddressSanitizer violations in usr.bin/top.

Avoid setting zero bytes beyond the length of the 'thisline' parameters
in i_process() and u_process(), and don't attempt to memset a negative
number of bytes.

5 years agoMFC r344042:
Pedro F. Giffuni [Wed, 20 Feb 2019 14:10:46 +0000 (14:10 +0000)]
MFC r344042:
UMA: unsign some variables related to allocation in hash_alloc().

As a followup to r343673, unsign some variables related to allocation
since the hashsize cannot be negative. This gives a bit more space to
handle bigger allocations and avoid some implicit casting.

While here also unsign uh_hashmask, it makes little sense to keep it
signed.

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

5 years agoMFC r343967:
Sergey Kandaurov [Wed, 20 Feb 2019 11:58:40 +0000 (11:58 +0000)]
MFC r343967:
Sync "struct addrinfo" declaration with netdb.h.

PR: 225880

5 years agoMFC r343945:
Sergey Kandaurov [Wed, 20 Feb 2019 11:56:30 +0000 (11:56 +0000)]
MFC r343945:
Document the ENOBUFS errno in setsockopt(2).

PR: 200649

5 years agoMFC r344103:
Andrey V. Elsukov [Wed, 20 Feb 2019 10:22:48 +0000 (10:22 +0000)]
MFC r344103:
  In r335015 PCB destroing was made deferred using epoch_call().

  But ipsec_delete_pcbpolicy() uses some VNET-virtualized variables,
  and thus it needs VNET context, that is missing during gtaskqueue
  executing. Use inp_vnet context to set curvnet in in_pcbfree_deferred().

  PR: 235684

5 years agoMFC r344061:
Kristof Provost [Tue, 19 Feb 2019 18:22:55 +0000 (18:22 +0000)]
MFC r344061:

garp: Fix vnet related panic for gratuitous arp

Gratuitous ARP packets are sent from a timer, which means we don't have a vnet
context set. As a result we panic trying to send the packet.

Set the vnet context based on the interface associated with the interface
address.

To reproduce:
sysctl net.link.ether.inet.garp_rexmit_count=2
ifconfig vtnet1 10.0.0.1/24 up

PR: 235699
Reviewed by: vangyzen@

5 years agoMFC r342114:
Edward Tomasz Napierala [Tue, 19 Feb 2019 10:28:59 +0000 (10:28 +0000)]
MFC r342114:

Add kern.rpc.gss.client_max, to make it possible to bump it easily.
This can drastically lower the load on gssd(8) on large NFS servers.

5 years agoMFC r344043:
Ben Widawsky [Tue, 19 Feb 2019 02:26:47 +0000 (02:26 +0000)]
MFC r344043:

termcap: Add an entry for kitty

The project is here:
https://github.com/kovidgoyal/kitty/

I created a port (which now needs updating):
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233010

If only we could use terminfo :(

Approved by:    bapt
Differential Revision: https://reviews.freebsd.org/D19060

5 years agoMFC r344023:
Brooks Davis [Mon, 18 Feb 2019 18:44:20 +0000 (18:44 +0000)]
MFC r344023:

mdmfs: Fix many bugs in automatic md(4) creation.

This code allocated a correctly sized buffer, read past the end of the
source buffer, writing off the end of the target buffer, and then writing
a '\0' terminator past the end of the target buffer (in the wrong place).
It then leaked the buffer.

Switch to a statically sized buffer on the stack and update the source
pointer and length before use so the correct things are copied.

Fix a logic error in the checks that the format of the line is as
expected and move on out of an assert.

Remove an unneeded close(). fclose() closes the descriptor.

Found with: CheriABI
Obtained from: CheriBSD
Reviewed by: kib, jhb, markj
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D19122

5 years agoMFC r343543: bectl(8) test: Force destroy the zpool in cleanup
Kyle Evans [Mon, 18 Feb 2019 16:11:11 +0000 (16:11 +0000)]
MFC r343543: bectl(8) test: Force destroy the zpool in cleanup

This is a wild guess as to why bectl tests failed once upon a time in CI,
given no apparent way to see a transcript of cleanup routines with Kyua. The
bectl tests construct a new, clean zpool for every test. The failure
indicated was because of a mount that was leftover from a previous test, but
the previous test had succeeded so it's not clear how the mount remained
leftover unless the `zpool get health ${pool}` had somehow failed.

5 years agoMFC r344018:
Andrey V. Elsukov [Mon, 18 Feb 2019 10:51:27 +0000 (10:51 +0000)]
MFC r344018:
  Remove `set' field from state structure and use set from parent rule.

  Initially it was introduced because parent rule pointer could be freed,
  and rule's information could become inaccessible. In r341471 this was
  changed. And now we don't need this information, and also it can become
  stale. E.g. rule can be moved from one set to another. This can lead
  to parent's set and state's set will not match. In this case it is
  possible that static rule will be freed, but dynamic state will not.
  This can happen when `ipfw delete set N` command is used to delete
  rules, that were moved to another set.
  To fix the problem we will use the set number from parent rule.

  Obtained from: Yandex LLC
  Sponsored by: Yandex LLC

5 years agoMFC: r343164
Dmitry Morozovsky [Mon, 18 Feb 2019 10:11:26 +0000 (10:11 +0000)]
MFC: r343164

Clarify error messages a bit.

X-Found-With: r343112
Reviewed by: eugen (implicitly, when r343112 analysis)

5 years agoMFC r343896,r343922: dhclient: Pass through exit status from script
Jilles Tjoelker [Sun, 17 Feb 2019 20:25:07 +0000 (20:25 +0000)]
MFC r343896,r343922: dhclient: Pass through exit status from script

The wait status is translated into 8 bits the same way as the shell
calculates $?.

5 years agoMFC r343723:
Konstantin Belousov [Sun, 17 Feb 2019 09:57:43 +0000 (09:57 +0000)]
MFC r343723:
i386: Do not ever store to other-CPU counter64 slot.

5 years agoMFC r343966:
Konstantin Belousov [Sun, 17 Feb 2019 09:56:11 +0000 (09:56 +0000)]
MFC r343966:
struct xswdev on amd64 requires compat32 shims after ino64.

5 years agoMFC r343699:
Andriy Voskoboinyk [Sun, 17 Feb 2019 03:21:18 +0000 (03:21 +0000)]
MFC r343699:
net80211: do not setup Tx parameters for unsupported modes.

That should shorten 'ifconfig <wlan> list txparam' output since
unsupported modes will not be shown.

5 years agoMFC r343696:
Andriy Voskoboinyk [Sun, 17 Feb 2019 03:11:42 +0000 (03:11 +0000)]
MFC r343696:
net80211: do not setup roaming parameters for unsupported modes.

ifconfig(8) prints per-mode parameters if they are non-zero; since
we have 13 possible modes with 3...5 typically supported this change
should greatly reduce amount of information for 'ifconfig <wlan> list roam'
command.

While here ensure that sta_roam_check() will not use roaming parameters
for unsupported modes (it should not).

This change effectively reverts r188776.

5 years agoMFC r343501:
Andriy Voskoboinyk [Sun, 17 Feb 2019 02:58:44 +0000 (02:58 +0000)]
MFC r343501:
Add NO_6_BYTE / NO_SYNC_CACHE quirks for (C|D|E).* Olympus digital cameras

PR: 97472
Submitted by: Fabio Luis Girardi <papelhigienico@gmail.com>
Reviewed by: imp

5 years agoMFC r344112:
Dimitry Andric [Sat, 16 Feb 2019 19:49:12 +0000 (19:49 +0000)]
MFC r344112:

Pull in r353907 from upstream llvm trunk (by Reid Kleckner):

  [MC] Make symbol version errors non-fatal

  We stil don't have a source location, which is pretty lame, but at
  least we won't tell the user to file a clang bug report anymore.

  Fixes PR40712

This will make errors for symbols with @@ versions that are not defined
non-fatal.  For example:

  void f(void)
  {
    __asm__(".symver foo,bar@@baz");
  }

will now result in:

  error: versioned symbol bar@@baz must be defined

instead of clang crashing with a diagnostic report.

PR: 234671
Upstream PR: https://bugs.llvm.org/show_bug.cgi?id=40712

5 years agoMerge clang 7.0.1 and several follow-up changes
Dimitry Andric [Sat, 16 Feb 2019 15:43:49 +0000 (15:43 +0000)]
Merge clang 7.0.1 and several follow-up changes

MFC r341825:

Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
the upstream release_70 branch r348686 (effectively, 7.0.1 rc3).  The
release will follow very soon, but no more functional changes are
expected.

Release notes for llvm, clang and lld 7.0.0 are available here:
<http://releases.llvm.org/7.0.0/docs/ReleaseNotes.html>
<http://releases.llvm.org/7.0.0/tools/clang/docs/ReleaseNotes.html>
<http://releases.llvm.org/7.0.0/tools/lld/docs/ReleaseNotes.html>

PR: 230240, 230355
Relnotes: yes

MFC r342123:

Update clang, llvm, lld, lldb, compiler-rt and libc++ version number to
7.0.1 release r349250.  There were no functional changes since the 7.0.1
rc3 import.

PR: 230240, 230355
Relnotes: yes

r343429 | emaste | 2019-01-25 15:46:13 +0100 (Fri, 25 Jan 2019) | 16 lines

clang: default to DWARF 4 as of FreeBSD 13

FreeBSD previously defaulted to DWARF 2 because several tools (gdb,
ctfconvert, etc.) did not support later versions.  These have either
been fixed or are deprecated.

Note that gdb 6 still exists but has been moved out of $PATH into
/usr/libexec and is intended only for use by crashinfo(8).  The kernel
build sets the DWARF version explicitly via -gdwarf2, so this should
have no effect there.

PR: 234887 [exp-run]
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17930

MFC r343916:

Pull in r352607 from upstream llvm trunk (by Craig Topper):

  [X86] Add FPSW as a Def on some FP instructions that were missing it.

Pull in r353141 from upstream llvm trunk (by Craig Topper):

  [X86] Connect the default fpsr and dirflag clobbers in inline
  assembly to the registers we have defined for them.

  Summary:
  We don't currently map these constraints to physical register numbers
  so they don't make it to the MachineIR representation of inline
  assembly.

  This could have problems for proper dependency tracking in the
  machine schedulers though I don't have a test case that shows that.

  Reviewers: rnk

  Reviewed By: rnk

  Subscribers: eraman, llvm-commits

  Tags: #llvm

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

Pull in r353489 from upstream llvm trunk (by Craig Topper):

  [X86] Add FPCW as a register and start using it as an implicit use on
  floating point instructions.

  Summary:
  FPCW contains the rounding mode control which we manipulate to
  implement fp to integer conversion by changing the roudning mode,
  storing the value to the stack, and then changing the rounding mode
  back. Because we didn't model FPCW and its dependency chain, other
  instructions could be scheduled into the middle of the sequence.

  This patch introduces the register and adds it as an implciit def of
  FLDCW and implicit use of the FP binary arithmetic instructions and
  store instructions. There are more instructions that need to be
  updated, but this is a good start. I believe this fixes at least the
  reduced test case from PR40529.

  Reviewers: RKSimon, spatel, rnk, efriedma, andrew.w.kaylor

  Subscribers: dim, llvm-commits

  Tags: #llvm

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

These should fix a problem in clang 7.0 where it would sometimes emit
long double floating point instructions in a slightly wrong order,
leading to failures in our libm tests.  In particular, the cbrt_test
test case 'cbrtl_powl' and the trig_test test case 'reduction'.

Also bump __FreeBSD_cc_version, to be able to detect this in our test
suite.

Reported by:    lwhsu
PR: 234040
Upstream PR: https://bugs.llvm.org/show_bug.cgi?id=40206

MFC r344056:

Pull in r339734 from upstream llvm trunk (by Eli Friedman):

  [ARM] Make PerformSHLSimplify add nodes to the DAG worklist correctly.

  Intentionally excluding nodes from the DAGCombine worklist is likely
  to lead to weird optimizations and infinite loops, so it's generally
  a bad idea.

  To avoid the infinite loops, fix DAGCombine to use the
  isDesirableToCommuteWithShift target hook before performing the
  transforms in question, and implement the target hook in the ARM
  backend disable the transforms in question.

  Fixes https://bugs.llvm.org/show_bug.cgi?id=38530 . (I don't have a
  reduced testcase for that bug. But we should have sufficient test
  coverage for PerformSHLSimplify given that we're not playing weird
  tricks with the worklist. I can try to bugpoint it if necessary,
  though.)

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

This should fix a possible hang when compiling sys/dev/nxge/if_nxge.c
(which exists now only in the stable/11 branch) for arm.

5 years agoMFC r343918: Teach /etc/rc.d/growfs how to handle systems running ZFS.
Colin Percival [Sat, 16 Feb 2019 09:50:17 +0000 (09:50 +0000)]
MFC r343918: Teach /etc/rc.d/growfs how to handle systems running ZFS.

5 years agoMFC r339831 (imp): Move LUA_ROOT to /boot/lua
Kyle Evans [Sat, 16 Feb 2019 06:12:16 +0000 (06:12 +0000)]
MFC r339831 (imp): Move LUA_ROOT to /boot/lua

While this is mostly unused today, this is a better place than
/usr/local/lua.

5 years agoMFC r343601:
Kyle Evans [Sat, 16 Feb 2019 04:48:30 +0000 (04:48 +0000)]
MFC r343601:
install(1): Fix relative path calculation with partial common dest/src

For example, from the referenced PR [1]:

$ mkdir /tmp/lib/ /tmp/libexec
$ touch /tmp/lib/foo.so
$ install -lrs /tmp/lib/foo.so /tmp/libexec/

The common path identification bits terminate src at /tmp/lib/ and the
destination at /tmp/libe. The subsequent backtracking is then incorrect, as
it traverses the destination and backtraces exactly one level while eating
the 'libexec' because it was previously (falsely) identified as common with
'lib'.

The obvious fix would be to make sure we've actually terminated just after
directory separators and rewind a character if we haven't. In the above
example, we would end up rewinding to /tmp/ and subsequently doing the right
thing.

Test case added.

PR: 235330 [1]

5 years agoMFC: r343011
Yoshihiro Takahashi [Sat, 16 Feb 2019 03:18:09 +0000 (03:18 +0000)]
MFC: r343011

  Use ${SRCTOP}/contrib/com_err/com_err.h instead of the installed com_err.h.
  This fixes build when com_err.h is not installed.

PR: 234691

5 years agoMFC r343094:
Andriy Voskoboinyk [Sat, 16 Feb 2019 01:19:14 +0000 (01:19 +0000)]
MFC r343094:
iwn(4): (partially) rewrite A-MPDU Tx path

The change fixes ifnet counters and improves Tx stability when A-MPDU
is used.

MFC r343292:
iwn(4): drop i_seq field initialization for A-MPDU frames

It is done by net80211 since r319460.

PR: 192641, 210211
Reviewed by: adrian, dhw
Differential Revision: https://reviews.freebsd.org/D10728

5 years agoMFC r343980:
Andriy Voskoboinyk [Sat, 16 Feb 2019 01:05:22 +0000 (01:05 +0000)]
MFC r343980:
ifconfig(8): display 802.11n rates correctly for 'roam:rate' parameter

5 years agoMFC r343112: jail(8): stop crashing with SIGSEGV inside run_command()
Eugene Grosbein [Sat, 16 Feb 2019 00:38:25 +0000 (00:38 +0000)]
MFC r343112: jail(8): stop crashing with SIGSEGV inside run_command()
function while processing not entirely correct jail.conf(5) file
having something like "ip4.addr = 127.0.0.1;" and no "ip4 = ...;"
so extrap variable stays NULL.

Reported by:    marck

5 years agoMFC r343909:
Andriy Voskoboinyk [Sat, 16 Feb 2019 00:37:08 +0000 (00:37 +0000)]
MFC r343909:
newkey(8): fix 'tmpname' memory leak (always) and input file descriptor leak
when output file cannot be opened

PR: 201732
Reported by: David Binderman <dcb314@hotmail.com>

5 years agoMFC r343327:
Vladimir Kondratyev [Fri, 15 Feb 2019 20:52:32 +0000 (20:52 +0000)]
MFC r343327:

Add quirk to enable mic and headphones redirection on HP Spectre laptops.

Tested on HP Spectre 13 AF006UR.

5 years agoMFC r343163:
Vladimir Kondratyev [Fri, 15 Feb 2019 20:45:12 +0000 (20:45 +0000)]
MFC r343163:

psm(4): detect Lenovo top-button clickpads

libinput has special handling for Lenovo ThinkPad *40 series, where it
treats clicks on the top button area as if they came from the TrackPoint:
https://wayland.freedesktop.org/libinput/doc/latest/t440-support.html

Detect these devices and set the corresponding evdev property.

Submitted by: Greg V <greg@unrelenting.technology>
Differential Revision: https://reviews.freebsd.org/D18676

5 years agoMFC r344132:
Eric Joyner [Fri, 15 Feb 2019 19:13:11 +0000 (19:13 +0000)]
MFC r344132:

ixl: Fix panic caused by bug exposed by r344062

Don't use a struct if_irq for IFLIB_INTR_IOV type interrupts since that results
in get_core_offset() being called on them, and get_core_offset() doesn't
handle IFLIB_INTR_IOV type interrupts, which results in an assert() being triggered
in iflib_irq_set_affinity().

PR: 235730
Reported by: Jeffrey Pieper <jeffrey.e.pieper@intel.com>
Sponsored by: Intel Corporation

5 years agoMFC r343855, r343859:
Konstantin Belousov [Fri, 15 Feb 2019 11:33:48 +0000 (11:33 +0000)]
MFC r343855, r343859:
Use ifunc to select the barrier instruction for RDTSC.

5 years agoMFC r343899:
Konstantin Belousov [Fri, 15 Feb 2019 11:20:25 +0000 (11:20 +0000)]
MFC r343899:
In null_vptocnp(), cache vp->v_mount and use it for null_nodeget() call.

PR: 235549

5 years agoMFC r343897, r343898:
Konstantin Belousov [Fri, 15 Feb 2019 11:19:12 +0000 (11:19 +0000)]
MFC r343897, r343898:
Some style for nullfs_mount().
Before using VTONULL(), check that the covered vnode belongs to nullfs.

5 years agoMFC r343891:
Konstantin Belousov [Fri, 15 Feb 2019 11:13:39 +0000 (11:13 +0000)]
MFC r343891:
Fix renameat(2) for CAPABILITIES kernelsi.

MFC Note: Layout of the struct nameidata is changed.  I specifically
decided to not move the new field to the end of the new structure since
it would mostly make the corruption silent.  __FreeBSD_version is bumped.

5 years agoMFC r343617, r343618:
Konstantin Belousov [Fri, 15 Feb 2019 09:49:09 +0000 (09:49 +0000)]
MFC r343617, r343618:
Make iflib a loadable module.

5 years agoMFC r343905:
Hans Petter Selasky [Fri, 15 Feb 2019 09:20:10 +0000 (09:20 +0000)]
MFC r343905:
Improve Bluetooth device discovery support for Android and Microsoft devices.

Tested using the virtual_bt_speaker(8) tool from the virtual_oss(8)
project at github.com.

PR: 210089
Sponsored by: Mellanox Technologies

5 years agoMerge r343895:
Gleb Smirnoff [Fri, 15 Feb 2019 00:29:44 +0000 (00:29 +0000)]
Merge r343895:
  Allow some nesting of ng_iface(4) interfaces and add a configuration knob.

PR: 235500

5 years agoMFC r343530:
Alan Somers [Thu, 14 Feb 2019 20:33:35 +0000 (20:33 +0000)]
MFC r343530:

ifconfig: fix endianness bug displaying pfsync interfaces

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D19005

5 years agoMFC r300938, r342154
Alan Somers [Thu, 14 Feb 2019 20:31:05 +0000 (20:31 +0000)]
MFC r300938, r342154

r300938 by ngie:
Remove the sa(8) tests if MK_ACCT == no when "make delete-old" is run

sa(8) is conditionally installed based on MK_ACCT != no today

Sponsored by: EMC / Isilon Storage Division

r342154:
OptionalObsoleteFiles: Fix deleting usr/tests/usr.sbin/sa

It's a directory, not a file.

Reported by: ngie
X-MFC-With: 300938

5 years agoMFC r342153, r342172-r342173
Alan Somers [Thu, 14 Feb 2019 20:29:33 +0000 (20:29 +0000)]
MFC r342153, r342172-r342173

r342153:
Conditionally install /etc/rc.d/audit* based on ${MK_AUDIT}

/usr/sbin/audit(dist)?d are only installed if ${MK_AUDIT} == yes. Their
supporting scripts should only be installed in those instances as well.

Submitted by: ngie
Reviewed by: emaste
Pull Request: https://github.com/freebsd/freebsd/pull/242

r342172:
audit(4) tests: require /etc/rc.d/auditd

These tests should be skipped if /etc/rc.d/auditd is missing, which could be
the case if world was built with WITHOUT_AUDIT set.  Also, one test case
requires /etc/rc.d/accounting.

Submitted by: ngie
Pull Request: https://github.com/freebsd/freebsd/pull/240

r342173:
Conditionalize installtion audit(4) tests on MK_AUDIT

MK_AUDIT already controls auditd(8), praudit(1), etc.  It should also control
the audit test suite.

Submitted by: ngie
Pull Request: https://github.com/freebsd/freebsd/pull/240

5 years agoMFC r341390, r341392, r341667
Alan Somers [Thu, 14 Feb 2019 20:26:59 +0000 (20:26 +0000)]
MFC r341390, r341392, r341667

r341390:
Remove some dead code from the geli tests

This is detritus in the Makefile, leftover from 327662.

r341392:
Unbreak geli/gmirror testcases if their geom classes cannot be loaded

The problem with the logic prior to this commit was twofold:

1. The wrong set of idioms (TAP-compatible) were being applied to the ATF
   testcases when run, resulting in confusing ATF failure results on setup.
2. The cleanup subroutines were broken when the geom classes could not be
   loaded as they exited with 0 unexpectedly.

This commit changes the test code to source the class-specific configuration
(conf.sh) once globally, instead of sourcing it per testcase and per cleanup
subroutine, and to call the ATF-specific setup subroutine(s) inline in
the testcases.

The refactoring done is effectively a no-op for the TAP testcases, modulo
any refactoring done to create common code between the ATF and TAP
testcases.

This unbreaks the geli testcases converted to ATF in r327662 and r327683,
and the gmirror testcases added in r327780, respectively, when the geom
class could not be loaded.

tests/sys/geom/class/mirror/...
    While here, ignore errors when turning debug failpoint sysctl off, which
    could occur if the gmirror class was not loaded.

Submitted by: ngie
Pull Request: https://github.com/freebsd/freebsd/pull/241

r341667:
geom tests: Fix cleanup of ATF tests since r341392

r341392 changed common test cleanup routines in a way that allowed them to
be used by TAP tests as well as ATF tests.  However, a late change made
during code review resulted in cleanup being broken for ATF tests, which
source geom_subr.sh separately during the body and cleanup phases of the
test.  The result was that md(4) devices wouldn't get cleaned up.

X-MFC-With: 341392