]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agortld: trace preloaded objects
Konstantin Belousov [Wed, 30 Mar 2022 21:01:54 +0000 (00:01 +0300)]
rtld: trace preloaded objects

Before, preloaded objects, if not listed as needed for any normally
linked objects, were silently ignored.

Preloaded objects are printed with the `[preloaded]` herald. The list
includes the objects not listed explicitly as recursive dependencies of
the main object, effectively dsos loaded by LD_PRELOAD mechanism.
vdso is listed as well, since it is not needed by anything.

Since there is no DT_NEEDED entry for LD_PRELOADed objects, they are
usually printed using LD_TRACE_LOADED_OBJECTS_FTM2 format due to the
failure of the heuristic based on the presence of the 'lib' prefix.

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

2 years agortld trace_loaded_objects(): use bool for the list_containers variable
Konstantin Belousov [Wed, 30 Mar 2022 22:17:59 +0000 (01:17 +0300)]
rtld trace_loaded_objects(): use bool for the list_containers variable

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

2 years agortld: use style(9) for trace_loaded_objects()
Konstantin Belousov [Wed, 30 Mar 2022 20:48:43 +0000 (23:48 +0300)]
rtld: use style(9) for trace_loaded_objects()

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

2 years agortld: extract printer for a single traced object into a helper
Konstantin Belousov [Wed, 30 Mar 2022 20:46:21 +0000 (23:46 +0300)]
rtld: extract printer for a single traced object into a helper

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

2 years agortld: extract calculation of the format strings for trace into a helper
Konstantin Belousov [Wed, 30 Mar 2022 20:35:37 +0000 (23:35 +0300)]
rtld: extract calculation of the format strings for trace into a helper

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

2 years agortw88: add man pages and hook up to build
Bjoern A. Zeeb [Wed, 30 Mar 2022 22:36:03 +0000 (22:36 +0000)]
rtw88: add man pages and hook up to build

Add man pages for rtw88 and rtw88fw.  Install a copy of the firmware
license file and hook up the driver and firmware modules to the build.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Relnotes: yes

2 years agortw88: import firmware for Realtek's rtw88 supported chipsets.
Bjoern A. Zeeb [Wed, 30 Mar 2022 22:06:14 +0000 (22:06 +0000)]
rtw88: import firmware for Realtek's rtw88 supported chipsets.

Import the most recent versions of the firmware images for the
rtw88 driver.

This is based on linux-firmware at 681281e49fb6778831370e5d94e6e1d97f0752d6.

The license of the firmware matches the previous rtwnfw(4) firmware
files (modulo a Copyright year) and you can find a copy in
sys/contrib/dev/rtw88fw/LICENCE.rtlwifi_firmware.txt.

Add build infrastructure to create the .ko files but do not yet hook
it up to the build until all parts are in the tree.

Approved by: core (imp)
MFC after: 2 weeks

2 years agortw88: import Realtek's rtw88 driver
Bjoern A. Zeeb [Wed, 30 Mar 2022 21:54:04 +0000 (21:54 +0000)]
rtw88: import Realtek's rtw88 driver

Import rtw88 based on wireless-testing at
5d5d68bcff1f7ff27ba0b938a4df5849849b47e3 with adjustments for FreeBSD.

While our version of the driver has knowledge about the incapablity
of DMA above 4GB we do see errors if people have more than that
often already showing when laoding firmware.
The problem for that is currently believed to be outside this driver
so importing it anyway for now.

Given the lack of full license texts on non-local files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Approved by: core (imp) [1]
MFC after: 2 weeks

2 years agouart(4): Add a concept of "unique" serial devices
Colin Percival [Tue, 29 Mar 2022 07:41:37 +0000 (00:41 -0700)]
uart(4): Add a concept of "unique" serial devices

FreeBSD detects serial ports twice: First, very early in the boot
process, in order to obtain a usable console; and second, during
the device probe/attach process.  When a UART is discovered during
device probing, FreeBSD attempts to determine whether it is a
device which was already being used as a console; without this,
the console doesn't work in userland.

Unfortunately it's possible for a UART to be mapped to a different
location in memory when it is discovered on a bus than it has when
it is announced via the ACPI SPCR table; this breaks the matching
process, which relies on comparing bus addresses.

To address this, we introduce a concept of "unique" serial devices,
i.e. devices which are guaranteed to be present *only once* on any
system.  If we discover one of these during device probing, we can
match it to a same-PCI-vendor-and-device-numbers console which was
announced via the ACPI SPCR table, regardless of the differing bus
addresses.

At present, the only unique serial device is the "Amazon PCI serial
device" (vendor 0x1d0f, device 0x8250) found in some EC2 instances.
This unbreaks the serial console on those systems.

Reviewed by: imp
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D34703

2 years agobectl: add some discussion about boot environment layouts
Kyle Evans [Thu, 31 Mar 2022 22:41:53 +0000 (17:41 -0500)]
bectl: add some discussion about boot environment layouts

Discuss the standard type of layout, as well as the "deep" BE layout,
and some of the properties of both.  Point the various -r flags at this
new section, to help users understand which they're working with and
what the -r flag is actually doing. Note that we may just deprecate the
-r flag in future versions, but the flag will be recognized as a NOP at
that point.

Reviewed by: pauamma_gundo.com, rew
Differential Revision: https://reviews.freebsd.org/D34538

2 years agoMFV 7b495a2a7abf (zlib): Correct incorrect inputs provided to the CRC
Xin LI [Thu, 31 Mar 2022 22:35:58 +0000 (15:35 -0700)]
MFV 7b495a2a7abf (zlib): Correct incorrect inputs provided to the CRC
functions.

MFC after: 3 days

2 years agoCorrect incorrect inputs provided to the CRC functions.
Mark Adler [Wed, 30 Mar 2022 18:14:53 +0000 (11:14 -0700)]
Correct incorrect inputs provided to the CRC functions.

The previous releases of zlib were not sensitive to incorrect CRC
inputs with bits set above the low 32. This commit restores that
behavior, so that applications with such bugs will continue to
operate as before.

(cherry picked from commit ec3df00224d4b396e2ac6586ab5d25f673caa4c2)

2 years agovm_phys: check small blocks to finish allocation
Doug Moore [Thu, 31 Mar 2022 21:19:55 +0000 (16:19 -0500)]
vm_phys: check small blocks to finish allocation

In vm_phys_alloc_queues_contig, in the case that a sequence of
max-order blocks are sought to fulfill an allocation, a sequence is
ruled out if it does not have enough max-order blocks to satisfy the
allocation. However, there may be smaller blocks of free memory that
follow the last max-order block in the sequence, and they may be big
enough to complete the allocation request, so check for that
possibility before giving up on that block sequence.

Reviewed by: markj
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D34724

2 years agolinsysfs: plug set-but-not-used vars.
Dmitry Chagin [Thu, 31 Mar 2022 20:49:26 +0000 (23:49 +0300)]
linsysfs: plug set-but-not-used vars.

MFC after: 2 weeks

2 years agostge: fix null pointer dereference
Tong Zhang [Thu, 31 Mar 2022 18:16:55 +0000 (14:16 -0400)]
stge: fix null pointer dereference

stge_attach() could fail at line 464, sc->sc_spec remains NULL when
calling stge_detach(), thus bus_release_resources() at line 704 will
trigger null pointer dereference. We need to check the nulliness before
calling bus_release_resources().

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

2 years agolibbe: pull props for the correct dataset in be_mounted_at()
Kyle Evans [Thu, 31 Mar 2022 19:19:52 +0000 (14:19 -0500)]
libbe: pull props for the correct dataset in be_mounted_at()

The props feature to this API was added as a "just in case", with no
planned consumer.  It turns out that it was implemented incorrectly,
tapping out props for the BE root (BE's parent) rather than the BE
itself in all cases.

Fetch properties for the dataset that's actually mounted at the queried
path.

Reported by: Christian McDonald <cmcdonald netgate com>
MFC after: 3 days

2 years agolibbe: fix be_mounted_at() with props after bootonce
Kyle Evans [Thu, 31 Mar 2022 19:18:14 +0000 (14:18 -0500)]
libbe: fix be_mounted_at() with props after bootonce

propinfo.bootonce was filled with garbage, leading to a segfault later
during prop building.  Initialize it to NULL.

MFC after: 3 days

2 years agolinux(4): Cleanup empty lines.
Dmitry Chagin [Thu, 31 Mar 2022 18:23:12 +0000 (21:23 +0300)]
linux(4): Cleanup empty lines.

MFC after: 2 weeks

2 years agolinux(4): Fix KASSERT message.
Dmitry Chagin [Thu, 31 Mar 2022 18:22:31 +0000 (21:22 +0300)]
linux(4): Fix KASSERT message.

MFC after: 2 weeks

2 years agolinux(4): readlink should fail if bufzis <= 0.
Dmitry Chagin [Thu, 31 Mar 2022 18:21:41 +0000 (21:21 +0300)]
linux(4): readlink should fail if bufzis <= 0.

MFC after: 2 weeks

2 years agolinprocfs: Add /proc/self/oom_score_adj.
Dmitry Chagin [Thu, 31 Mar 2022 18:04:44 +0000 (21:04 +0300)]
linprocfs: Add /proc/self/oom_score_adj.

To avoid annoyng messages from LTP test suites add the simple
implementation of /proc/self/oom_score_adj which is do nothing.

Reviewed by: emaste
Differential revision:  https://reviews.freebsd.org/D34710
MFC after: 2 weeks

2 years agolinux(4): Add compat.linux32.emulate_i386 knob.
Dmitry Chagin [Thu, 31 Mar 2022 18:01:09 +0000 (21:01 +0300)]
linux(4): Add compat.linux32.emulate_i386 knob.

Historically 32-bit Linuxulator under amd64 emulated the real i386
behavior. Since 3d8dd983 the old i386 Linux world can't be used under
amd64 Linuxulator as it don't know anything about amd64 machine (which
is returned now by newuname() syscall). So, add a knob to allow to swith
the behavior and use i386 Linux binaries on amd64.
Set knob to the new behavior as I think this is common to the modern
Linux distros.

Reviewed by: Pau Amma (doc), emaste
Differential revision: https://reviews.freebsd.org/D34708
MFC after: 2 weeks

2 years agolinux(4): Fixup miscalculation of d_off of struct dirent in getdents() syscalls.
Dmitry Chagin [Thu, 31 Mar 2022 17:50:09 +0000 (20:50 +0300)]
linux(4): Fixup miscalculation of d_off of struct dirent in getdents() syscalls.

Avoid calculating d_off value as it is specific to the underlying filesystem
and can be used by others API, like lseek(), seekdir() as input offset.

Differential revision:  https://reviews.freebsd.org/D31551
MFC after: 2 weeks

2 years agolinux(4): wait4() returns ESRCH if pid is INT_MIN.
Dmitry Chagin [Thu, 31 Mar 2022 17:49:39 +0000 (20:49 +0300)]
linux(4): wait4() returns ESRCH if pid is INT_MIN.

Weird and undocumented patch was added to the Linux kernel in 2017,
fixes wait403 LTP test.

MFC after: 2 weeks

2 years agolinux(4): Rid unused defines from linux_mib.
Dmitry Chagin [Thu, 31 Mar 2022 17:45:12 +0000 (20:45 +0300)]
linux(4): Rid unused defines from linux_mib.

Reviewed by: trasz
Differential revision:  https://reviews.freebsd.org/D31591
MFC after: 2 weeks

2 years agolinux(4): Fixup waitid handling P_PGID idtype.
Dmitry Chagin [Thu, 31 Mar 2022 17:44:00 +0000 (20:44 +0300)]
linux(4): Fixup waitid handling P_PGID idtype.

Since Linux 5.4, if id is zero, then wait for any child that is in the same
process grop as the caller's process group.

Differential revision:  https://reviews.freebsd.org/D31567
MFC after: 2 weeks

2 years agolinux(4): Return ENOSYS for unsupported P_PIDFD waitid idtype.
Dmitry Chagin [Thu, 31 Mar 2022 17:42:42 +0000 (20:42 +0300)]
linux(4): Return ENOSYS for unsupported P_PIDFD waitid idtype.

Reviewed by: emaste
Differential revision:  https://reviews.freebsd.org/D31559
MFC after: 2 weeks

2 years agolinux(4): Add support for __WALL wait option bit.
Dmitry Chagin [Thu, 31 Mar 2022 17:42:03 +0000 (20:42 +0300)]
linux(4): Add support for __WALL wait option bit.

As FreeBSD does not have __WALL option bit analogue explicitly set all
possible option bits to emulate Linux __WALL wait option bit.

Reviewed by: emaste
Differential revision:  https://reviews.freebsd.org/D31555
MFC after: 2 weeks

2 years agolinux(4): Fixup options value validation in linux_waitid().
Dmitry Chagin [Thu, 31 Mar 2022 17:41:19 +0000 (20:41 +0300)]
linux(4): Fixup options value validation in linux_waitid().

Reviewed by: emaste
Differential revision:  https://reviews.freebsd.org/D31554
MFC after: 2 weeks

2 years agolinux(4): Eliminate bogus options value check validation.
Dmitry Chagin [Thu, 31 Mar 2022 17:41:02 +0000 (20:41 +0300)]
linux(4): Eliminate bogus options value check validation.

The kernel do it for us.

Reviewed by: emaste
Differential revision:  https://reviews.freebsd.org/D31553
MFC after: 2 weeks

2 years agolinux(4): Consolidate wait* facility into linux_common_wait().
Dmitry Chagin [Thu, 31 Mar 2022 17:40:22 +0000 (20:40 +0300)]
linux(4): Consolidate wait* facility into linux_common_wait().

Also fix bug in waitid() implementation, use wru_self not wru_children.

Differential revision:  https://reviews.freebsd.org/D31552
MFC after: 2 weeks

2 years agoLinuxKPI: 802.11: fix compat code for i386
Bjoern A. Zeeb [Thu, 31 Mar 2022 17:29:53 +0000 (17:29 +0000)]
LinuxKPI: 802.11: fix compat code for i386

Compiling another driver on i386 revealed two problems:
- ieee80211_tx_info.status.status_driver_data space needs to be
  calculated.  While a pointer is 32bit vm_paddr_t is 64 bit on i386
  so we didn't fit more than one of these in but needed more space.
- the arguments to ieee80211_txq_get_depth() are expected to
  unsigned long and not uint64_t.

No user noticable changes.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoifconfig.8: Update -l synopsis
Mateusz Piotrowski [Thu, 31 Mar 2022 15:12:27 +0000 (17:12 +0200)]
ifconfig.8: Update -l synopsis

The -g flag can be used together with the -l flag.

MFC after: 2 weeks

2 years agoifconfig.8: Document "ifconfig -g groupname"
Mateusz Piotrowski [Thu, 31 Mar 2022 14:30:29 +0000 (16:30 +0200)]
ifconfig.8: Document "ifconfig -g groupname"

"ifconfig -g groupname" prints a list of interface names,
which could be confusing, because it differs from
the behavior of "ifconfig -a -g groupname".

While here, add two examples showing the difference between
"ifconfig -a -g groupname" and "ifconfig -g groupname".

Fixes: 0dad3f0e1512 Import interface groups from OpenBSD.
MFC after: 2 weeks

2 years agosnd_solo.4: Remove cross reference to ISA ESS cards
Ed Maste [Thu, 31 Mar 2022 14:46:27 +0000 (10:46 -0400)]
snd_solo.4: Remove cross reference to ISA ESS cards

ISA sound card drivers are deprecated and will be removed in the future.

Sponsored by: The FreeBSD Foundation

2 years agoAddress issue pointed out in CVE-2020-25705
George V. Neville-Neil [Sat, 19 Mar 2022 16:48:16 +0000 (17:48 +0100)]
Address issue pointed out in CVE-2020-25705

Add jitter to the ICMP bandwidth limit to deny a side-channel port scan.

Reviewed by: kp, philip, cy, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27354

2 years agoBump __FreeBSD_version for zlib upgrade.
Xin LI [Thu, 31 Mar 2022 14:30:42 +0000 (07:30 -0700)]
Bump __FreeBSD_version for zlib upgrade.

2 years agoMFV c144cc54795d: zlib 1.2.12.
Xin LI [Thu, 31 Mar 2022 14:25:53 +0000 (07:25 -0700)]
MFV c144cc54795d: zlib 1.2.12.

MFC after: 3 days
Relnotes: yes

2 years agoifconfig.8: Remove commented-out Xr eon 5
Mateusz Piotrowski [Thu, 31 Mar 2022 10:07:18 +0000 (12:07 +0200)]
ifconfig.8: Remove commented-out Xr eon 5

This reference has been present in the manual page since the initial
import of BSD 4.4 Lite sbin Sources. It's time for it to be removed.

MFC after: 2 weeks

2 years agoifconfig.8: Remove remaining Xerox Network Systems(tm) bits
Mateusz Piotrowski [Thu, 31 Mar 2022 10:00:42 +0000 (12:00 +0200)]
ifconfig.8: Remove remaining Xerox Network Systems(tm) bits

Support for Xeros Network Systems seems to be long gone. There is no
reason to keep this in the manual page.

MFC after: 2 weeks

2 years agoifconfig.8: Simplify examples by using canonical parameters
Mateusz Piotrowski [Thu, 31 Mar 2022 09:54:06 +0000 (11:54 +0200)]
ifconfig.8: Simplify examples by using canonical parameters

Also, use Bd instead of Dl for multi line examples.

MFC after: 2 weeks

2 years agoifconfig.8: Mark address_family as optional in synopsis
Mateusz Piotrowski [Thu, 31 Mar 2022 09:40:24 +0000 (11:40 +0200)]
ifconfig.8: Mark address_family as optional in synopsis

Commands like "ifconfig wlan0 up" are valid. There is no need to always
specify the address family.

MFC after: 2 weeks

2 years agoifconfig.8: Improve description of the address argument
Mateusz Piotrowski [Thu, 31 Mar 2022 09:28:41 +0000 (11:28 +0200)]
ifconfig.8: Improve description of the address argument

- Split paragraphs for clarity.
- Add an example of setting a random MAC address.

MFC after: 2 weeks

2 years agoifconfig.8: Improve readability of address_family documentation
Mateusz Piotrowski [Thu, 31 Mar 2022 09:11:32 +0000 (11:11 +0200)]
ifconfig.8: Improve readability of address_family documentation

Also, move the description of the special case of "ifconfig -l ether" to
the description of the -l flag.

MFC after: 2 weeks

2 years agovm_phys: alloc pages without duplicating searches.
Doug Moore [Thu, 31 Mar 2022 06:40:46 +0000 (01:40 -0500)]
vm_phys: alloc pages without duplicating searches.

In the search for contiguous pages, as each page segment is examined,
check to see if the free list set for the next page segment differs
from the set for the current segment, and avoid a pointless search if
they do not differ.

Discussed with: alc
Reviewed by: markj
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D33947

2 years agoVendor import of zlib 1.2.12.
Xin LI [Thu, 31 Mar 2022 03:06:34 +0000 (20:06 -0700)]
Vendor import of zlib 1.2.12.

2 years agochroot.2: Correct grammar errors.
Greg Lehey [Thu, 31 Mar 2022 02:05:49 +0000 (13:05 +1100)]
chroot.2: Correct grammar errors.
  No functional change.

MFC after: 1 week

2 years agompr: add \n in diagnostic printf
Ed Maste [Mon, 28 Mar 2022 17:24:06 +0000 (13:24 -0400)]
mpr: add \n in diagnostic printf

Diff reduction between mpr and mps.

Fixes: e2997a03b7f7 ("Diagnostic buffer fixes for the mps(4)...")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

2 years agouma: Don't allow a limit to be set in a warm zone
Mark Johnston [Wed, 30 Mar 2022 19:42:18 +0000 (15:42 -0400)]
uma: Don't allow a limit to be set in a warm zone

The limit accounting in UMA does not tolerate this.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

2 years agouma: Use the correct type for a return value
Mark Johnston [Wed, 30 Mar 2022 19:42:05 +0000 (15:42 -0400)]
uma: Use the correct type for a return value

zone_alloc_bucket() returns a pointer, not a bool.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agopf: Initialize the table entry zone limit at initialization time
Mark Johnston [Wed, 30 Mar 2022 19:41:44 +0000 (15:41 -0400)]
pf: Initialize the table entry zone limit at initialization time

The limit may later be updated by the "set limit" directive in pf.conf.
UMA does not permit a limit to be set on a zone after any items have
been allocated from a zone.

Other UMA zones used by pf do not appear to be susceptible to this
problem: they either set a limit at zone creation time or never set one
at all.

PR: 260406
Reviewed by: kp
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34713

2 years agocompat32: add size CTASSERTs for non-amd64 cases
Ed Maste [Wed, 30 Mar 2022 15:23:06 +0000 (11:23 -0400)]
compat32: add size CTASSERTs for non-amd64 cases

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34712

2 years agofstyp: Correct comment: Raspberry Pi Pico, not Nano
Ed Maste [Wed, 30 Mar 2022 17:03:15 +0000 (13:03 -0400)]
fstyp: Correct comment: Raspberry Pi Pico, not Nano

Fixes: 868c1b8431f2 ("fstyp: detect Raspberry Pi Pico boot...")

2 years agodtc.1: Fix the display of directives ending with semicolons
Jose Luis Duran [Thu, 10 Mar 2022 00:20:49 +0000 (21:20 -0300)]
dtc.1: Fix the display of directives ending with semicolons

While here, fix a typo and bump the date.

Obtained from: https://github.com/davidchisnall/dtc/pull/71
Fixes: 6979e8cb6e62f04688611aed796712fde1a981d6

2 years agoifconfig.8: Fix quoting
Jose Luis Duran [Wed, 30 Mar 2022 15:41:15 +0000 (17:41 +0200)]
ifconfig.8: Fix quoting

Obtained from: https://github.com/freebsd/freebsd-src/commit/67d77afb0dde9aa627635a0c4e28a8fa5a64db6c#r69907135
Fixes: 67d77afb0dde ifconfig.8: Do not use ``'' for quoting
MFC after: 2 weeks

2 years agosyscalls.master: remove obsolete comment about compatibility tables
Ed Maste [Wed, 30 Mar 2022 15:03:02 +0000 (11:03 -0400)]
syscalls.master: remove obsolete comment about compatibility tables

Compatibility ABIs no longer use a separate syscalls.master.

Fixes: be67ea40c5a0 ("freebsd32: generate from ...")
Sponsored by: The FreeBSD Foundation

2 years agoifconfig.8: Clean up markup of "state" parameter
Mateusz Piotrowski [Wed, 30 Mar 2022 12:44:59 +0000 (14:44 +0200)]
ifconfig.8: Clean up markup of "state" parameter

MFC after: 2 weeks

2 years agoifconfig.8: Make the -f flag description compact
Mateusz Piotrowski [Wed, 30 Mar 2022 12:35:15 +0000 (14:35 +0200)]
ifconfig.8: Make the -f flag description compact

- Remove extraneous examples
- Apply "-compact" to the list macros so that it is possible to fit the
  definitions of the types and formats in one terminal screen.

MFC after: 2 weeks

2 years agoifconfig.8: Do not use ``'' for quoting
Mateusz Piotrowski [Wed, 30 Mar 2022 12:28:09 +0000 (14:28 +0200)]
ifconfig.8: Do not use ``'' for quoting

MFC after: 2 weeks

2 years agoifconfig.8: Clean up the channel parameter description
Mateusz Piotrowski [Wed, 30 Mar 2022 12:24:23 +0000 (14:24 +0200)]
ifconfig.8: Clean up the channel parameter description

MFC after: 2 weeks

2 years agoifconfig.8: Add section headers to the parameters section
Mateusz Piotrowski [Wed, 30 Mar 2022 12:05:45 +0000 (14:05 +0200)]
ifconfig.8: Add section headers to the parameters section

MFC after: 2 weeks

2 years agoifconfig.8: Clean up -n documentation
Mateusz Piotrowski [Wed, 30 Mar 2022 11:43:41 +0000 (13:43 +0200)]
ifconfig.8: Clean up -n documentation

MFC after: 2 weeks

2 years agoifconfig.8: Clean up -k documentation
Mateusz Piotrowski [Wed, 30 Mar 2022 11:41:20 +0000 (13:41 +0200)]
ifconfig.8: Clean up -k documentation

MFC after: 2 weeks

2 years agoifconfig.8: Clean up -C and -v documentation
Mateusz Piotrowski [Wed, 30 Mar 2022 11:38:14 +0000 (13:38 +0200)]
ifconfig.8: Clean up -C and -v documentation

MFC after: 2 weeks

2 years agoifconfig.8: Clean up -l documentation
Mateusz Piotrowski [Wed, 30 Mar 2022 11:34:31 +0000 (13:34 +0200)]
ifconfig.8: Clean up -l documentation

MFC after: 2 weeks

2 years agoifconfig.8: Clean up -G & -g documentation
Mateusz Piotrowski [Wed, 30 Mar 2022 11:28:03 +0000 (13:28 +0200)]
ifconfig.8: Clean up -G & -g documentation

MFC after: 2 weeks

2 years agoifconfig.8: Clean up documentation of -a, -d, and -u
Mateusz Piotrowski [Wed, 30 Mar 2022 10:54:20 +0000 (12:54 +0200)]
ifconfig.8: Clean up documentation of -a, -d, and -u

MFC after: 2 weeks

2 years agoifconfig.8: Clean up -L documentation
Mateusz Piotrowski [Wed, 30 Mar 2022 10:47:59 +0000 (12:47 +0200)]
ifconfig.8: Clean up -L documentation

MFC after: 2 weeks

2 years agoifconfig.8: Clean up -m documentation
Mateusz Piotrowski [Wed, 30 Mar 2022 10:45:51 +0000 (12:45 +0200)]
ifconfig.8: Clean up -m documentation

MFC after: 2 weeks

2 years agoifconfig.8: Clean up formatting of -f documentation
Mateusz Piotrowski [Wed, 30 Mar 2022 10:40:53 +0000 (12:40 +0200)]
ifconfig.8: Clean up formatting of -f documentation

This change is about moving the -f documentation into the right place in
the manual. Also, document the IFCONFIG_FORMAT variable in the
ENVIRONMENT section.

MFC after: 2 weeks

2 years agoifconfig.8: Move options sections to the top
Mateusz Piotrowski [Wed, 30 Mar 2022 09:36:23 +0000 (11:36 +0200)]
ifconfig.8: Move options sections to the top

In order to clean up the layout of the manual page, let's keep
parameters in the end of the DESCRIPTION section. This patch does not
change any content, it's meant to only move the content around before
refactoring.

MFC after: 2 weeks

2 years agoifconfig.8: Deduplicate groupname documentation
Mateusz Piotrowski [Wed, 30 Mar 2022 09:33:28 +0000 (11:33 +0200)]
ifconfig.8: Deduplicate groupname documentation

-G and -g flags are already described somewhere else in the manual.

MFC after: 2 weeks

2 years agopf: fixup match rules
Kristof Provost [Tue, 29 Mar 2022 12:28:37 +0000 (14:28 +0200)]
pf: fixup match rules

Ensure that we can set and print match rules in ethernet rules.

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

2 years agopf: add missing input/error validation for DIOCGETETHRULE
Kristof Provost [Tue, 29 Mar 2022 12:17:12 +0000 (14:17 +0200)]
pf: add missing input/error validation for DIOCGETETHRULE

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

2 years agolibpfct: Return errno from pfctl_add_eth_rule()
Kristof Provost [Tue, 29 Mar 2022 12:15:47 +0000 (14:15 +0200)]
libpfct: Return errno from pfctl_add_eth_rule()

If the pfctl_add_eth_rule() ioctl fails return the errno, not the error
returned by ioctl(). That will give us slightly more insight into what
went wrong, because ioctl() would always return -1.

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

2 years agopf: support listing ethernet anchors
Kristof Provost [Tue, 29 Mar 2022 12:15:10 +0000 (14:15 +0200)]
pf: support listing ethernet anchors

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

2 years agoHyper-V: vPCI: Write back original BAR values after prepopulating bars
Wei Hu [Wed, 30 Mar 2022 06:56:09 +0000 (06:56 +0000)]
Hyper-V: vPCI: Write back original BAR values after prepopulating bars

In vmbus_pcib_prepopulate_bars(), after writing all 1's to the
avialable device bars, those without being configured by device driver
are also set to its initialized values. However, this could cause
weird problem which results to device failure. The issue has been
reported to happen on LSI 9211-8i HBA card for DDA access on Hyper-V.
Writing back the orignal BAR values seem to work around this problem.

Reported by: Alexander Motin <mavbsd@gmail.com>
Tested by: Mathias Kraut <krautmaster@gmail.com>
Fixes: 75412a521f6 Hyper-V: vPCI: Prepopulate device bars
MFC after: 1 month

2 years agoCorrect source markup. No change to output.
Greg Lehey [Wed, 30 Mar 2022 03:55:28 +0000 (14:55 +1100)]
Correct source markup.  No change to output.

Reported by: 0mp@

2 years agoRemove reference to kernel clock time zone.
Greg Lehey [Wed, 30 Mar 2022 03:42:14 +0000 (14:42 +1100)]
Remove reference to kernel clock time zone.
Add references.

Reported by: philip@

2 years agosctp: ensure that ASCONF chunks are not too large
Michael Tuexen [Tue, 29 Mar 2022 23:22:20 +0000 (01:22 +0200)]
sctp: ensure that ASCONF chunks are not too large

MFC after: 3 days

2 years agofstyp: detect Raspberry Pi Pico boot filesystem as FAT
Ed Maste [Mon, 28 Mar 2022 21:03:10 +0000 (17:03 -0400)]
fstyp: detect Raspberry Pi Pico boot filesystem as FAT

fstyp looks for a 0x55 0xAA signature at offset 510, but this is not
required by specifications and is not proivded by the Raspberry Pi Nano
bootloader.

We should really remove the signature check and implement a more
comprehensive BPB validation instead, but it will require more
investigation and testing.  For now just add a special case for the
Raspberry Pi Nano bootloader, to avoid introducing regressions or new
false positives.

PR: 262896
Reviewed by: delphij
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34699

2 years agosctp: fix typos
Michael Tuexen [Tue, 29 Mar 2022 19:09:51 +0000 (21:09 +0200)]
sctp: fix typos

Thanks to David Sanders for fixing the typos in the userland stack.

MFC after: 3 days

2 years agoClear non-x86 compat stat syscall kernel stack memory disclosure
Ed Maste [Tue, 29 Mar 2022 17:55:21 +0000 (13:55 -0400)]
Clear non-x86 compat stat syscall kernel stack memory disclosure

32-bit architectures other than i386 have 64-bit time_t which results
in a struct timespec with 12 bytes for tv_sec and tv_nsec, and 4 bytes
of padding.  Zero the padding holes in struct stat32 and struct
freebsd11_stat32.

i386 has 32-bit time_t; struct timespec is 8 bytes and has no padding.

Found by inspection, prompted by a report by Reno Robert of Trend Micro
Zero Day Initiative.  The originally reported issue (ZDI-CAN-14538) is
already fixed in all supported FreeBSD versions (it was addressed
incidentally as part of the 64-bit inode project).

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34709

2 years agopf: guard against DIOCADDRULE without DIOCXBEGIN
Mateusz Guzik [Tue, 29 Mar 2022 13:17:54 +0000 (13:17 +0000)]
pf: guard against DIOCADDRULE without DIOCXBEGIN

Possibility to do it was always a bug, but it runs into crashes
since recent introduction of a per-ruleset RB tree.

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")
Reported by: syzbot+665b700afc6f69f1766a@syzkaller.appspotmail.com

2 years agoRevert "drm2: Fix a typo in a source code comment"
Gordon Bergling [Tue, 29 Mar 2022 18:47:52 +0000 (20:47 +0200)]
Revert "drm2: Fix a typo in a source code comment"

The comment about 'mmaping' was actually correct since
the comment was referencing to mmap(2).

Reported by: alc

This reverts commit 22ba115b49a2c266aa1967f6b192b7aa8f883b7d.

2 years agoRemove extraneous semicolons trailing break and continue statements.
Jens Schweikhardt [Tue, 29 Mar 2022 17:43:00 +0000 (19:43 +0200)]
Remove extraneous semicolons trailing break and continue statements.

2 years agoifconfig.8: Document that -k can be used with -a
Mateusz Piotrowski [Tue, 29 Mar 2022 17:37:01 +0000 (19:37 +0200)]
ifconfig.8: Document that -k can be used with -a

MFC after: 2 weeks

2 years agoifconfig.8: Improve -f synopsis
Mateusz Piotrowski [Tue, 29 Mar 2022 17:32:32 +0000 (19:32 +0200)]
ifconfig.8: Improve -f synopsis

- There is no need to mention in the synopsis that -f can be a list of
  comma-separated type:format pairs. Let's keep it simple instead.
- Mention that -f can be supplied multiple times.
- Add -f to other entries in the synopsis where it can be used.

MFC after: 2 weeks

2 years agoifconfig.8: Document the synopsis of -C
Mateusz Piotrowski [Tue, 29 Mar 2022 17:16:07 +0000 (19:16 +0200)]
ifconfig.8: Document the synopsis of -C

As documented, the -C flag can only be used on its own. Any other
command modifiers and flags are ignored when -C is used. Reflect that in
synopsis.

MFC after: 2 weeks

2 years agoifconfig.8: Show that -g groupname can be used on its own
Mateusz Piotrowski [Tue, 29 Mar 2022 17:14:20 +0000 (19:14 +0200)]
ifconfig.8: Show that -g groupname can be used on its own

MFC after: 2 weeks

2 years agoifconfig.8: Cluster together short flags
Mateusz Piotrowski [Tue, 29 Mar 2022 17:12:50 +0000 (19:12 +0200)]
ifconfig.8: Cluster together short flags

MFC after: 2 weeks

2 years agoifconfig.8: Simplify -G & -g synopsis
Mateusz Piotrowski [Tue, 29 Mar 2022 16:50:55 +0000 (18:50 +0200)]
ifconfig.8: Simplify -G & -g synopsis

MFC after: 1 week

2 years agobsdinstall mount: Replace dialog with bsddialog
Alfonso S. Siciliano [Tue, 29 Mar 2022 14:52:25 +0000 (16:52 +0200)]
bsdinstall mount: Replace dialog with bsddialog

Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D34651

2 years agobsdinstall fetchmissingdists: Replace dialog with bsddialog
Alfonso S. Siciliano [Tue, 29 Mar 2022 14:39:43 +0000 (16:39 +0200)]
bsdinstall fetchmissingdists: Replace dialog with bsddialog

Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D34654

2 years agosctp: don't lock an already locked stcb.
Michael Tuexen [Tue, 29 Mar 2022 14:33:53 +0000 (16:33 +0200)]
sctp: don't lock an already locked stcb.

Reported by: syzbot+e8dca84da3b4b82f4400@syzkaller.appspotmail.com
MFC after: 3 days

2 years agobsdinstall/distfetch: Remove duplicate header
Alfonso S. Siciliano [Tue, 29 Mar 2022 14:15:28 +0000 (16:15 +0200)]
bsdinstall/distfetch: Remove duplicate header

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D34685

2 years agorelease/rc.local: Replace dialog with bsddialog
Alfonso S. Siciliano [Tue, 29 Mar 2022 13:16:09 +0000 (15:16 +0200)]
release/rc.local: Replace dialog with bsddialog

Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D34678

2 years agoCross-reference nextboot(8) and freebsd-update(8)
Mateusz Piotrowski [Tue, 29 Mar 2022 13:15:35 +0000 (15:15 +0200)]
Cross-reference nextboot(8) and freebsd-update(8)

MFC after: 1 week

2 years agofreebsd-update.8: Fix use of mdoc(8) macros
Mateusz Piotrowski [Tue, 29 Mar 2022 12:35:46 +0000 (14:35 +0200)]
freebsd-update.8: Fix use of mdoc(8) macros

- Use Ar for arguments.
- Use Cm for freebsd-update commands like "upgrade".
- Reference other manuals with Xr when possible.

MFC after: 1 week

2 years agoRELNOTES: Add an entry for boottrace(4)
Mateusz Piotrowski [Tue, 29 Mar 2022 11:33:13 +0000 (13:33 +0200)]
RELNOTES: Add an entry for boottrace(4)

Reviewed by: mhorne
Sponsored by: NetApp, Inc.
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D34432