]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoloader: Set twiddle globaldiv to 16 by default
Colin Percival [Tue, 28 Sep 2021 18:39:59 +0000 (11:39 -0700)]
loader: Set twiddle globaldiv to 16 by default

Booting FreeBSD on an EC2 c5.xlarge instance, the loader "twiddles"
810 times over the course of 510 ms, a rate of 1.59 kHz. Even accepting
that many systems are slower than this particular VM and will take
longer to boot (especially if using spinning-rust disks), this seems
like an unhelpfully large amount of twiddling when compared to the
~60 Hz frame rate of many displays; printing the twiddles also consumes
roughly 10% of the boot time on the aforementioned VM.

Setting the default globaldiv to 16 dramatically reduces the time spent
printing twiddles to the console while still twiddling at roughly 100
Hz; this should be ample even for systems which take longer to boot and
consequently twiddle slower.

Note that this can adjusted via the twiddle_divisor variable in
loader.conf, but that file is not processed until nearly halfway
through the loader's runtime.

Reviewed by: allanjude, jrtc27, kevans
MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: <https://reviews.freebsd.org/D32163>

2 years agomgb: Update man page wrt state of the driver
Ed Maste [Tue, 28 Sep 2021 20:27:28 +0000 (16:27 -0400)]
mgb: Update man page wrt state of the driver

Be explicit that the driver has caveats and limitations, and remove the
note about not being connected to the build: I plan to connect it soon.
(Also the note serves no real purpose in a man page that is not
installed.)

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agomgb: Apply some style(9)
Ed Maste [Tue, 28 Sep 2021 20:08:14 +0000 (16:08 -0400)]
mgb: Apply some style(9)

Add parens around return values, rewrap lines

MFC after: 1 week
Fixes: 8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by: The FreeBSD Foundation

2 years agoTemporarily skip flaky tset cases under sys.aio.aio_test in CI
Li-Wen Hsu [Tue, 28 Sep 2021 19:32:47 +0000 (03:32 +0800)]
Temporarily skip flaky tset cases under sys.aio.aio_test in CI

- sys.aio.aio_test.vectored_unaligned
- sys.aio.aio_test.vectored_zvol_poll

PR: 258766
Sponsored by: The FreeBSD Foundation

2 years agoFix busdma resource leak on usb device detach.
Ian Lepore [Tue, 28 Sep 2021 19:29:10 +0000 (13:29 -0600)]
Fix busdma resource leak on usb device detach.

When a usb device is detached, usb_pc_dmamap_destroy() called
bus_dmamap_destroy() while the map was still loaded. That's harmless on x86
architectures, but on all other platforms it causes bus_dmamap_destroy() to
return EBUSY and leak away any memory resources (including bounce buffers)
associated with the mapping, as well as any allocated map structure itself.

This change introduces a new is_loaded flag to the usb_page_cache struct to
track whether a map is loaded or not. If the map is loaded,
bus_dmamap_unload() is called before bus_dmamap_destroy() to avoid leaking
away resources.

MFC after: 7 days
Differential Revision: https://reviews.freebsd.org/D32208

2 years agomgb: Staticize devclass and iflib structs (as is typical)
Ed Maste [Tue, 28 Sep 2021 18:12:58 +0000 (14:12 -0400)]
mgb: Staticize devclass and iflib structs (as is typical)

MFC after: 1 week
Fixes: 8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by: The FreeBSD Foundation

2 years agogmultipath failloop test: Put the dtrace sanity checker in right place
Li-Wen Hsu [Tue, 28 Sep 2021 18:38:34 +0000 (02:38 +0800)]
gmultipath failloop test: Put the dtrace sanity checker in right place

Check if dtrace excution is successful or not right after execution.

Sponsored by: The FreeBSD Foundation

2 years agosctp: cleanup and adding KASSERT()s, no functional change
Michael Tuexen [Tue, 28 Sep 2021 18:29:43 +0000 (20:29 +0200)]
sctp: cleanup and adding KASSERT()s, no functional change

MFC after: 1 week

2 years agoFix typo
Li-Wen Hsu [Tue, 28 Sep 2021 18:28:01 +0000 (02:28 +0800)]
Fix typo

Reported by: swills
Sponsored by: The FreeBSD Foundation

2 years agoFix memory deadlock when GELI partition is used for swap.
Gleb Smirnoff [Tue, 28 Sep 2021 18:19:29 +0000 (11:19 -0700)]
Fix memory deadlock when GELI partition is used for swap.

When we get low on memory, the VM system tries to free some by swapping
pages. However, if we are so low on free pages that GELI allocations block,
then the swapout operation cannot complete. This keeps the VM system from
being able to free enough memory so the allocation can complete.

To alleviate this, keep a UMA pool at the GELI layer which is used for data
buffer allocation in the fast path, and reserve some of that memory for swap
operations. If an IO operation is a swap, then use the reserved memory. If
the allocation still fails, return ENOMEM instead of blocking.

For non-swap allocations, change the default to using M_NOWAIT. In general,
this *should* be better, since it gives upper layers a signal of the memory
pressure and a chance to manage their failure strategy appropriately. However,
a user can set the kern.geom.eli.blocking_malloc sysctl/tunable to restore
the previous M_WAITOK strategy.

Submitted by: jtl
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D24400

2 years agoExternalize nsw_cluster_max and initialize it early.
Gleb Smirnoff [Tue, 28 Sep 2021 18:13:33 +0000 (11:13 -0700)]
Externalize nsw_cluster_max and initialize it early.

GEOM_ELI needs to know the value, cause it will soon have special
memory handling for IO operations associated with swap.

Move initialization to swap_pager_init(), which is executed at
SI_SUB_VM, unlike swap_pager_swap_init(), which would be executed
only when a swap is configured. GEOM_ELI might need the value at
SI_SUB_DRIVERS, when disks are tasted by GEOM.

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

2 years agoAdd flag BIO_SWAP to mark IOs that are associated with swap.
Gleb Smirnoff [Tue, 28 Sep 2021 18:11:50 +0000 (11:11 -0700)]
Add flag BIO_SWAP to mark IOs that are associated with swap.

Submitted by: jtl
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D24400

2 years agoqoriq_therm.c: avoid a segfault on the error exit path.
Ian Lepore [Tue, 28 Sep 2021 18:19:44 +0000 (12:19 -0600)]
qoriq_therm.c: avoid a segfault on the error exit path.

If anything goes wrong during attach() it is handled with a 'goto fail'
which calls sysctl_ctx_free().  But the sysctl context doesn't get
initialized until very late in attach(), so almost any error just results
in a segfault.  Move the sysctl_ctx_init() call to the beginning of the
attach() function, so that it is done before any errors can happen that
will lead to freeing the context.

2 years agoTemporarily skip sys.geom.class.multipath.failloop.failloop in CI
Li-Wen Hsu [Tue, 28 Sep 2021 18:02:27 +0000 (02:02 +0800)]
Temporarily skip sys.geom.class.multipath.failloop.failloop in CI

This test case uses `dtrace -c` but it has some issues at the moment

While here, add a checker for dtrace executes successfully or not to provide
a more informative error message.

PR:             258763
Sponsored by:   The FreeBSD Foundation

2 years agomgb: Do not KASSERT on error in mgb_init
Ed Maste [Tue, 28 Sep 2021 17:48:49 +0000 (13:48 -0400)]
mgb: Do not KASSERT on error in mgb_init

There's not much we can do if mii_mediachg() fails, but KASSERT is not
appropriate.

MFC after: 1 week
Fixes: 8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by: The FreeBSD Foundation

2 years agoAdd the clock for the imx8 thermal monitoring unit.
Ian Lepore [Tue, 28 Sep 2021 17:51:57 +0000 (11:51 -0600)]
Add the clock for the imx8 thermal monitoring unit.

2 years agoAdd ethernet to the standard drivers for imx8.
Ian Lepore [Tue, 28 Sep 2021 17:18:51 +0000 (11:18 -0600)]
Add ethernet to the standard drivers for imx8.

2 years agomgb: enable multicast in mgb_init
Ed Maste [Tue, 28 Sep 2021 16:06:04 +0000 (12:06 -0400)]
mgb: enable multicast in mgb_init

Receive Filtering Engine (RFE) configuration is not yet implemented,
and mgb intended to enable all broadcast, multicast, and unicast.
However, MGB_RFE_ALLOW_MULTICAST was missed (MGB_RFE_ALLOW_UNICAST was
included twice).

MFC after: 1 week
Fixes: 8890ab7758b8 ("Introduce if_mgb driver...")
Sponsored by: The FreeBSD Foundation

2 years agoboot(9): update to match reality
Mitchell Horne [Tue, 28 Sep 2021 14:36:09 +0000 (11:36 -0300)]
boot(9): update to match reality

This function was renamed to kern_reboot() in 2010, but the man page has
failed to keep in sync. Bring it up to date on the rename, add the
shutdown hooks to the synopsis, and document the (obvious) fact that
kern_reboot() does not return.

Fix an outdated reference to the old name in kern_reboot(), and leave a
reference to the man page so future readers might find it before any
large changes.

Reviewed by: imp, markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32085

2 years agosctp: fix usage of stream scheduler functions
Michael Tuexen [Tue, 28 Sep 2021 03:25:58 +0000 (05:25 +0200)]
sctp: fix usage of stream scheduler functions

sctp_ss_scheduled() should only be called for streams that are
scheduled. So call sctp_ss_remove_from_stream() before it.
This bug was uncovered by the earlier cleanup.

Reported by: syzbot+bbf739922346659df4b2@syzkaller.appspotmail.com
Reported by: syzbot+0a0857458f4a7b0507c8@syzkaller.appspotmail.com
Reported by: syzbot+a0b62c6107b34a04e54d@syzkaller.appspotmail.com
Reported by: syzbot+0aa0d676429ebcd53299@syzkaller.appspotmail.com
Reported by: syzbot+104cc0c1d3ccf2921c1d@syzkaller.appspotmail.com
MFC after: 1 week

2 years agosctp: avoid locking an already locked mutex
Michael Tuexen [Tue, 28 Sep 2021 03:14:56 +0000 (05:14 +0200)]
sctp: avoid locking an already locked mutex

Reported by: syzbot+f048680690f2e8d7ddad@syzkaller.appspotmail.com
Reported by: syzbot+0725c712ba89d123c2e9@syzkaller.appspotmail.com
MFC after: 1 week

2 years agoUse mtx_lock_spin in the gic driver
Andrew Turner [Tue, 28 Sep 2021 11:36:42 +0000 (12:36 +0100)]
Use mtx_lock_spin in the gic driver

The mutex was changed to a spin lock when the MSI/MSI-X handling was
moved from the gicv2m to the gic driver. Update the calls to lock
and unlock the mutex to the spin variant.

Submitted by: jrtc27 ("Change all the mtx_(un)lock(&sc->mutex) to be the _spin versions.")
Reported by: mw, antranigv@freebsd.am
Sponsored by: The FreeBSD Foundation

2 years agomixer(3): Add support for controlling mixer mute and volume on feeder channels.
Hans Petter Selasky [Tue, 28 Sep 2021 07:53:44 +0000 (09:53 +0200)]
mixer(3): Add support for controlling mixer mute and volume on feeder channels.

PR: 258711
Reported by: jbeich@FreeBSD.org
Differential Revision: https://reviews.freebsd.org/D31636
Sponsored by: NVIDIA Networking

2 years agosound(4): Implement mixer mute control for feeder channels.
Hans Petter Selasky [Tue, 28 Sep 2021 07:41:18 +0000 (09:41 +0200)]
sound(4): Implement mixer mute control for feeder channels.

PR: 258711
Differential Revision: https://reviews.freebsd.org/D31636
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agocxgbe(4): Update firmwares to 1.26.2.0.
Navdeep Parhar [Mon, 27 Sep 2021 23:45:56 +0000 (16:45 -0700)]
cxgbe(4): Update firmwares to 1.26.2.0.

The firmwares and the following changelog are from the "Chelsio Unified
Wire v3.15.0.0 for Linux."

Version : 1.26.2.0
Date    : 09/24/2021
====================

FIXES
-----

BASE:
- Added support for SFP+ RJ45 (0x1C).
- Fixing backward compatibility issue with older drivers when multiple
  speeds are passed to firmware.

OFLD:
- Do not touch tp_plen_max if driver is supplying tp_plen_max. This
  fixes a connection reset issue in iscsi.

ENHANCEMENTS
------------

BASE:
- Firmware header modified to add firmware binary signature.

MFC after: 1 month
Sponsored by: Chelsio Communications

2 years agoAvoid "consumer not attached in g_io_request" panic when disk lost
Kirk McKusick [Tue, 28 Sep 2021 03:03:43 +0000 (20:03 -0700)]
Avoid "consumer not attached in g_io_request" panic when disk lost
while using a UFS snapshot.

The UFS filesystem supports snapshots. Each snapshot is a file whose
contents are a frozen image of the disk partition on which the filesystem
resides. Each time an existing block in the filesystem is modified,
the filesystem checks whether that block was in use at the time that
the snapshot was taken. If so, and if it has not already been copied,
a new block is allocated from among the blocks that were not in use
at the time that the snapshot was taken and placed in the snapshot file
to replace the entry that has not yet been copied. The previous contents
of the block are copied to the newly allocated snapshot file block,
and the write to the original is then allowed to proceed.

The block allocation is done using the usual UFS_BALLOC() routine
which allocates the needed block in the snapshot and returns a
buffer that is set up to write data into the newly allocated block.
In usual filesystem operation, the contents for the new block is
copied from user space into the buffer and the buffer is then written
to the file using bwrite(), bawrite(), or bdwrite(). In the case of a
snapshot the new block must be filled from the disk block that is about
to be rewritten. The snapshot routine has a function readblock() that
it uses to read the `about to be rewritten' disk block.

/*
 * Read the specified block into the given buffer.
 */
static int
readblock(snapvp, bp, lbn)
struct vnode *snapvp;
struct buf *bp;
ufs2_daddr_t lbn;
{
struct inode *ip;
struct bio *bip;
struct fs *fs;

ip = VTOI(snapvp);
fs = ITOFS(ip);

bip = g_alloc_bio();
bip->bio_cmd = BIO_READ;
bip->bio_offset = dbtob(fsbtodb(fs, blkstofrags(fs, lbn)));
bip->bio_data = bp->b_data;
bip->bio_length = bp->b_bcount;
bip->bio_done = NULL;

g_io_request(bip, ITODEVVP(ip)->v_bufobj.bo_private);
bp->b_error = biowait(bip, "snaprdb");
g_destroy_bio(bip);
return (bp->b_error);
}

When the underlying disk fails, its GEOM module is removed.
Subsequent attempts to access it should return the ENXIO error.
The functionality of checking for the lost disk and returning
ENXIO is handled by the g_vfs_strategy() routine:

void
g_vfs_strategy(struct bufobj *bo, struct buf *bp)
{
struct g_vfs_softc *sc;
struct g_consumer *cp;
struct bio *bip;

cp = bo->bo_private;
sc = cp->geom->softc;

/*
 * If the provider has orphaned us, just return ENXIO.
 */
mtx_lock(&sc->sc_mtx);
if (sc->sc_orphaned || sc->sc_enxio_active) {
mtx_unlock(&sc->sc_mtx);
bp->b_error = ENXIO;
bp->b_ioflags |= BIO_ERROR;
bufdone(bp);
return;
}
sc->sc_active++;
mtx_unlock(&sc->sc_mtx);

bip = g_alloc_bio();
bip->bio_cmd = bp->b_iocmd;
bip->bio_offset = bp->b_iooffset;
bip->bio_length = bp->b_bcount;
bdata2bio(bp, bip);
if ((bp->b_flags & B_BARRIER) != 0) {
bip->bio_flags |= BIO_ORDERED;
bp->b_flags &= ~B_BARRIER;
}
if (bp->b_iocmd == BIO_SPEEDUP)
bip->bio_flags |= bp->b_ioflags;
bip->bio_done = g_vfs_done;
bip->bio_caller2 = bp;
g_io_request(bip, cp);
}

Only after checking that the device is present does it construct
the "bio" request and call g_io_request(). When readblock()
constructs its own "bio" request and calls g_io_request() directly
it panics with "consumer not attached in g_io_request" when the
underlying device no longer exists.

The fix is to have readblock() call g_vfs_strategy() rather than
constructing its own "bio" request:

/*
 * Read the specified block into the given buffer.
 */
static int
readblock(snapvp, bp, lbn)
struct vnode *snapvp;
struct buf *bp;
ufs2_daddr_t lbn;
{
struct inode *ip;
struct fs *fs;

ip = VTOI(snapvp);
fs = ITOFS(ip);

bp->b_iocmd = BIO_READ;
bp->b_iooffset = dbtob(fsbtodb(fs, blkstofrags(fs, lbn)));
bp->b_iodone = bdone;
g_vfs_strategy(&ITODEVVP(ip)->v_bufobj, bp);
bufwait(bp);
return (bp->b_error);
}

Here it uses the buffer that will eventually be written to the disk.
The g_vfs_strategy() routine uses four parts of the buffer: b_bcount,
b_iocmd, b_iooffset, and b_data.

The b_bcount field is already correctly set for the buffer. It is
safe to set the b_iocmd and b_iooffset fields as they are set
correctly when the later write is done. The write path will also
clear the B_DONE flag that our use of the buffer will set. The
b_iodone callback has to be set to bdone() which will do just
notification that the I/O is done in bufdone(). The rest of
bufdone() includes things like processing the softdeps associated
with the buffer should not be done until the buffer has been
written. Bufdone() will set b_iodone back to NULL after using it,
so the full bufdone() processing will be done when the buffer is
written. The final change from the previous version of readblock()
is that it used the b_data for the destination of the read while
g_vfs_strategy() uses the bdata2bio() function to take advantage
of VMIO when it is available.

Differential revision: https://reviews.freebsd.org/D32150
Reviewed by:  kib, chs
MFC after:    1 week
Sponsored by: Netflix

2 years agoBring the tags and links entries for amd64 up to date.
Kirk McKusick [Thu, 23 Sep 2021 23:38:37 +0000 (16:38 -0700)]
Bring the tags and links entries for amd64 up to date.

MFC after:    1 week
Sponsored by: Netflix

2 years agoLinuxKPI: dma-mapping.h unify "mask" and "dma_mask"
Bjoern A. Zeeb [Mon, 27 Sep 2021 20:48:02 +0000 (20:48 +0000)]
LinuxKPI: dma-mapping.h unify "mask" and "dma_mask"

In some places we are using "mask" and others "dma_mask" for the
same thing.  Harmonize the various places to "dma_mask" as used in
linux_pci.c.  For the declaration remove the argument names to
avoid the entire problem.

This is in preparation for an upcoming change.
No functional changes intended.

Sponsored by: The FreeBSD Foundation
MFC after: 5 days

2 years agontb_hw_intel: fix xeon NTB gen3 bar disable logic
David Bright [Mon, 27 Sep 2021 13:18:46 +0000 (06:18 -0700)]
ntb_hw_intel: fix xeon NTB gen3 bar disable logic

In NTB gen3 driver, it was supposed to disable NTB bar access by
default, but due to incorrect register access method, the bar disable
logic does not work as expected. Those registers should be modified
through NTB bar0 rather than PCI configuration space.

Besides, we'd better to protect ourselves from a bad buddy node so
ingress disable logic should be implemented together.

Submitted by:   Austin Zhang (austin.zhang@dell.com)
Reviewers:      markj, mav, vangyzen, dab
Differential Revision:  https://reviews.freebsd.org/D31736
Sponsored by:   Dell EMC
MFC to:      stable/12, stable/13
MFC after:   1 week

2 years agoipfilter: Correct a comment
Cy Schubert [Sat, 25 Sep 2021 06:41:22 +0000 (23:41 -0700)]
ipfilter: Correct a comment

Correct a comment's grammar and while at it clarify its meaining.

MFC after: 3 days

2 years agoipfilter: Print the correct TCP sequence index number
Cy Schubert [Sat, 25 Sep 2021 00:00:20 +0000 (17:00 -0700)]
ipfilter: Print the correct TCP sequence index number

TCP sequence numbers in the FTP proxy are maintained in a two dimensional
array. The debug message prints the same seq[N] for both. Fix that.

MFC after: 3 days

2 years agoLinuxKPI: disable device_release_driver()
Bjoern A. Zeeb [Mon, 27 Sep 2021 17:38:41 +0000 (17:38 +0000)]
LinuxKPI: disable device_release_driver()

As reported by multiple people testing iwlwifi, device_release_driver()
can lead to a panic on secondary errors (usually during attach).
Disable device_release_driver() for the short-term to prevent the panic
but leave it in place so it can be re-worked and fixed properly for
the long-term more easily.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agorman: fix overflow in rman_reserve_resource_bound()
Elliott Mitchell [Mon, 27 Sep 2021 17:13:19 +0000 (14:13 -0300)]
rman: fix overflow in rman_reserve_resource_bound()

If the default range of [0, ~0] is given, then (~0 - 0) + 1 == 0. This
in turn will cause any allocation of non-zero size to fail. Zero-sized
allocations are prohibited, so add a KASSERT to this effect.

History indicates it is part of the original rman code.  This bug may in
fact be older than some contributors.

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30280

2 years agopci_host_generic: implement bus_translate_resource (for LinuxKPI)
Greg V [Mon, 20 Sep 2021 20:05:49 +0000 (20:05 +0000)]
pci_host_generic: implement bus_translate_resource (for LinuxKPI)

In D21096 BUS_TRANSLATE_RESOURCE was introduced to allow LinuxKPI to get
physical addresses in pci_resource_start for PowerPC and implemented
in ofw_pci.
When the translation was implemented in pci_host_generic in 372c142b4fc,
this method was not implemented; instead a local static function was
added for a similar purpose.
Rename the static function to "_common" and implement the bus function
as a wrapper around that.  With this a LinuxKPI driver using
physical addresses correctly finds the configuration registers of
the GPU.
This unbreaks amdgpu on NXP Layerscape LX2160A SoC (SolidRun HoneyComb
LX2K workstation) which has a Translation Offset in ACPI for
below-4G PCI addresses.

More info: https://github.com/freebsd/drm-kmod/issues/84
Tested by: dan.kotowski_a9development.com
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30986

2 years agoamd64 sendsig: fix context corruption
Konstantin Belousov [Mon, 27 Sep 2021 16:57:25 +0000 (19:57 +0300)]
amd64 sendsig: fix context corruption

Drop fpstate only after copying out xfpustate from the thread usermode
save area. Otherwise a context switch between get_fpcontext(), which now
returns the pointer directly into user save area, and copyout, would
cause reinit of the save area, loosing user registers.

Reported, reviewed, and tested by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D32159

2 years agoFix gssd rc.d installation
Emmanuel Vadot [Mon, 27 Sep 2021 16:31:20 +0000 (18:31 +0200)]
Fix gssd rc.d installation

CONFGROUPS needs to be in CAPS

Fixes: a30235a4c360 ("pkgbase: Create a FreeBSD-kerberos package")
Reported by:     kp

2 years agoe1000: Re-arm link changes
Kevin Bowling [Mon, 27 Sep 2021 16:17:48 +0000 (09:17 -0700)]
e1000: Re-arm link changes

A change to MSI-X link handler was somehow causing issues on
MSI-based em(4) NICs.

Revert the change based on user reports and testing.

PR: 258551
Reported by: Franco Fichtner <franco@opnsense.org>, t_uemura@macome.co.jp
Reviewed by: markj, Franco Fichtner <franco@opnsense.org>
Tested by: t_uemura@macome.co.jp
MFC after: 1 day

2 years agoCheck cpu_softc is not NULL before dereferencing
Andrew Turner [Mon, 27 Sep 2021 11:22:15 +0000 (12:22 +0100)]
Check cpu_softc is not NULL before dereferencing

In the acpi_cpu_postattach SYSINIT function cpu_softc may be NULL, e.g.
on arm64 when booting from FDT. Check it is not NULL at the start of
the function so we don't try to dereference a NULL pointer.

Sponsored by: The FreeBSD Foundation

2 years agoAdd myself to calendar.freebsd
Yasuhiro Kimura [Mon, 27 Sep 2021 07:46:54 +0000 (16:46 +0900)]
Add myself to calendar.freebsd

It corresponds to the 9th step of the procedure described in section
7.1 of Committer's Guide.

Approved by: meta (mentor)
Differential Revision: https://reviews.freebsd.org/D32153

2 years agosyslogd: undo regression after r326573
Eugene Grosbein [Mon, 27 Sep 2021 07:25:21 +0000 (14:25 +0700)]
syslogd: undo regression after r326573

Restore ability for our syslogd to collect pre-RFC3164 formatted
messages from remote hosts that was broken with r326573.

For example, the line from Cisco SCE8000 splitted for readability:

1130: 03:37:57: %USER-6-PORT_OPERSTATUS_CHANGE_TRAP: CPU#000 trap:link
down EntityAdminState: 4  EntityAlarmStatus: 32

Such line was collected and stored before mentioned change
but silently dropped after that. Now syslogd saves it again.

Note that parsing of RFC5424 format not changed.

MFC after: 1 month

2 years agoAdd myself as ports committer and update mentor/mentee information
Yasuhiro Kimura [Mon, 27 Sep 2021 05:37:16 +0000 (14:37 +0900)]
Add myself as ports committer and update mentor/mentee information

It corresponds to the 5th step of the procedure described in section
7.1 of Committer's Guide.

Approved by: meta (mentor)
Differential Revision: https://reviews.freebsd.org/D32151

2 years agoipsec: fix typo part2
Wojciech Macek [Mon, 27 Sep 2021 05:46:56 +0000 (07:46 +0200)]
ipsec: fix typo part2

2 years agoipsec: fix typo in comment
Wojciech Macek [Mon, 27 Sep 2021 05:45:33 +0000 (07:45 +0200)]
ipsec: fix typo in comment

2 years agomount: make libxo support more locale-aware
Piotr Pawel Stefaniak [Sun, 26 Sep 2021 20:50:28 +0000 (22:50 +0200)]
mount: make libxo support more locale-aware

"special", "node", and "mounter" are not guaranteed to be encoded with
UTF-8. Use the appropriate modifier.

Reported by: eugen@

2 years agofusefs: implement FUSE_NO_OPEN_SUPPORT and FUSE_NO_OPENDIR_SUPPORT
Alan Somers [Sat, 25 Sep 2021 03:53:28 +0000 (21:53 -0600)]
fusefs: implement FUSE_NO_OPEN_SUPPORT and FUSE_NO_OPENDIR_SUPPORT

For file systems that allow it, fusefs will skip FUSE_OPEN,
FUSE_RELEASE, FUSE_OPENDIR, and FUSE_RELEASEDIR operations, a minor
optimization.

MFC after: 2 weeks
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D32141

2 years agofusefs: diff reduction in fuse_kernel.h
Alan Somers [Sat, 25 Sep 2021 14:23:54 +0000 (08:23 -0600)]
fusefs: diff reduction in fuse_kernel.h

Synchronize formatting and documentation in fuse_kernel.h with upstream
sources.

MFC after: 2 weeks
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D32141

2 years agonfscl: Add a check for "has acquired a delegation" to nfscl_removedeleg()
Rick Macklem [Mon, 27 Sep 2021 01:37:25 +0000 (18:37 -0700)]
nfscl: Add a check for "has acquired a delegation" to nfscl_removedeleg()

Commit 5e5ca4c8fc53 added a flag to a NFSv4 mount point that is set when
the first delegation is acquired from the NFSv4 server.

For a common case where delegations are not being issued by the
NFSv4 server, the nfscl_removedeleg() code acquires the mutex lock for
open/lock state, finds the delegation list empty, then just unlocks the
mutex and returns. This patch adds a check of the flag to avoid the
need to acquire the mutex for this common case.

This change appears to be performance neutral for a small number
of opens, but should reduce lock contention for a large number of opens
for the common case where server is not issuing delegations.

This commit should not affect the high level semantics of delegation
handling.

MFC after:      2 weeks

2 years agoixgbe: whitespace cleanup pass
Kevin Bowling [Sun, 26 Sep 2021 18:29:00 +0000 (11:29 -0700)]
ixgbe: whitespace cleanup pass

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D32131

2 years agoixgbe: Rename 'struct adapter' to 'struct ixgbe_softc'
Kevin Bowling [Sat, 25 Sep 2021 23:12:23 +0000 (16:12 -0700)]
ixgbe: Rename 'struct adapter' to 'struct ixgbe_softc'

Rename the 'struct adapter' to 'struct ixgbe_softc' to avoid type
ambiguity in things like kgdb.

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D32131

2 years agoe1000: Fix tabstop width in if_em.h
Kevin Bowling [Sun, 26 Sep 2021 16:24:53 +0000 (09:24 -0700)]
e1000: Fix tabstop width in if_em.h

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

2 years agosched_ule(4): Fix hang with steal_thresh < 2.
Alexander Motin [Sun, 26 Sep 2021 16:03:05 +0000 (12:03 -0400)]
sched_ule(4): Fix hang with steal_thresh < 2.

e745d729be60 caused infinite loop with interrupts disabled in load
stealing code if steal_thresh set below 2.  Such configuration should
not generally be used, but appeared some people are using it to
workaround some problems.

To fix the problem explicitly pass to sched_highest() minimum number
of transferrable threads, supported by the caller, instead of guessing.

MFC after: 25 days

2 years agonetmap: fix uint32_t overflow in pool size calculation
Vincenzo Maffione [Sun, 26 Sep 2021 13:56:33 +0000 (13:56 +0000)]
netmap: fix uint32_t overflow in pool size calculation

MFC after: 1 week

2 years agonetmap: monitor: support offsets in copy mode
Vincenzo Maffione [Sun, 26 Sep 2021 13:52:16 +0000 (13:52 +0000)]
netmap: monitor: support offsets in copy mode

2 years agonemtap: lb app: Validate ihl field when hashing packet
Vincenzo Maffione [Sun, 26 Sep 2021 13:44:51 +0000 (13:44 +0000)]
nemtap: lb app: Validate ihl field when hashing packet

MFC after: 1 week

2 years agojail(9): Fix a typo in a comment
Gordon Bergling [Sun, 26 Sep 2021 13:17:41 +0000 (15:17 +0200)]
jail(9): Fix a typo in a comment

- s/erorr/error/

MFC after: 3 days

2 years agonfsclient: Fix a typo in a comment
Gordon Bergling [Sun, 26 Sep 2021 13:17:00 +0000 (15:17 +0200)]
nfsclient: Fix a typo in a comment

- s/derefernce/dereference/

MFC after: 3 days

2 years agosctp: Fix a typo in a comment
Gordon Bergling [Sun, 26 Sep 2021 13:15:39 +0000 (15:15 +0200)]
sctp: Fix a typo in a comment

- s/assue/assume/

MFC after: 3 days

2 years agoSpell cloudabi correctly in ObsoleteFiles.inc
Dimitry Andric [Sun, 26 Sep 2021 11:26:42 +0000 (13:26 +0200)]
Spell cloudabi correctly in ObsoleteFiles.inc

Fixes: cf0ee8738e31 Drop cloudabi

2 years agopcm(4): Fix a common typo in source code comments
Gordon Bergling [Sun, 26 Sep 2021 09:21:16 +0000 (11:21 +0200)]
pcm(4): Fix a common typo in source code comments

- s/prefered/preferred/

MFC after: 3 days

2 years agocontrib/tzdata: import tzdata 2021b
Philip Paeps [Sun, 26 Sep 2021 06:45:39 +0000 (14:45 +0800)]
contrib/tzdata: import tzdata 2021b

Merge commit 'a5725262945a2971af3b808088217fe975e8364e'

Changes: https://github.com/eggert/tz/blob/2021b/NEWS

MFC after: 3 days

2 years agoImport tzdata 2021b
Philip Paeps [Sun, 26 Sep 2021 06:35:07 +0000 (14:35 +0800)]
Import tzdata 2021b

2 years agokern_ctf: Use zlib's uncompress function for simpler code.
Yoshihiro Ota [Sun, 26 Sep 2021 06:28:43 +0000 (23:28 -0700)]
kern_ctf: Use zlib's uncompress function for simpler code.

Reviewed by: markj, delphij
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D21531

2 years agouart: Add PCI ID for intel 100 Series/C230 Series AMT
Sean Bruno [Sat, 25 Sep 2021 22:23:08 +0000 (15:23 -0700)]
uart: Add PCI ID for intel 100 Series/C230 Series AMT

Reviewed by: kib
Tested by: kbowling
Differential Revision: https://reviews.freebsd.org/D32146

2 years agoacpi_cpu: Fix panic if some CPU devices are disabled.
Alexander Motin [Sat, 25 Sep 2021 20:54:28 +0000 (16:54 -0400)]
acpi_cpu: Fix panic if some CPU devices are disabled.

While there, remove couple unneeded global variables.

2 years agoefi loader: Call tslog_init from efi_main
Colin Percival [Sat, 25 Sep 2021 19:04:06 +0000 (12:04 -0700)]
efi loader: Call tslog_init from efi_main

We were calling tslog_init from main; no reason to wait that long.

Fixes: f49381ccb6bc efi/loader: Call tslog_init
Sponsored by: https://www.patreon.com/cperciva

2 years agomount: Don't pass a NULL format string to xo_err().
John Baldwin [Sat, 25 Sep 2021 18:51:01 +0000 (11:51 -0700)]
mount: Don't pass a NULL format string to xo_err().

This fixes a -Wformat error from GCC 9.

Fixes: e725ee7eb672 mount: add libxo(3) support

2 years agomana: Cast an unused value to void to quiet a warning.
John Baldwin [Sat, 25 Sep 2021 18:28:14 +0000 (11:28 -0700)]
mana: Cast an unused value to void to quiet a warning.

This appeases a -Wunused-value warning from GCC 9.

Reviewed by: whu
Differential Revision: https://reviews.freebsd.org/D31948

2 years agobhyve: Add an empty case for event types in mevent_kq_fflags().
John Baldwin [Sat, 25 Sep 2021 18:25:25 +0000 (11:25 -0700)]
bhyve: Add an empty case for event types in mevent_kq_fflags().

This fixes a -Wswitch error raised by GCC 9.

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

2 years agokernel: Disable errors for -Walloca-larger-than for GCC.
John Baldwin [Sat, 25 Sep 2021 18:24:35 +0000 (11:24 -0700)]
kernel: Disable errors for -Walloca-larger-than for GCC.

GCC complains about the use of alloca() with variable sizes (for XSAVE
state len) in sendsig() for i386.  Modern XSAVE state is probably
getting a bit large for the i386 kstack, but downgrade the error to a
warning.

Reviewed by: kib, emaste
Differential Revision: https://reviews.freebsd.org/D31934

2 years agobhyve_config.5: Document gdb.address.
John Baldwin [Sat, 25 Sep 2021 17:07:18 +0000 (10:07 -0700)]
bhyve_config.5: Document gdb.address.

2 years agobhyve: Update the -G description in the SYNPOSIS.
John Baldwin [Sat, 25 Sep 2021 17:01:43 +0000 (10:01 -0700)]
bhyve: Update the -G description in the SYNPOSIS.

It was missing both the 'w' flag and 'bind_address'.

2 years agounzip: sync with NetBSD upstream to add passphrase support
Yoshihiro Takahashi [Sat, 25 Sep 2021 16:32:42 +0000 (01:32 +0900)]
unzip: sync with NetBSD upstream to add passphrase support

- Add support for password protected zip archives.
  We use memset_s() rather than explicit_bzero() for more portable
  (See PR).
- Use success/failure macro in exit()
- Mention ZIPX format in unzip(1)

Submitted by: Mingye Wang and Alex Kozlov (ak@)
PR: 244181
Reviewed by: mizhka
Obtained from: NetBSD
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28892

2 years agong_ether: Create netgraph nodes for bridge interfaces.
Yoshihiro Takahashi [Sat, 25 Sep 2021 16:24:33 +0000 (01:24 +0900)]
ng_ether: Create netgraph nodes for bridge interfaces.

Create netgraph nodes for bridge interfaces when the ng_ether module
is loaded.  If a bridge interface is created after loading the ng_ether
module, a netgraph node is created via ether_ifattach().

MFC after: 1 week

2 years agommc: fix 1-byte reallocs (when it should have been sizeof device_t)
Mateusz Guzik [Sat, 25 Sep 2021 12:49:43 +0000 (14:49 +0200)]
mmc: fix 1-byte reallocs (when it should have been sizeof device_t)

Reported by KASAN:
panic: ASan: Invalid access, 8-byte write at 0xfffffe00f0992610, RedZonePartial(1)
panic() at panic+0xb5/frame 0xffffffff86a595b0
__asan_store8_noabort() at __asan_store8_noabort+0x376/frame 0xffffffff86a59670
mmc_go_discovery() at mmc_go_discovery+0x6c61/frame 0xffffffff86a5a790
mmc_delayed_attach() at mmc_delayed_attach+0x35/frame 0xffffffff86a5a7b0
[snip]

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agofifo: support flock
Mateusz Guzik [Sat, 25 Sep 2021 12:24:39 +0000 (14:24 +0200)]
fifo: support flock

This evens it up with Linux.

Original patch by: Greg V <greg@unrelenting.technology>
Differential Revision: https://reviews.freebsd.org/D24255#565302

2 years agoamd64: Remove proc0_tf, the bootstrap trapframe
Mark Johnston [Sat, 25 Sep 2021 14:18:52 +0000 (10:18 -0400)]
amd64: Remove proc0_tf, the bootstrap trapframe

It no longer serves any purpose as thread0's td_frame field is now
initialized during fpuinitstate().  No functional change intended.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32057

2 years agoamd64: Avoid copying td_frame from kernel procs
Mark Johnston [Sat, 25 Sep 2021 14:15:31 +0000 (10:15 -0400)]
amd64: Avoid copying td_frame from kernel procs

When creating a new thread, we unconditionally copy td_frame from the
creating thread.  For threads which never return to user mode, this is
unnecessary since td_frame just points to the base of the stack or a
random interrupt frame.

If KASAN is configured this copying may also trigger false positives
since the td_frame region may contain poisoned stack regions.  It was
not noticed before since thread0 used a dummy proc0_tf trapframe, and
kernel procs are generally created by thread0.  Since commit
df8dd6025af88a99d34f549fa9591a9b8f9b75b1, though, we call
cpu_thread_alloc(&thread0) when initializing FPU state, which
reinitializes thread0.td_frame.

Work around the problem by not copying the frame unless the copying
thread came from user mode.  While here, de-duplicate the copying and
remove redundant re(initialization) of td_frame.

Reported by: syzbot+2ec89312bffbf38d9aec@syzkaller.appspotmail.com
Reviewed by: kib
Fixes: df8dd6025af8
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32057

2 years agocam: Avoiding waking up doneq threads if we're dumping
Mark Johnston [Sat, 25 Sep 2021 14:13:56 +0000 (10:13 -0400)]
cam: Avoiding waking up doneq threads if we're dumping

Depending on the state of the target doneq thread at the time of the
panic, the wakeup can hang indefinitely in thread_lock_block_wait().
That function should likely be modified to return immediately if the
scheduler is stopped, but it is also preferable to avoid wakeups in
general after a panic.

Reported by: pho
Reviewed by: mav, imp
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32126

2 years agox86 bounce_bus_dmamem_alloc(): use malloc_aligned() only when possible
Konstantin Belousov [Fri, 24 Sep 2021 17:46:47 +0000 (20:46 +0300)]
x86 bounce_bus_dmamem_alloc(): use malloc_aligned() only when possible

malloc_domainset_aligned() requires that alignment is less than
page size. Fall back to other allocation methods, most likely
kmem_alloc_contig(), when malloc_aligned() cannot fullfill the driver
request.

Reported by: Loic F <loic.f@hardenedbsd.org>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32127

2 years agomalloc_aligned(9): allow zero size and alignment
Konstantin Belousov [Fri, 24 Sep 2021 19:38:53 +0000 (22:38 +0300)]
malloc_aligned(9): allow zero size and alignment

For alignment we do not need to do anything to make it operational.
For size, upgrade zero sized request to one byte so that we do not
request insane amount of memory for placeholder.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32127

2 years agonet80211(4): Fix a few common typos in source code comments
Gordon Bergling [Sat, 25 Sep 2021 11:57:41 +0000 (13:57 +0200)]
net80211(4): Fix a few common typos in source code comments

- s/annoucement/announcement/
- s/setings/settings/

MFC after: 1 week

2 years agoubsan: Fix a typo in an error message
Gordon Bergling [Sat, 25 Sep 2021 09:47:24 +0000 (11:47 +0200)]
ubsan: Fix a typo in an error message

- s/asumption/assumption/

Obtained from: NetBSD
MFC after: 1 week

2 years agohostname: avoid strcpy() overlap in -d flag handling
Kyle Evans [Sat, 25 Sep 2021 05:00:31 +0000 (00:00 -0500)]
hostname: avoid strcpy() overlap in -d flag handling

We don't need the strcpy() anyways, just use a pointer to the hostname
buffer and move it forward for `hostname -d`.

Sponsored by: Klara, Inc.

2 years ago[fib_algo][dxr] Split unused range chunk list in multiple buckets
Marko Zec [Sat, 25 Sep 2021 04:29:48 +0000 (06:29 +0200)]
[fib_algo][dxr] Split unused range chunk list in multiple buckets

Traversing a single list of unused range chunks in search for a block
of optimal size was suboptimal.

The experience with real-world BGP workloads has shown that on average
unused range chunks are tiny, mostly in length from 1 to 4 or 5, when
DXR is configured with K = 20 which is the current default (D16X4R).

Therefore, introduce a limited amount of buckets to accomodate descriptors
of empty blocks of fixed (small) size, so that those can be found in O(1)
time.  If no empty chunks of the requested size can be found in fixed-size
buckets, the search continues in an unsorted list of empty chunks of
variable lengths, which should only happen infrequently.

This change should permit us to manage significantly more empty range
chunks without sacrifying the speed of incremental range table updating.

MFC after: 3 days

2 years agoMake CPU children explicitly share parent unit numbers.
Alexander Motin [Sat, 25 Sep 2021 03:25:46 +0000 (23:25 -0400)]
Make CPU children explicitly share parent unit numbers.

Before this device unit number match was coincidental and broke if I
disabled some CPU device(s).  Aside of cosmetics, for some drivers
(may be considered broken) it caused talking to wrong CPUs.

2 years agoloader printf: Profile with TSLOG
Colin Percival [Sat, 25 Sep 2021 03:20:33 +0000 (20:20 -0700)]
loader printf: Profile with TSLOG

Now that the loader tslog code doesn't call printf, we can profile
printf using TSLOG.  On an EC2 c5.xlarge instance, we spend roughly
45 ms here (out of roughly 500 ms), presumably due to the time spent
writing output to the console.

MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva

2 years agoloader tslog: Don't use sprintf
Colin Percival [Sat, 25 Sep 2021 03:19:38 +0000 (20:19 -0700)]
loader tslog: Don't use sprintf

Instead, append the log entry "manually".

MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva

2 years agomakesyscalls: sprinkle some assert() on standard function calls
Kyle Evans [Wed, 27 Jan 2021 18:12:33 +0000 (12:12 -0600)]
makesyscalls: sprinkle some assert() on standard function calls

Improves our error reporting, ensuring that we aren't just ignoring
errors in the common case.

Note specifically the boundary where we have to change up our error
handling approach.  It's fine to error() out up until we create the
tempdir, then the rest should try to handle it gracefully and abort().
A future change will clean this up further by pcall'ing all of the bits
that cannot currently error() without cleaning up.

2 years agomakesyscalls: rip out arbitrary command execution
Kyle Evans [Fri, 24 Sep 2021 01:04:36 +0000 (20:04 -0500)]
makesyscalls: rip out arbitrary command execution

This was previously needed only for CloudABI, which used it to generate
its capenabled from syscalls.master.  CloudABI was removed in
cf0ee8738e31, so we don't need to support this anymore.  Others looking
to do similar things should come up with a more integrated technique,
such as a .conf flag or pattern/glob support.  brooks suggests that it
could be done in modern makesyscalls.lua by adding a config flag to
specify always-on/initial flags (CAPENABLED).

Reviewed by: brooks, imp
MFC after: never
Differential Revision: https://reviews.freebsd.org/D32095

2 years agomakesyscalls: stop trying to remove . and .. in cleanup
Kyle Evans [Wed, 27 Jan 2021 17:46:15 +0000 (11:46 -0600)]
makesyscalls: stop trying to remove . and .. in cleanup

lfs.dir() will include these entries, but os.remove() cannot remove them
for obvious reasons.

2 years agoacpi_cpu: Make device unit numbers match OS CPU IDs.
Alexander Motin [Sat, 25 Sep 2021 01:03:02 +0000 (21:03 -0400)]
acpi_cpu: Make device unit numbers match OS CPU IDs.

There are already APIC ID, ACPI ID and OS ID for each CPU.  In perfect
world all of those may match, but at least for SuperMicro server boards
none of them do.  Plus none of them match the CPU devices listing order
by ACPI.  Previous code used the ACPI device listing order to number
cpuX devices.  It looked nice from NewBus perspective, but introduced
4th different set of IDs. Extremely confusing one, since in some places
the device unit numbers were treated as OS CPU IDs (coretemp), but not
in others (sysctl dev.cpu.X.%location).

2 years agoe1000: Rename 'struct adapter' to 'struct e1000_sc'
Kevin Bowling [Sat, 25 Sep 2021 00:09:43 +0000 (17:09 -0700)]
e1000: Rename 'struct adapter' to 'struct e1000_sc'

Rename the 'struct adapter' to 'struct e1000_sc' to avoid type ambiguity
in things like kgdb.

Reviewed by: jhb, markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D32129

2 years agobus: Cleanup device_probe_child()
Alexander Motin [Sat, 25 Sep 2021 00:27:10 +0000 (20:27 -0400)]
bus: Cleanup device_probe_child()

When device driver probe method returns 0, i.e. absolute priority, do
not remove its class from the device just to set it back few lines
later, that may change the device unit number, etc. and after which
we'd better call the probe again.

If during search we found some driver with absolute priority, we do
not need to set device driver and class since we haven't removed them
before.

It should not happen, but if second probe method call failed, remove
the driver and possibly the class from the device as it was when we
started.

Reviewed by: imp, jhb
Differential Revision: https://reviews.freebsd.org/D32125

2 years agomount: add libxo(3) support
Cameron Katri [Thu, 23 Sep 2021 20:51:30 +0000 (22:51 +0200)]
mount: add libxo(3) support

Adds --libxo to mount(8).

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

2 years agobus: Fix LINT / BUS_DEBUG build
Warner Losh [Fri, 24 Sep 2021 20:03:10 +0000 (14:03 -0600)]
bus: Fix LINT / BUS_DEBUG build

Fix 0389e9be63c5e for LINT built. Removed an arg only from code
under BUS_DEBUG w/o rebuilding LINT...

Sponsored by: Netflix
Fixes: 0389e9be63c5e24ecedbb366c5682ddc2ff4de60
2 years agops: fix `ps -aa`
Math Ieu [Fri, 24 Sep 2021 06:58:40 +0000 (08:58 +0200)]
ps: fix `ps -aa`

Passing the -a flag multiple times made ps show no processes.

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

2 years agoopencrypto: Disallow requests which pass VERIFY_DIGEST without a MAC
Mark Johnston [Fri, 24 Sep 2021 19:04:45 +0000 (15:04 -0400)]
opencrypto: Disallow requests which pass VERIFY_DIGEST without a MAC

Otherwise we can end up comparing the computed digest with an
uninitialized kernel buffer.

In cryptoaead_op() we already unconditionally fail the request if a
pointer to a digest buffer is not specified.

Based on a patch by Simran Kathpalia.

Reported by: syzkaller
Reviewed by: jhb
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/529
Differential Revision: https://reviews.freebsd.org/D32124

2 years agoloader: dev_net.c should use __func__ with printf
Toomas Soome [Fri, 24 Sep 2021 14:07:20 +0000 (17:07 +0300)]
loader: dev_net.c should use __func__ with printf

We have printf calls with function name hardwired to string,
sometimes wrong name. Use __func__ instead.

MFC after: 1 week

2 years agoipfilter: Locking sysctls here is not required
Cy Schubert [Fri, 24 Sep 2021 18:18:42 +0000 (11:18 -0700)]
ipfilter: Locking sysctls here is not required

Locking of data structures touched by sysctls is more finely locked
in ipflter therefore higher level locks are redundant.

MFC after: 3 days

2 years agoipfilter: Avoid a null if-then-else blocks
Cy Schubert [Wed, 22 Sep 2021 04:58:08 +0000 (21:58 -0700)]
ipfilter: Avoid a null if-then-else blocks

When WITHOUT_INET6 is selected we generate a null if-then-else blocks
due to incorrect placment of #if statments. Move the #if statements
reducing unnecessary runtime comparisons WITHOUT_INET6.

MFC after: 1 week