Commit Graph

247743 Commits

Author SHA1 Message Date
Kyle Evans
fbd46fe94a pkgbase: fix caroot packaging and add post-install script
The original intention for caroot was to be packaged separately, perhaps so
that users can have a more/less conservative upgrade policy for this
separated from the rest of base.

secure/caroot/Makefile doesn't have anything interesting to package, but its
subdirectories might. Move the PACKAGE= to Makefile.inc so both blacklisted
and trusted get packaged consistently into the correct one rather than the
default -utilities. Also tag the directories for package=caroot, as they
could also be empty; blacklisted is empty by default, but trusted is not.

Add a post-install script to do certctl rehash, along with a note should we
eventually come up with a way to detect that files have been added or
removed that requires a rehash.

-caroot gets a dependency on -utilities, as that's where we provide certctl
at the moment. We can perhaps reconsider this and put certctl into this
package in the future, but there are some bits within -utilities that
unconditionally invoke certctl so let's hold off for now.

Reviewed by:	manu (earlier version, before -utilities dep added)
Differential Revision:	https://reviews.freebsd.org/D23352
2020-01-29 18:47:08 +00:00
Alexander V. Chernikov
4be465ab46 Plug parent iface refcount leak on <ifname>.X vlan creation.
PR:		kern/242270
Submitted by:	Andrew Boyer <aboyer at pensando.io>
MFC after:	2 weeks
2020-01-29 18:41:35 +00:00
Leandro Lupori
a9d8f71f7b [PPC64] Fix NUMA on POWER8
On some POWER8 machines, 'ibm,associativity' property may have 6
cells, which would overflow the 5 cells buffer being used.
There was also an issue with the "check if node is root" part,
that have been fixed too.

Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D23414
2020-01-29 18:13:44 +00:00
Alfredo Dal'Ava Junior
d8a85b4237 Add myself (alfredo) to committers-src.dot and calendar.freebsd
Approved by:	jhibbits (mentor)
2020-01-29 17:39:38 +00:00
Ruslan Bukin
dee4c1d2a8 Add driver for Xilinx XDMA PCIe Bridge found in the U.S. Government
Furnished Equipment (GFE) riscv cores.

GFE cores are synthesized on the Xilinx Virtex UltraScale+ FPGA VCU118
Evaluation Kit.

Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D23337
2020-01-29 16:52:12 +00:00
Kyle Evans
d353e1199a pkgbase: kill off clibs.ucl and docs.ucl
These are just direct copies of the template. If they don't exist but are
attempted to be used, generate-ucl.sh will simply fallback to the template
anyways. Let it do so to reduce potential maintenance burden.
2020-01-29 16:24:16 +00:00
Mitchell Horne
0c80139031 cgem: Add another compat string for the SiFive fu540
Newer device trees use "sifive,fu540-c000-gem" instead of "cdns,macb".

Reviewed by:	br, kp
Differential Revision:	https://reviews.freebsd.org/D23407
2020-01-29 15:58:19 +00:00
Mitchell Horne
741ba007c1 Fix definition of SSTATUS_SD
The SD bit is defined as the MSB of the sstatus register, meaning its
position will vary depending on the CSR's length. Previously, there were
two (unused) defines for this, for the 32 and 64-bit cases, but their
definitions were swapped.

Consolidate these into one define: SSTATUS_SD, and make the definition
dependent on the value of __riscv_xlen.

Reviewed by:	br
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D23402
2020-01-29 15:50:48 +00:00
Ganbold Tsagaankhuu
9eea475074 Add an overlay for RK3328 USB3 node.
It doesn't exist in mainline dts due to the issues related
with detaching and reattaching USB3 devices as mentioned in
https://patchwork.kernel.org/patch/10853381/
In case of FreeBSD, as a temporary workaround "usbconfig reset"
command can fix the problem.

Reviewed by:	manu
2020-01-29 12:10:42 +00:00
Konstantin Belousov
b70f6e1513 Restore OOM logic on page fault after r357026.
Right now OOM is initiated unconditionally on the page allocation
failure, after the wait.

Reported by:	Mark Millard <marklmi@yahoo.com>
Reviewed by:	cy, markj
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D23409
2020-01-29 12:02:47 +00:00
Ganbold Tsagaankhuu
5e1e7e6192 Enable USB3 support for Rockchip RK3328 SoC.
Reviewed by:	manu
2020-01-29 09:36:59 +00:00
Ganbold Tsagaankhuu
87fcb283c5 Add USB3 related clock definitions for Rockchip RK3328 SoC.
Reviewed by:	manu
2020-01-29 08:46:35 +00:00
Conrad Meyer
446bb222fb ypldap(8): Fix absent va_end() in 'goto fail' path
In this path, we used va_start() without pairing it with va_end().  Add the
va_end().  (va_start() without paired va_end() is undefined behavior per the C
standard.)

"In many implementations, [va_end] is a do-nothing operation; but those
implementations that need it probably need it badly." - Rationale for the ANSI
C Programming Language, § 4.8.1.3.

Reported by:	Coverity
CID:		1340539
2020-01-29 05:59:22 +00:00
Conrad Meyer
9106fb165b bnxt(4): Eliminate wrong sizeof() expression in memset()
While here, clean up magic numbers.

The memset(,0,) (and M_ZERO!) can just be removed; the bit_alloc() API already
zeros the allocation.

No functional change.

Reported by:	Coverity
CID:		1378286
2020-01-29 05:42:24 +00:00
Conrad Meyer
d09fbcd0b6 ixgbe(4): Eliminate bogus sizeof() expressions
All of these uses of sizeof() were on the wrong type in relation to the pointer
passed to SYSCTL_ADD_PROC as arg1.  Fortunately, none of the handlers actually
use arg2.  So just don't pass a (non-zero) arg2.

Reported by:	Coverity
CID:		1007701
2020-01-29 05:31:40 +00:00
Conrad Meyer
d71e0db25b qmath(3) test: Replace overcomplicated abomination with arc4random(3)
The horrific GENRAND construction bent over backwards to construct 64-bit
signed integers from the 31-bit output of random(3) for about 20 numbers per
test.  Reproducibility wasn't a goal: random(3) was seeded with
srandomdev(3).  Speed is not a factor for generating 20 integers with
arc4random(3).  Range is not a factor: all uses did not bound the range
beyond that of the full [INT64_MIN, INT64_MAX].  Just use arc4random(3).

Reported by:	Coverity
CIDs:		1404809, 1404817, 1404838, 1404840 and about 6x other
		identical reports of dubious code relating to the
		construction
2020-01-29 05:25:20 +00:00
Conrad Meyer
82b5e6440d qlxge(4): Ditto r357244
Reported by:	Coverity
CID:		1193716
2020-01-29 04:42:46 +00:00
Conrad Meyer
bf66c12e30 qlxgb(4): Use defined evaluation order
Reported by:	Coverity
CID:		1193717
2020-01-29 04:41:26 +00:00
Conrad Meyer
f824ea0c26 libpmc: jevents: Go ahead and use snprintf(3)
Reported by:	Coverity
CID:		1391362
2020-01-29 04:33:45 +00:00
Justin Hibbits
4ff85ece0e powerpc64/csu: Rename dummy asm file to force use of 'cc'
Implicit make rules build .S asm files with the compiler, rather than the
assembler.  r356889 removed GNU as from the build for powerpc targets,
causing '.s' asm files to fail to build, due to a missing 'as'.  Rename the
one dummy asm file we have to a '.S' to force the implicit rules to build
with the compiler rather than the assembler.

Reported by:	Francis Little
2020-01-29 04:32:06 +00:00
Conrad Meyer
3ea691c261 libpmc: jevents: Partial style(9) pass
Sort headers, move includes up to the top of the file, function return types on
their own line; no functional change.
2020-01-29 04:31:26 +00:00
Conrad Meyer
07a65f9d38 hwpstate_intel(4): Silence/fix Coverity reports
These were all introduced in the initial import of hwpstate_intel(4).

Reported by:	Coverity
CIDs:		1413161, 1413164, 1413165, 1413167
X-MFC-With:	r357002
2020-01-29 03:15:34 +00:00
Mateusz Guzik
4846152a08 amd64: sync up libc memcmp with the kernel version (r357208) 2020-01-29 01:57:07 +00:00
Mateusz Guzik
48340ae73a libc: remove forward compat added in r356830 for F_ISUNIONSTACK 2020-01-29 01:52:27 +00:00
Mateusz Guzik
f0a747d129 vfs: add VNPASS macro and augment VNASSERT to print more about the assert
Sample out put now instead of mere VNASSERT failed:
VNASSERT failed: vp->v_holdcnt == 1234 not true at /usr/src/sys/kern/vfs_subr.c:3148 (vputx)

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D23396
2020-01-29 01:51:21 +00:00
Warner Losh
827bea2645 Fix spelling of removable 2020-01-29 00:28:50 +00:00
Alan Somers
03e7a2be06 Speed up "zpool import" in the presence of many zvols
By default, zpools may not be backed by zvols (that can be changed with the
"vfs.zfs.vol.recursive" sysctl). When that sysctl is set to 0, the kernel
does not attempt to read zvols when looking for vdevs. But the zpool command
still does. This change brings the zpool command into line with the kernel's
behavior. It speeds "zpool import" when an already imported pool has many
zvols, or a zvol with many snapshots.

PR:		241083
Reported by:	Martin Birgmeier <d8zNeCFG@aon.at>
Reviewed by:	mav, Ryan Moeller <ryan@freqlabs.com>
MFC after:	2 weeks
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D22077
2020-01-28 23:07:31 +00:00
Kristof Provost
5458a63bca tests: Test for an epair panic
if_epair abused the ifr_data field to insert its second interface in
IFC_IFLIST. If userspace provides a value for ifr_data it would get
dereferenced by the kernel leading to a panic.

Reported by:	Ilja Van Sprundel <ivansprundel@ioactive.com>
MFC after:	3 days
2020-01-28 22:46:51 +00:00
Kristof Provost
b02fd8b790 epair: Do not abuse params to register the second interface
if_epair used the 'params' argument to pass a pointer to the b interface
through if_clone_create().
This pointer can be controlled by userspace, which means it could be abused to
trigger a panic. While this requires PRIV_NET_IFCREATE
privileges those are assigned to vnet jails, which means that vnet jails
could panic the system.

Reported by:	Ilja Van Sprundel <ivansprundel@ioactive.com>
MFC after:	3 days
2020-01-28 22:44:24 +00:00
Dimitry Andric
1232c36139 Merge r357231 from the clang1000-import branch:
Work around assembler error from clang 10.0.0 in gptboot:

stand/i386/gptboot/gptldr.S:141:3: error: value of 36878 is too large for field of 2 bytes.
  jmp MEM_JMP # Start BTX
  ^

Use the same construct as in stand/i386/boot2/boot1.S, which ensures the
jump distance does not become too large.

MFC after:	3 days
2020-01-28 21:46:59 +00:00
Dimitry Andric
ae55765309 Work around assembler error from clang 10.0.0 in gptboot:
stand/i386/gptboot/gptldr.S:141:3: error: value of 36878 is too large for field of 2 bytes.
  jmp MEM_JMP # Start BTX
  ^

Use the same construct as in stand/i386/boot2/boot1.S, which ensures the
jump distance does not become too large.

MFC after:	3 days
2020-01-28 21:41:37 +00:00
Dimitry Andric
3185731ec5 Merge r357225 from the clang1000-import branch:
Fix the following -Werror warning from clang 10.0.0 in newfs_msdos:

sbin/newfs_msdos/newfs_msdos.c:181:2: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
        if (o.align) {
        ^
sbin/newfs_msdos/newfs_msdos.c:179:5: note: previous statement is here
    if (argc < 1 || argc > 2)
    ^

MFC after:	3 days
2020-01-28 20:12:29 +00:00
Dimitry Andric
8841e3fb92 Merge r357224 from the clang1000-import branch:
Fix the following -Werror warning from clang 10.0.0 in binutils:

contrib/binutils/bfd/peicode.h:1356:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                if (efi)
                ^
contrib/binutils/bfd/peicode.h:1353:8: note: previous statement is here
              if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch)
              ^
contrib/binutils/bfd/peicode.h:1370:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                if (!efi)
                ^
contrib/binutils/bfd/peicode.h:1367:8: note: previous statement is here
              if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch)
              ^

MFC after:	3 days
2020-01-28 20:11:27 +00:00
Dimitry Andric
e54f2950a6 Fix the following -Werror warning from clang 10.0.0 in newfs_msdos:
sbin/newfs_msdos/newfs_msdos.c:181:2: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
        if (o.align) {
        ^
sbin/newfs_msdos/newfs_msdos.c:179:5: note: previous statement is here
    if (argc < 1 || argc > 2)
    ^

MFC after:	3 days
2020-01-28 20:10:26 +00:00
Dimitry Andric
62b61cee41 Fix the following -Werror warning from clang 10.0.0 in binutils:
contrib/binutils/bfd/peicode.h:1356:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                if (efi)
                ^
contrib/binutils/bfd/peicode.h:1353:8: note: previous statement is here
              if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch)
              ^
contrib/binutils/bfd/peicode.h:1370:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                if (!efi)
                ^
contrib/binutils/bfd/peicode.h:1367:8: note: previous statement is here
              if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch)
              ^

MFC after:	3 days
2020-01-28 20:09:23 +00:00
Dimitry Andric
da858492df Merge r357222 from the clang1000-import branch:
Fix the following -Werror warning from clang 10.0.0 in rbootd:

libexec/rbootd/rmpproto.c:335:49: error: multiple unsequenced modifications to 'filename' [-Werror,-Wunsequenced]
        filename = (filename = strrchr(filepath,'/'))? ++filename: filepath;
                 ~                                     ^

MFC after:	3 days
2020-01-28 20:05:25 +00:00
Dimitry Andric
fe1b3370c1 Fix the following -Werror warning from clang 10.0.0 in rbootd:
libexec/rbootd/rmpproto.c:335:49: error: multiple unsequenced modifications to 'filename' [-Werror,-Wunsequenced]
        filename = (filename = strrchr(filepath,'/'))? ++filename: filepath;
                 ~                                     ^

MFC after:	3 days
2020-01-28 19:19:55 +00:00
Dimitry Andric
a92579cfb9 Add internal floating point environment builtins to libcompiler_rt and
libgcc, as these are used in a few other builtin implementations.
2020-01-28 19:07:37 +00:00
Gordon Tetlow
6fb3f9944f Fix urldecode buffer overrun.
Reported by:	Duncan Overbruck
Security:	CVE-2020-7450
2020-01-28 18:37:18 +00:00
Alan Somers
95e6640be2 geli: add a test case for attaching multiple providers with 1 command
Reviewed by:	cem
MFC after:	2 weeks
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D23400
2020-01-28 18:32:19 +00:00
Dimitry Andric
4f73ee074c Prefer upstream RISC-V additions in libunwind instead of ours, as these
arrived via roundabout way upstream, and got updated in the mean time.
2020-01-28 18:04:17 +00:00
Mateusz Guzik
f0ddecd745 amd64: revamp memcmp
Borrow the trick from memset and memmove and use the scale/index/base addressing
to avoid branches.

If a mismatch is found, the routine has to calculate the difference. Make sure
there is always up to 8 bytes to inspect. This replaces the previous loop which
would operate over up to 16 bytes with an unrolled list of 8 tests.

Speed varies a lot, but this is a net win over the previous routine with probably
a lot more to gain.

Validated with glibc test suite.
2020-01-28 17:48:17 +00:00
David Malone
9945b2dfef Add some missing articles.
Use .Nm to format the utility name.
Get the name of the GEOM class right.

MFC after:	2 weeks
2020-01-28 15:34:00 +00:00
Edward Tomasz Napierala
c2d4745705 Add TCP_CORK support to linux(4). This fixes one of the things Nginx
trips over.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23171
2020-01-28 13:57:24 +00:00
Edward Tomasz Napierala
da6d8ae6d8 Add compat.linux.ignore_ip_recverr sysctl. This is a workaround
for missing IP_RECVERR setsockopt(2) support. Without it, DNS
resolution is broken for glibc >= 2.30 (glibc BZ #24047).

From the user point of view this fixes "yum update" on recent
CentOS 8.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23234
2020-01-28 13:51:53 +00:00
Cy Schubert
882f88ff77 MFV r357163:
Update sqlite3-3.30.1 (3300100) --> sqlite3-3.31.0 (3310000)

MFC after:	1 month
2020-01-28 13:13:41 +00:00
Konstantin Belousov
5fc9e11c42 Save lower root vnode in nullfs mnt data instead of upper.
Nullfs needs to know the root vnode of the lower fs during the
operation.  Currently it caches the upper vnode of it, which is also
the root of the nullfs mount.  On unmount, nullfs calls vflush() with
rootrefs == 1, and aborts non-forced unmount if there are any more
vnodes instantiated during vflush().  This means that the reference to
the root vnode after failed non-forced unmount could be lost and
nullm_rootvp points to the freed memory.

Fix it by storing the reference for lower vnode instead, which is kept
intact during vflush().  nullfs_root() now instantiates the upper
vnode of lower root.  Care about VV_ROOT flag in null_nodeget().

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2020-01-28 11:29:06 +00:00
Konstantin Belousov
2a3529df1d Provide support for fdevname(3) on linuxkpi-backed devices.
Reported and tested by:	manu
Reviewed by:	hselasky, manu
Sponsored by:	Mellanox Technologies
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D23386
2020-01-28 11:22:20 +00:00
Michael Tuexen
dc13edbc7d Fix build issues for the userland stack on 32-bit platforms.
Reported by:		Felix Weinrank
MFC after:		1 week
2020-01-28 10:09:05 +00:00
Kyle Evans
45c88a3cbb netbsd-tests: libc: use correct modes in O_SEARCH tests
The current code clearly intended for these to be octal based on the values
used, but the octal prefix was forgotten. Add it now for correctness, but
note that we don't currently execute these tests.

This has been submitted upstream as misc/54902, so I've omitted the standard
FreeBSD markers that we tend to put into netbsd-tests for upstream-candidate
identification.

Reviewed by:	ngie
MFC after:	3 days
2020-01-28 03:47:29 +00:00