]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoRemove the old NFS lock device driver that uses Giant.
rmacklem [Thu, 9 Apr 2020 14:44:46 +0000 (14:44 +0000)]
Remove the old NFS lock device driver that uses Giant.

This NFS lock device driver was replaced by the kernel NLM around FreeBSD7 and
has not normally been used since then.
To use it, the kernel had to be built without "options NFSLOCKD" and
the nfslockd.ko had to be deleted as well.
Since it uses Giant and is no longer used, this patch removes it.

With this device driver removed, there is now a lot of unused code
in the userland rpc.lockd. That will be removed on a future commit.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D22933

4 years agoAlways install backward compatibility timezones, as they are installed
delphij [Thu, 9 Apr 2020 05:11:18 +0000 (05:11 +0000)]
Always install backward compatibility timezones, as they are installed
on all major Linux distributions as well as NetBSD and OpenBSD.

Remove the undocumented ZONEINFO_OLD_TIMEZONES_SUPPORT and the deprecated
OLDTIMEZONES knobs as they are now the default.

Reviewed by: ngie, rgrimes
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24306

4 years agoAdd a basic manpage for smbfs(5).
brueffer [Wed, 8 Apr 2020 20:00:30 +0000 (20:00 +0000)]
Add a basic manpage for smbfs(5).

Submitted by: Gordon Bergling
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23905

4 years agologger: temporarily disable Capsicum when a host is provided
oshogbo [Wed, 8 Apr 2020 18:43:00 +0000 (18:43 +0000)]
logger: temporarily disable Capsicum when a host is provided

We don't have a way to send a UDP package.

PR: 245314
Reported by: dch
Discussed with: emaste

4 years agoFix copyright year and eliminate the obsolete all rights reserved line.
imp [Wed, 8 Apr 2020 17:55:45 +0000 (17:55 +0000)]
Fix copyright year and eliminate the obsolete all rights reserved line.

Reviewed by: rrs@

4 years agoClone the RCU interface into a sleepable and a non-sleepable part
hselasky [Wed, 8 Apr 2020 17:09:45 +0000 (17:09 +0000)]
Clone the RCU interface into a sleepable and a non-sleepable part
in the LinuxKPI.

This allows synchronize RCU to be used inside a SRCU read section.
No functional change intended.

Bump the __FreeBSD_version to force recompilation of external kernel modules.

PR: 242272
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoSome fixes for SRCU in the LinuxKPI.
hselasky [Wed, 8 Apr 2020 16:07:57 +0000 (16:07 +0000)]
Some fixes for SRCU in the LinuxKPI.

- Make sure to use READ_ONCE() when deferring variables.
- Remove superfluous zero initializer.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoAccount out of buffer as dropped packets in mlx5en(4).
hselasky [Wed, 8 Apr 2020 08:56:27 +0000 (08:56 +0000)]
Account out of buffer as dropped packets in mlx5en(4).

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoRemove obsolete bufring stats in mlx5en(4).
hselasky [Wed, 8 Apr 2020 08:53:31 +0000 (08:53 +0000)]
Remove obsolete bufring stats in mlx5en(4).

Leftover from when DRBR was removed.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoFix an interoperability issue w.r.t. the Linux client and the NFSv4 server.
rmacklem [Wed, 8 Apr 2020 01:12:54 +0000 (01:12 +0000)]
Fix an interoperability issue w.r.t. the Linux client and the NFSv4 server.

Luoqi Chen reported a problem on freebsd-fs@ where a Linux NFSv4 client
was able to open and write to a file when the file's permissions were
not set to allow the owner write access.

Since NFS servers check file permissions on every write RPC, it is standard
practice to allow the owner of the file to do writes, regardless of
file permissions. This provides POSIX like behaviour, since POSIX only
checks permissions upon open(2).
The traditional way NFS clients handle this is to check access via the
Access operation/RPC and use that to determine if an open(2) on the
client is allowed.

It appears that, for NFSv4, the Linux client expects the NFSv4 Open (not a
POSIX open) operation to fail with NFSERR_ACCES if the file is not being
created and file permissions do not allow owner access, unlike NFSv3.
Since both the Linux and OpenSolaris NFSv4 servers seem to exhibit this
behaviour, this patch changes the FreeBSD NFSv4 server to do the same.
A sysctl called vfs.nfsd.v4openaccess can be set to 0 to return the
NFSv4 server to its previous behaviour.

Since both the Linux and FreeBSD NFSv4 clients seem to exhibit correct
behaviour with the access check for file owner in Open enabled, it is enabled
by default.

Reported by: luoqi.chen@gmail.com
MFC after: 2 weeks

4 years agoIn the past changes have been made to smbios->minor without updating the
rgrimes [Tue, 7 Apr 2020 23:17:44 +0000 (23:17 +0000)]
In the past changes have been made to smbios->minor without updating the
smbios->bcdrev value.
Correct that by calculating bcdrev from the major/minor values.

Reported by: bcran
Reviewed by: bcran, jhb
Approved by: jhb (maintainer)

4 years agoNow that we don't have special-case geom hacking defined in md_var.h, stop
imp [Tue, 7 Apr 2020 22:23:22 +0000 (22:23 +0000)]
Now that we don't have special-case geom hacking defined in md_var.h, stop
including it. sparc64 was the last straggler here, but these weren't removed at
the time.

4 years agoAdd a basic test for nvmecontrol
dab [Tue, 7 Apr 2020 20:26:42 +0000 (20:26 +0000)]
Add a basic test for nvmecontrol

I recently made some bug fixes in nvmecontrol. It occurred to me that
since nvmecontrol lacks any kyua tests, I should convert the informal
testing I did into a more formal automated test. The test in this
change should be considered just a starting point; it is neither
complete nor thorough. While converting the test to ATF/kyua, I
discovered a small bug in nvmecontrol; the nvmecontrol devlist command
would always exit with an unsuccessful status. So I included the fix
for that, too, so that the test won't fail.

Reviewed by: imp@
MFC after: 3 days
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D24269

4 years agoAdd support to MSDOS FS in PPC loader
luporl [Tue, 7 Apr 2020 19:46:00 +0000 (19:46 +0000)]
Add support to MSDOS FS in PPC loader

Although PPC OFW loader already had a LOADER_MSDOS_SUPPORT option, a few lines
were missing in conf.c, in order to support FAT filesystems.

This is useful when running FreeBSD under QEMU, to be able to easily change the
kernel and modules when running on hosts without UFS read/write support.

Reviewed by: jhibbits
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D24328

4 years agoNO_OBJ: Always fix .OBJDIR regardless of AUTO_OBJ.
bdrewery [Tue, 7 Apr 2020 17:07:04 +0000 (17:07 +0000)]
NO_OBJ: Always fix .OBJDIR regardless of AUTO_OBJ.

Sponsored by: Dell EMC
MFC after: 2 weeks

4 years agoAdd VIRTIO_NET_F_MTU flag support for the bhyve virtio-net device.
afedorov [Tue, 7 Apr 2020 17:06:33 +0000 (17:06 +0000)]
Add VIRTIO_NET_F_MTU flag support for the bhyve virtio-net device.
The flag can be enabled using the new 'mtu' option:
bhyve -s X:Y:Z,virtio-net,[tapN|valeX:N],mtu=9000

Reported by: vmaffione, jhb
Approved by: vmaffione (mentor)
Differential Revision: https://reviews.freebsd.org/D23971

4 years agoAdd -fno-common to all userland/kernel src builds
kevans [Tue, 7 Apr 2020 17:04:24 +0000 (17:04 +0000)]
Add -fno-common to all userland/kernel src builds

-fno-common will become the default in GCC10/LLVM11. Plenty of work has been
put in to make sure our world builds are no -fno-common clean, so let's slap
the build with this until it becomes the compiler default to ensure we don't
regress.

At this time, we will not be enforcing -fno-common on ports builds. I
suspect most ports will be or quickly become -fno-common clean as they're
naturally built against compilers that default to it, so this will hopefully
become a non-issue in due time. The exception to this, which is actually the
status quo, is that kmods built from ports will continue to build with
-fno-common.

As of the time of writing, I intend to also make stable/12 -fno-common
clean. What's been done will be MFC'd to stable/11 if it's easily applicable
and/or not much work to massage it into being functional, but I anticipate
adding -fcommon to stable/11 builds to maintain its ability to be built with
newer compilers for the rest of its lifetime instead of putting in a third
branch's worth of effort.

4 years agoImprove interaction of vectx and tftp
sjg [Tue, 7 Apr 2020 16:56:34 +0000 (16:56 +0000)]
Improve interaction of vectx and tftp

On slow platforms, it helps to spread the hashing load
over time so that tftp does not timeout.

Also, some .4th files are too big to fit in cache of pkgfs,
so increase cache size and ensure fully populated.

Reviewed by: stevek
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24287

4 years agolibcasper(3): Export functions to C++
cem [Tue, 7 Apr 2020 16:40:41 +0000 (16:40 +0000)]
libcasper(3): Export functions to C++

We must wrap C declarations in __BEGIN / __END_DECLS to avoid C++ name-mangling
of the declaration when including the C header; name-mangling causes the linker
to attempt to locate the wrong (C++ ABI) symbol name.

Reviewed by: markj, oshogbo (earlier version both)
Differential Revision: https://reviews.freebsd.org/D24323

4 years agoAllow the kernel to build with a compiler that sets -fno-common.
brooks [Tue, 7 Apr 2020 15:32:08 +0000 (15:32 +0000)]
Allow the kernel to build with a compiler that sets -fno-common.

The mechanism that generates assym.inc and offset.inc depends on the
symbols in question being common. For now, simply force the object files
to be created with -fcommon.

-fno-common will be the default in GCC10/LLVM11.

Submitted by: arichardson
Reviewed by: kevans
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24322

4 years agoFix port/kernel builds after r359681
kevans [Tue, 7 Apr 2020 15:10:04 +0000 (15:10 +0000)]
Fix port/kernel builds after r359681

Submitted by: bdrewery
Reported by: bdrewery, sobomax, antoine

4 years agoconfig(8): "fix" a couple of buffer overflows
kevans [Tue, 7 Apr 2020 14:14:59 +0000 (14:14 +0000)]
config(8): "fix" a couple of buffer overflows

Recently added/changed lines in various kernel configs have caused some
buffer overflows that went undetected. These were detected with a config
built using -fno-common as these line buffers smashed one of our arrays,
then further triaged with ASAN.

Double the sizes; this is really not a great fix, but addresses the
immediate need until someone rewrites config. While here, add some bounds
checking so that we don't need to detect this by random bus errors or other
weird failures.

MFC after: 3 days

4 years agostand: -fno-common fixes for !x86 loaders
kevans [Tue, 7 Apr 2020 12:57:50 +0000 (12:57 +0000)]
stand: -fno-common fixes for !x86 loaders

- beriloader: archsw is declared extern and defined elsewhere
- ofwloader: ofw_elf{,64} are defined in elf_freebsd.c and
  ppc64_elf_freebsd.c respectively
- ubldr: syscall_ptr is defined in start.S for whichever ubldr platform is
  building

-fno-common will become the default in GCC10/LLVM11.

MFC after: 3 days

4 years ago[PPC] Fix loader call to instantiate-rtas
luporl [Tue, 7 Apr 2020 12:46:26 +0000 (12:46 +0000)]
[PPC] Fix loader call to instantiate-rtas

OpenFirmware (OF) method instantiate-rtas was being called with a wrong
rtas-base-address argument. It must use the memory that is already being
allocated to this end instead. This issue was causing QEMU netboot to hang
when building the FDT from OF DT.

Reviewed by: jhibbits
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D24313

4 years agoFix panic on kern.cam.ctl.ha_role change after r333446.
mav [Tue, 7 Apr 2020 03:19:00 +0000 (03:19 +0000)]
Fix panic on kern.cam.ctl.ha_role change after r333446.

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

4 years agoNormalize deployment tools usage and definitions by putting into one place
sobomax [Tue, 7 Apr 2020 02:46:22 +0000 (02:46 +0000)]
Normalize deployment tools usage and definitions by putting into one place
instead of sprinkling them out over many disjoint files. This is a follow-up
to achieve the same goal in an incomplete rev.348521.

Approved by: imp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D20520

4 years agoriscv: Add semicolon missing from r359672
jrtc27 [Mon, 6 Apr 2020 23:54:50 +0000 (23:54 +0000)]
riscv: Add semicolon missing from r359672

Somehow this got lost between build-testing and submitting to Phabricator.

4 years agoFix compilation with upstream clang builtin headers.
brooks [Mon, 6 Apr 2020 23:38:46 +0000 (23:38 +0000)]
Fix compilation with upstream clang builtin headers.

By using -nobuiltininc and adding the clang builtin headers resource dir
to the end of the compiler header search path, we can still find headers
such as immintrin.h but find the FreeBSD version of stddef.h/stdarg.h/..
first.

This is a workaround until we are able to settle on and complete a plan
to harmonize guard macros with LLVM.  We've mostly worked out this on
FreeBSD systems by removing select headers from the installed set of
devel/llvm*, but that isn't a good solution for cross build.

Submitted by: arichardson
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17002

4 years agomail/gprof/tip: tap with the ugly stick
kevans [Mon, 6 Apr 2020 23:28:24 +0000 (23:28 +0000)]
mail/gprof/tip: tap with the ugly stick

The ugly stick here is this bit in the respective headers:

#ifndef EXTERN
#define EXTERN extern
#endif

with a follow-up #define EXTERN in a single .c file to push all of their
definitions into one spot. A pass should be made over these three later to
push these definitions into the correct files instead, but this will suffice
for now and at a more leisurely pace.

MFC after: 3 days

4 years agoFix noisy NFSv4 server printf.
rmacklem [Mon, 6 Apr 2020 23:21:39 +0000 (23:21 +0000)]
Fix noisy NFSv4 server printf.

Peter reported that his dmesg was getting cluttered with
nfsrv_cache_session: no session
messages when he rebooted his NFS server and they did not seem useful.
He was correct, in that these messages are "normal" and expected when
NFSv4.1 or NFSv4.2 are mounted and the server is rebooted.
This patch silences the printf() during the grace period after a reboot.
It also adds the client IP address to the printf(), so that the message
is more useful if/when it occurs. If this happens outside of the
server's grace period, it does indicate something is not working correctly.
Instead of adding yet another nd_XXX argument, the arguments for
nfsrv_cache_session() were simplified to take a "struct nfsrv_descript *".

Reported by: pen@lysator.liu.se
MFC after: 2 weeks

4 years agoindent: fix the -fno-common build
kevans [Mon, 6 Apr 2020 23:20:20 +0000 (23:20 +0000)]
indent: fix the -fno-common build

Spread the globals far and wide, hopefully to the files that make the most
sense.

-fno-common will become the default in GCC10/LLVM11.

MFC after: 3 days

4 years agoyp*: fix -fno-common build
kevans [Mon, 6 Apr 2020 23:16:05 +0000 (23:16 +0000)]
yp*: fix -fno-common build

This is mostly two problems spread out far and wide:
- ypldap_process should be declared properly
- debug is defined differently in many programs

For the latter, just extern it and define it everywhere that actually needs
it. This mostly works out nicely for ^/libexec/ypxfr, which can remove the
assignment at the beginning of main in favor of defining it properly.

-fno-common will become the default in GCC10/LLVM11.

MFC after: 3 days

4 years agontpd: fix build with -fno-common
kevans [Mon, 6 Apr 2020 23:11:43 +0000 (23:11 +0000)]
ntpd: fix build with -fno-common

Only a small nit here: psl should be declared extern and defined exactly
once.

-fno-common will become the default in GCC10/LLVM11.

MFC after: 3 days

4 years agokqueue tests: fix -fno-common build
kevans [Mon, 6 Apr 2020 23:08:07 +0000 (23:08 +0000)]
kqueue tests: fix -fno-common build

vnode_fd and kqfd are both shared among multiple CU; define them exactly
once.

In the case of vnode_fd, it was simply the declaration that needed
correction.

-fno-common will become the default in GCC10/LLVM11.

MFC after: 3 days

4 years agolibcasper: Constify cap_sysctl_limit_mib() mib parameter
cem [Mon, 6 Apr 2020 23:07:56 +0000 (23:07 +0000)]
libcasper: Constify cap_sysctl_limit_mib() mib parameter

No functional change. Minor API change that is nicer for consumers. ABI is
identical; the routine never needed to modify the pointed to value.

Reviewed by: emaste, markj
Differential Revision: https://reviews.freebsd.org/D24319

4 years agoRISC-V: copy the DTB to early KVA
mhorne [Mon, 6 Apr 2020 22:48:43 +0000 (22:48 +0000)]
RISC-V: copy the DTB to early KVA

The location of the device-tree blob is passed to the kernel by the
previous booting stage (i.e. BBL or OpenSBI). Currently, we leave it
untouched and mark the 1MB of memory holding it as unavailable.

Instead, do what is done by other fake_preload_metadata() routines and
copy to the DTB to KVA space. This is more in line with what loader(8)
will provide us in the future, and it allows us to reclaim the hole in
physical memory.

Reviewed by: markj, kp (earlier version)
Differential Revision: https://reviews.freebsd.org/D24152

4 years agoriscv: Make sure local hart's icache is synced in pmap_sync_icache
jrtc27 [Mon, 6 Apr 2020 22:31:30 +0000 (22:31 +0000)]
riscv: Make sure local hart's icache is synced in pmap_sync_icache

The only way to flush the local hart's icache is with a FENCE.I (or an
equivalent SBI call); a normal FENCE is insufficient and, for the
single-hart case, unnecessary.

Reviewed by: jhb (mentor), markj
Approved by: jhb (mentor), markj
Differential Revision: https://reviews.freebsd.org/D24317

4 years agoriscv: Fix pmap_fault_fixup for L3 pages
jrtc27 [Mon, 6 Apr 2020 22:29:15 +0000 (22:29 +0000)]
riscv: Fix pmap_fault_fixup for L3 pages

Summary:
The parentheses being in the wrong place means that, for L3 pages,
oldpte has all bits except PTE_V cleared, and so all the subsequent
checks against oldpte will fail, causing us to bail out and not retry
the faulting instruction after an SFENCE.VMA. This causes a WITNESS +
INVARIANTS kernel to fault on the "Chisel P3" (BOOM-based) DARPA SSITH
GFE SoC in pmap_init when writing to pv_table and, being a nofault
entry, subsequently panic with:

  panic: vm_fault_lookup: fault on nofault entry, addr: 0xffffffc004e00000

Reviewed by: markj
Approved by: markj
Differential Revision: https://reviews.freebsd.org/D24315

4 years agoRevert -r359612 as it can cause other panics.
mckusick [Mon, 6 Apr 2020 20:23:47 +0000 (20:23 +0000)]
Revert -r359612 as it can cause other panics.
An updated version will be made when the issue has been resolved.

Reported by: Peter Holm

4 years agoAdd hwpmc support for Intel Atom Goldmont microarchitecture
mw [Mon, 6 Apr 2020 19:45:26 +0000 (19:45 +0000)]
Add hwpmc support for Intel Atom Goldmont microarchitecture

Recognize new micro-architecture in hwpmc_intel driver. Based on Intel
document 325462-071US. Tested with tools/test/hwpmc/pmctest.py
on Atom E3930 SoC.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Reviewed by: kib
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D24310

4 years agoRelax too strict SES element descriptors check in r355430.
mav [Mon, 6 Apr 2020 18:42:01 +0000 (18:42 +0000)]
Relax too strict SES element descriptors check in r355430.

SES specifications allows the string to be NULL-terminated, while previous
code was considering it as invalid due to incorrectly ordered conditions.

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

4 years agoDo more argument validation under INVARIANTS when starting/stopping
tuexen [Mon, 6 Apr 2020 13:58:13 +0000 (13:58 +0000)]
Do more argument validation under INVARIANTS when starting/stopping
an SCTP timer.

MFC after: 1 week

4 years agoAdd Gordon Bergling to the authors section; remove trailing whitespace.
brueffer [Mon, 6 Apr 2020 09:59:21 +0000 (09:59 +0000)]
Add Gordon Bergling to the authors section; remove trailing whitespace.

Suggested by: rgrimes
Approved by: Gordon Bergling
X-MFC-with: r359633

4 years agoDon't drop packets having too many TCP option headers in mlx5en(4).
hselasky [Mon, 6 Apr 2020 09:50:20 +0000 (09:50 +0000)]
Don't drop packets having too many TCP option headers in mlx5en(4).

When using SACK it can happen there are multiple option headers.
Don't drop these packets, but instead limit the amount of inlining
to the maximum supported.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoEnsure a minimum inline size of 16 bytes in mlx5en(4).
hselasky [Mon, 6 Apr 2020 09:45:49 +0000 (09:45 +0000)]
Ensure a minimum inline size of 16 bytes in mlx5en(4).

This includes 14 bytes of ethernet header and 2 bytes of VLAN header.

This allows for making assumptions about the inline size limit
in the fast transmit path later on.

Use a signed integer variable to catch underflow.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoCount number of times transmit ring is out of buffers in mlx5en(4).
hselasky [Mon, 6 Apr 2020 09:41:22 +0000 (09:41 +0000)]
Count number of times transmit ring is out of buffers in mlx5en(4).

Differential Revision: https://reviews.freebsd.org/D24273
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoAdd MDIO PHY driver for NS2 ARM64 platform.
wma [Mon, 6 Apr 2020 05:48:58 +0000 (05:48 +0000)]
Add MDIO PHY driver for NS2 ARM64 platform.

Obtained from:         Semihalf
Authored by:           Kornel Duleba <mindal@semihalf.com>
Approved by:           wma
Differential Revision: https://reviews.freebsd.org/D21335

4 years agosrc.conf(5): re-roll after r359644 (LLVM_ASSERTIONS)
kevans [Mon, 6 Apr 2020 01:28:03 +0000 (01:28 +0000)]
src.conf(5): re-roll after r359644 (LLVM_ASSERTIONS)

4 years agollvm: add a build knob for enabling assertions
kevans [Mon, 6 Apr 2020 01:27:17 +0000 (01:27 +0000)]
llvm: add a build knob for enabling assertions

For head/, this will remain eternally default-on to maintain the status quo.
For stable/ branches, it should be flipped to default-off to maintain the
status quo.

There's value in being able to flip it one way or the other easily on head
or stable branches, whether you want to gain some performance back on head/
(for machines there's little chance you'll actually hit an assertion) or
potentially diagnose a problem with the version of llvm on an older branch.

Currently, stable branches get the CFLAGS+= -ndebug line uncommented; going
forward, they will instead have the default of LLVM_ASSERTIONS flipped.

Reviewed by: dim, emaste, re (gjb)
MFC after: 1 week
MFC note: flip the default of LLVM_ASSERTIONS
Differential Revision: https://reviews.freebsd.org/D24264

4 years agoChange the xid for client side krpc over UDP to a global value.
rmacklem [Sun, 5 Apr 2020 21:08:17 +0000 (21:08 +0000)]
Change the xid for client side krpc over UDP to a global value.

Without this patch, the xid used for the client side krpc requests over
UDP was initialized for each "connection". A "connection" for UDP is
rather sketchy and for the kernel NLM a new one is created every 2minutes.
A problem with client side interoperability with a Netapp server for the NLM
was reported and it is believed to be caused by reuse of the same xid.
Although this was never completely diagnosed by the reporter, I could see
how the same xid might get reused, since it is initialized to a value
based on the TOD clock every two minutes.
I suspect initializing the value for every "connection" was inherited from
userland library code, where having a global xid was not practical.
However, implementing a global "xid" for the kernel rpc is straightforward
and will ensure that an xid value is not reused for a long time. This
patch does that and is hoped it will fix the Netapp interoperability
problem.

PR: 245022
Reported by: danny@cs.huji.ac.il
MFC after: 2 weeks

4 years agoadduser: allow standard IFS characters in passwords
kevans [Sun, 5 Apr 2020 19:25:46 +0000 (19:25 +0000)]
adduser: allow standard IFS characters in passwords

Notably, the default IFS contains space/tab, thus any leading/trailing
whitespace characters tend to be removed.

Set IFS= for just the read lines to mitigate this, allowing the user to be
less surprised when their leading/trailing spaces weren't actually captured
in the password as they are with other means of setting a user's password.

PR: 245342
Submitted by: dereks_lifeofadishwasher.com
Reviewed by: jilles
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24292

4 years agobridge: Change lists to CK_LIST as a peparation for epochification
kp [Sun, 5 Apr 2020 17:15:20 +0000 (17:15 +0000)]
bridge: Change lists to CK_LIST as a peparation for epochification

Prepare the ground for a rework of the bridge locking approach. We will
use an epoch-based approach in the datapath and making it safe to
iterate over the interface, span and rtnode lists without holding the
BRIDGE_LOCK. Replace the relevant lists by their ConcurrencyKit
equivalents.

No functional change in this commit.

Reviewed by: emaste, ae, philip (previous version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24249

4 years agoMake p_vaddr % p_align == p_offset % p_align for (some) TLS segments.
kib [Sat, 4 Apr 2020 22:37:50 +0000 (22:37 +0000)]
Make p_vaddr % p_align == p_offset % p_align for (some) TLS segments.

See https://sourceware.org/bugzilla/show_bug.cgi?id=24606 for the test case.
See https://reviews.llvm.org/D64930 for the background and more discussion.

Also this fixes another bug in malloc_aligned() where total size of
the allocated memory might be not enough to fit the aligned requested
block after the initial pointer is incremented by the pointer size.

Reviewed by: bdragon
Tested by: antoine (exp-run PR 244866), bdragon, emaste
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D21163

4 years agoAdd a manpage for smbios(4).
brueffer [Sat, 4 Apr 2020 21:38:00 +0000 (21:38 +0000)]
Add a manpage for smbios(4).

Submitted by: Gordon Bergling
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23714

4 years agoRemove extra spaces for the load average of machines that are down.
nyan [Sat, 4 Apr 2020 12:07:36 +0000 (12:07 +0000)]
Remove extra spaces for the load average of machines that are down.

PR: 245296
Submitted by: martin _at_ lispworks.com
MFC after: 1 week

4 years agoFix typo
carlavilla [Sat, 4 Apr 2020 07:43:47 +0000 (07:43 +0000)]
Fix typo

4 years agomac_policy: Remove mac_policy_sx
jah [Sat, 4 Apr 2020 04:03:10 +0000 (04:03 +0000)]
mac_policy: Remove mac_policy_sx

This lock was made unnecessary by the addition of mac_policy_rms in r356120.

Reviewed by: mjg, kib
Differential Revision: https://reviews.freebsd.org/D24283

4 years agoClean up global variable declarations in the dump and restore
mckusick [Sat, 4 Apr 2020 00:56:56 +0000 (00:56 +0000)]
Clean up global variable declarations in the dump and restore
utilities so that they will compile with -fno-common.

Started by:  Kyle Evans (kevans)
Reviewed by: Kyle Evans (kevans)
MFC after:   1 week
Differential Revision: https://reviews.freebsd.org/D24210

4 years agovt: avoid overrun when stride is not a multiple of bytes per pixel
emaste [Sat, 4 Apr 2020 00:31:30 +0000 (00:31 +0000)]
vt: avoid overrun when stride is not a multiple of bytes per pixel

The reporter is developing a frame buffer driver for hardware using
3 bytes per pixel, but a stride that's a multiple of 256.  Previously
this resulted in writing beyond the end of each stride.  On the last
row this attempted to write past the end of the frame buffer, triggering
the assertion in vt_fb_mem_wr1().

PR: 243533
MFC after: 2 weeks
Submitted by: Thomas Skibo

4 years agoUpdate x86 counters
mmacy [Fri, 3 Apr 2020 22:36:22 +0000 (22:36 +0000)]
Update x86 counters

MFC after: 1 week

4 years agoANSIfy and KNF function arg definitions in libmd/md4.c
emaste [Fri, 3 Apr 2020 20:56:43 +0000 (20:56 +0000)]
ANSIfy and KNF function arg definitions in libmd/md4.c

Reported by: bde, in 2017

4 years agopowerpc/amigaone: Add CPLD driver for AmigaOne A1222 "Tabor"
jhibbits [Fri, 3 Apr 2020 20:45:16 +0000 (20:45 +0000)]
powerpc/amigaone: Add CPLD driver for AmigaOne A1222 "Tabor"

Like the X5000, the main CPLD on the A1222 is the communication medium
between the CPU and the GPIO CPLD.  It provides a mailbox communication
feature, along with dual-port RAM accessible from both the CPU and GPIO
CPLD, and 3 fan speed reporting registers.

4 years agoWhen shrinking the size of a directory it is sometimes necessary to
mckusick [Fri, 3 Apr 2020 20:43:25 +0000 (20:43 +0000)]
When shrinking the size of a directory it is sometimes necessary to
sync it to disk before shrinking it. Complete the sync before getting
the buffer for the block to be updated to do the shrink to avoid
panicing with a recursive lock on one of the directory's buffers.

Reviewed by:  Chuck Silvers (chs)
MFC after:    3 days
Sponsored by: Netflix

4 years agoConvert DOINGSOFTDEP, MOUNTEDSOFTDEP, DOINGSUJ, and MOUNTEDSUJ to being
mckusick [Fri, 3 Apr 2020 20:30:45 +0000 (20:30 +0000)]
Convert DOINGSOFTDEP, MOUNTEDSOFTDEP, DOINGSUJ, and MOUNTEDSUJ to being
boolean expressions so that their values are not lost when assigned to
`bool' or `int' variables.

Reviewed by:  Chuck Silvers (chs)
MFC after:    3 days
Sponsored by: Netflix

4 years agoelf.5: remove commented out leftovers
emaste [Fri, 3 Apr 2020 19:42:16 +0000 (19:42 +0000)]
elf.5: remove commented out leftovers

4 years agoelf.5: expand on NT_FREEBSD_FEATURE_CTL bit definitions
emaste [Fri, 3 Apr 2020 17:17:17 +0000 (17:17 +0000)]
elf.5: expand on NT_FREEBSD_FEATURE_CTL bit definitions

Based on suggestions from kib in review D23982.

Sponsored by: The FreeBSD Foundation

4 years agolldb: build and enable lua script bindings
emaste [Fri, 3 Apr 2020 16:54:13 +0000 (16:54 +0000)]
lldb: build and enable lua script bindings

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24266

4 years agoPass the real value of MK_TESTS_SUPPORT to distribution.
brooks [Fri, 3 Apr 2020 16:19:07 +0000 (16:19 +0000)]
Pass the real value of MK_TESTS_SUPPORT to distribution.

This allows kyua's config file to actually be installed.

Reported by: arichardson
Reviewed by: arichardson
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24268

4 years agopmc: diable position-independent builds, they fail to link on amd64
brooks [Fri, 3 Apr 2020 16:10:42 +0000 (16:10 +0000)]
pmc: diable position-independent builds, they fail to link on amd64

PR: 245189
Reported by: Gordon Bergling
Sponsored by: DARPA

4 years agolldb: commit generated LLDBWrapLua.cpp
emaste [Fri, 3 Apr 2020 15:55:58 +0000 (15:55 +0000)]
lldb: commit generated LLDBWrapLua.cpp

4 years agolldb: add rule to generate LLDBWrapLua.cpp
emaste [Fri, 3 Apr 2020 15:52:44 +0000 (15:52 +0000)]
lldb: add rule to generate LLDBWrapLua.cpp

Building lldb's lua/python bindings requires swig, but we do not want to
include it in the FreeBSD base system (as a build tool) because it has
non-trivial dependencies.  As a workaround, add a make rule to generate
LLDBWrapLua.cpp, and we will commit the generated file.

Requires the swig30 package.

Reviewed by: brooks
Discussed with: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24265

4 years agoInstall a kyua.conf based on the one in devel/kyua.
brooks [Fri, 3 Apr 2020 15:47:15 +0000 (15:47 +0000)]
Install a kyua.conf based on the one in devel/kyua.

The kyua.conf from examples doesn't match the expected config and
contains a lot of undesirable entries such as setting the architecture
to amd64 explicitly.

Reported by: arichardson (missing config)
Reviewed by: emaste
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D24267

4 years agoFix up r359594: -m takes an argument.
markj [Fri, 3 Apr 2020 14:47:40 +0000 (14:47 +0000)]
Fix up r359594: -m takes an argument.

PR: 244153
Reported by: 0mp
MFC with: r359594

4 years agoxargs: Fix exit status expression when a child process fails to exec.
markj [Fri, 3 Apr 2020 14:03:58 +0000 (14:03 +0000)]
xargs: Fix exit status expression when a child process fails to exec.

PR: 244327
Submitted by: thomas.duffy.99@alumni.brown.edu
MFC after: 1 week

4 years agogeom_journal: Only stop the switcher process if one was started.
markj [Fri, 3 Apr 2020 13:57:41 +0000 (13:57 +0000)]
geom_journal: Only stop the switcher process if one was started.

PR: 243196
MFC after: 1 week

4 years agoFix the description of the -m flag in top.1.
markj [Fri, 3 Apr 2020 13:35:44 +0000 (13:35 +0000)]
Fix the description of the -m flag in top.1.

PR: 244153
Submitted by: fehmi noyan isi <fnoyanisi@yahoo.com>
MFC after: 3 days

4 years agoBump date after recent changes and lint
0mp [Fri, 3 Apr 2020 13:05:26 +0000 (13:05 +0000)]
Bump date after recent changes and lint

4 years agoRemove hardcoded US Election Day from calendar.usholiday
gonzo [Fri, 3 Apr 2020 02:39:46 +0000 (02:39 +0000)]
Remove hardcoded US Election Day from calendar.usholiday

calendar(1) syntax is not capable of representing the rules for the
US Election Day. The hardcoded date was set in r15066 in 1996 and
hasn't changed since then.

PR: 173389
Reported by: Steve Ames <steve@energistic.com>
MFC after: 1 week

4 years agoFix calculation of the recurring weekdays
gonzo [Fri, 3 Apr 2020 01:17:43 +0000 (01:17 +0000)]
Fix calculation of the recurring weekdays

Both the result of the first_dayofweek_of_year and the target
weekday are zero-based (0 fo sunday) while the target month-day
or year-day is 1-based. Adjust logic accordingly.

Also add testcase for this PR to the kyua test suite

PR: 201062
Submitted by: Richard Narron <comet.berkeley@gmail.com>
MFC after: 1 week

4 years agolldb: use lua as the default script language
emaste [Thu, 2 Apr 2020 21:08:28 +0000 (21:08 +0000)]
lldb: use lua as the default script language

In the FreeBSD base system we do not have Python support in lldb, but
will have Lua support.  Make Lua the default.

This needs to be made into a configure-time option; that is being
discussed upstream and will appear in a future lldb import.  For now
carry this change as a tiny patch to our copy of lldb.

4 years agoddb(4): show lockchain: Don't dereference LK_KERNPROC
cem [Thu, 2 Apr 2020 20:47:51 +0000 (20:47 +0000)]
ddb(4): show lockchain: Don't dereference LK_KERNPROC

Also, print a little more information for otherwise unhandled inhibited states.

Finally, improve the grammar of some prints.  Some of the print statements
missing verb.

Sponsored by: Dell EMC Isilon

4 years agoUse interface fib for proxyarp checks.
melifaro [Thu, 2 Apr 2020 20:06:37 +0000 (20:06 +0000)]
Use interface fib for proxyarp checks.

Before the change, proxyarp checks for src and dst addresses
 were performed using default fib, breaking multi-fib scenario.

PR: 245181
Submitted by: Scott Aitken (original version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24244

4 years agoAdd routing tests verifying basic RTM_CHANGE functionality.
melifaro [Thu, 2 Apr 2020 20:02:33 +0000 (20:02 +0000)]
Add routing tests verifying basic RTM_CHANGE functionality.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24239

4 years agoMerge once more from ^/vendor/llvm-project/release-10.x, to get the
dim [Thu, 2 Apr 2020 19:56:43 +0000 (19:56 +0000)]
Merge once more from ^/vendor/llvm-project/release-10.x, to get the
lldb/bindings directory, which will be used to provide lua bindings for
lldb.

Requested by: emaste
MFC after: 6 weeks
X-MFC-With: 358851

4 years agoAdd lldb/bindings to vendor area, since emaste is going to add support
dim [Thu, 2 Apr 2020 19:52:43 +0000 (19:52 +0000)]
Add lldb/bindings to vendor area, since emaste is going to add support
for lldb's lua bindings.

4 years agoAdd the Cadence GEM ethernet driver to NOTES so that it gets built with
ian [Thu, 2 Apr 2020 19:06:05 +0000 (19:06 +0000)]
Add the Cadence GEM ethernet driver to NOTES so that it gets built with
LINT kernels.  Move the config for it from files.<arch> files into the
main config (conf/files), because it works on multiple platforms now.

4 years agoCadence GEM ethernet driver style clean-up, no functional changes.
ian [Thu, 2 Apr 2020 17:57:40 +0000 (17:57 +0000)]
Cadence GEM ethernet driver style clean-up, no functional changes.

This is mostly indentation whitespace, and reflowing a few multiline
comments.  This gets a bunch of minor stuff out of the way so that the diffs
for style don't clutter up the diffs for some upcoming functional changes.

Submitted by: Thomas Skibo
Differential Revision: https://reviews.freebsd.org/D24226

4 years agoAvoid checking pointers that are never NULL.
jhb [Thu, 2 Apr 2020 17:22:16 +0000 (17:22 +0000)]
Avoid checking pointers that are never NULL.

Coverity noted that cod pointer is always non-NULL at the end of
cryptodev_aead().  While here, fix cryptodev_op() to match by making
one earlier failure case before cod and crp are allocated just return
directly.

CID: 1422185
Reported by: Coverity

4 years agoRemove duplicate conditional.
jhb [Thu, 2 Apr 2020 16:55:28 +0000 (16:55 +0000)]
Remove duplicate conditional.

CID: 1422192
Reported by: Coverity

4 years agoAdd two options to recoverdisk(1) inspired by a recent
phk [Thu, 2 Apr 2020 15:17:53 +0000 (15:17 +0000)]
Add two options to recoverdisk(1) inspired by a recent
data-archæology project:

-u pattern

    Fill unread parts of the output with pattern.
    Default pattern is "_UNREAD_", empty pattern disables.

-v

    Fancy status reporting using ANSI escapes and UTF-8

4 years agoFix various Coverity-detected errors in nvmecontrol
dab [Thu, 2 Apr 2020 13:52:54 +0000 (13:52 +0000)]
Fix various Coverity-detected errors in nvmecontrol

This fixes several Coverity-detected errors in nvmecontrol. While in
here, a couple additional errors with shift/mask confusion that were
not diagnosed by Coverity are also fixed.

CIDs addressed: 104029910403001403972140397314039851403988,
1403990140437414044271404469140451014045341418118

CID 1403657 (resource leak of shared library handle) was marked
"intentional" in the Coverity scan database.

Reviewed by: vangyzen, robert.herndon_dell.com
Reviewed by: daniel.william.ryan_gmail.com (earlier version)
Reviewed by: rramsden_isilon.com (earlier version), imp
MFC after: 5 days
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D24203

4 years agoAdd NetBSD 8.2
sevan [Thu, 2 Apr 2020 11:08:19 +0000 (11:08 +0000)]
Add NetBSD 8.2

4 years agoFix mbuf handling in le advertize packet processing.
takawata [Thu, 2 Apr 2020 09:15:31 +0000 (09:15 +0000)]
Fix mbuf handling in le advertize  packet processing.

Submitted by: Marc Veldman <marc at bumblingdork.com>

4 years agoelf.5: correct and expand NT_FREEBSD_NOINIT_TAG description
emaste [Thu, 2 Apr 2020 01:03:27 +0000 (01:03 +0000)]
elf.5: correct and expand NT_FREEBSD_NOINIT_TAG description

Reported by: kib

4 years agoriscv/sifive: add FE310 Always-on driver
nick [Thu, 2 Apr 2020 00:33:15 +0000 (00:33 +0000)]
riscv/sifive: add FE310 Always-on driver

This driver supports SiFive's FE310 Always-on (AON) peripheral's
Real-time clock (RTC) and Watchdog timer (WDT). AON has other
functionality that this driver could support such as the power
management unit (PMU) but that functionality hasn't been implemented.

Reviewed by: philip (mentor), kp (mentor)
Approved by: philip (mentor)
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D24170

4 years agoelf.5: minor update to FreeBSD ELF note descriptions
emaste [Wed, 1 Apr 2020 23:36:16 +0000 (23:36 +0000)]
elf.5: minor update to FreeBSD ELF note descriptions

4 years agoNote some functions that appeared in First Edition Unix
imp [Wed, 1 Apr 2020 22:50:41 +0000 (22:50 +0000)]
Note some functions that appeared in First Edition Unix

These functions first appeared in the First Edition of Unix (or earlier in the
pdp-7 version). Just claim 1st Edition for all this. The pdp-7 code is too
fragmented at this point to extend history that far back.

4 years agoRetire procfs-based process debugging.
jhb [Wed, 1 Apr 2020 19:22:09 +0000 (19:22 +0000)]
Retire procfs-based process debugging.

Modern debuggers and process tracers use ptrace() rather than procfs
for debugging.  ptrace() has a supserset of functionality available
via procfs and new debugging features are only added to ptrace().
While the two debugging services share some fields in struct proc,
they each use dedicated fields and separate code.  This results in
extra complexity to support a feature that hasn't been enabled in the
default install for several years.

PR: 244939 (exp-run)
Reviewed by: kib, mjg (earlier version)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D23837

4 years agoSet crp_ilen for crypto requests.
jhb [Wed, 1 Apr 2020 17:09:21 +0000 (17:09 +0000)]
Set crp_ilen for crypto requests.

Assertions in crypto_dispatch() depend on this value being set to
verify that payload and AAD regions are in bounds.  Also, requests
that use a single kernel buffer rely on this to know how long the
buffer is for bus_dma, etc.

Reported by: kp

4 years agoRemove redundant development tag from include Makefile
emaste [Wed, 1 Apr 2020 16:38:45 +0000 (16:38 +0000)]
Remove redundant development tag from include Makefile

Headers are placed in the -development package via install args in rules
in share/mk/bsd.incs.mk; there is no need to explicitly modify TAGS in
include/Makefile.  (Mentioned in review D24139.)

Discussed with: manu