]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agocache: drop the vfs.cache_rename_add tunable
Mateusz Guzik [Mon, 27 Jun 2022 07:54:20 +0000 (07:54 +0000)]
cache: drop the vfs.cache_rename_add tunable

The functionality has been in use since Jan 2021 -- long enough(tm).

2 years agohwpmc: further fix build (__diagused/debug/missing files entries)
Bjoern A. Zeeb [Mon, 27 Jun 2022 01:23:24 +0000 (01:23 +0000)]
hwpmc: further fix build (__diagused/debug/missing files entries)

Fix builds after 1459a22787ea16e3798694067c8dcb20325dca4b and
59191f3573f6cb2ea055ac319cbcb68823ca8e17 by using __diagused
for variables only used in KASSERT().
In addition remove two debug lines that look like a copy and paste error
from dmc620 to cmn600.
Further add the newly introduced files to sys/confg/files.arm64 as well
so that LINT compiles without missing symbols.

2 years agopmc: unhide struct pmc_md_dmc620_pmu_op_pmcallocate
Bjoern A. Zeeb [Mon, 27 Jun 2022 00:37:23 +0000 (00:37 +0000)]
pmc: unhide struct pmc_md_dmc620_pmu_op_pmcallocate

Fix build after e3572eb654733a94e1e765fe9e95e0579981d851 as
struct pmc_md_dmc620_pmu_op_pmcallocate is needed when building
libpmc/pmclog.c as it is partof the public API via machine/pmc_mdep.h.

2 years agolibpmc: attempt to fix the build
Bjoern A. Zeeb [Sun, 26 Jun 2022 23:14:56 +0000 (23:14 +0000)]
libpmc: attempt to fix the build

Try to fix the build (blindly) after e3572eb654733a94e1e765fe9e95e0579981d851.
I had missed the missing #ifdef in the review.  Hope that's all it takes.

2 years agoAdd support of ARM CMN-600 controller, PMU access functions only. Add support of...
Aleksandr Rybalko [Wed, 16 Feb 2022 00:36:17 +0000 (00:36 +0000)]
Add support of ARM CMN-600 controller, PMU access functions only. Add support of PMU counters of ARM CMN-600 controller.

Add support of ARM CMN-600 controller, PMU access functions only.
Add support of PMU counters of ARM CMN-600 controller.

Reviewed by: mhorne
Sponsored By: ARM
Differential Revision: https://reviews.freebsd.org/D32321

2 years agoThe Arm CoreLink DMC-620 Dynamic Memory Controller PMU driver
Aleksandr Rybalko [Wed, 16 Feb 2022 00:29:31 +0000 (00:29 +0000)]
The Arm CoreLink DMC-620 Dynamic Memory Controller PMU driver

Add the Arm CoreLink DMC-620 Dynamic Memory Controller PMU driver
Add DMC-620 support to hwpmc(4)

Reviewed by: mhorne
Sponsored By: Ampere Computing
Differential Revision: https://reviews.freebsd.org/D32670

2 years agoAllocate event for DMC-620 and CMN-600 controllers PMU. Add events supported by DMC...
Aleksandr Rybalko [Wed, 16 Feb 2022 00:19:19 +0000 (00:19 +0000)]
Allocate event for DMC-620 and CMN-600 controllers PMU. Add events supported by DMC-620 and CMN-600 controllers PMU.

Allocate event for DMC-620 and CMN-600 controllers PMU.
Add events supported by DMC-620 and CMN-600 controllers PMU.

Reviewed by: bz
Sponsored By: ARM
Sponsored By: Ampere Computing
Differential Revision: https://reviews.freebsd.org/D35609

2 years agoiommu_gas: Fix a recent regression with IOMMU_MF_CANSPLIT
Alan Cox [Sun, 26 Jun 2022 16:48:12 +0000 (11:48 -0500)]
iommu_gas: Fix a recent regression with IOMMU_MF_CANSPLIT

As of 19bb5a7244ff, the IOMMU_MF_CANSPLIT case in iommu_gas_match_one()
must take into account the specified offset.  Otherwise, the recently
changed end calculation in iommu_gas_match_insert() could produce an
end address that crosses the specified boundary by one page.

Reviewed by: dougm
MFC with: 19bb5a7244ff

2 years agoLinuxKPI: 802.11: remove an early bandaid to make sure queues are allocated
Bjoern A. Zeeb [Sun, 26 Jun 2022 19:17:04 +0000 (19:17 +0000)]
LinuxKPI: 802.11: remove an early bandaid to make sure queues are allocated

iwlwifi allocates queues on first wakeup.  This takes a lot longer on
FreeBSD's work implementation that it seems to on Linux based on some
discussion.  That meant that we couldn't get non-data frames out quickly
enough initially and failed to associate.
d0d2911035192473e8bd3f6b99ed5ca9b1b29e47 should have solved most of this
for us with iwlwifi.  None of the other drivers ported to LinuxKPI/802.11
up to today will call a dequeue so we get notified when the queus are
allocated or even need to do so.
Remove the bandaid initilly put in for iwlwifi now and speed up the
overall process of getting us associated.

MFC after: 3 days

2 years agoLinuxKPI: 802.11: cleanup lsta better
Bjoern A. Zeeb [Sun, 26 Jun 2022 19:13:00 +0000 (19:13 +0000)]
LinuxKPI: 802.11: cleanup lsta better

This changes cleans up lsta from the VIF station list as well as
deals with freeing the lsta itself so it is not leaked.

lkpi_iv_update_bss() makes this more complicated than it should be
as we ties more sta state (incl. drv/fw) to the node that net80211
does not know about.  There is more work to be done detangling this
now that is better understood.

MFC after: 3 days

2 years agoLinuxKPI: 802.11: sync sta->addr in lkpi_iv_update_bss()
Bjoern A. Zeeb [Sun, 26 Jun 2022 19:04:16 +0000 (19:04 +0000)]
LinuxKPI: 802.11: sync sta->addr in lkpi_iv_update_bss()

In lkpi_iv_update_bss() introduced in d9f59799fc3e7 we swap lsta and
along with that sta and drv state if ni gets reused and swapped under
us by net80211.  What we did not do was to sync sta->addr which later
(usually in lkpi_sta_assoc_to_run) during a bss_info update cause
problems in drivers (or firmware) as the BSSID and the station address
were not aligned.

If this proves to hold up to fix iwlwifi issues seem on firmware
for older chipsets, multi-assoc runs, and rtw89 (which this fixes)
we should add asserts that lkpi_iv_update_bss() can only happen in
pre-auth stages and/or make sure we factor out synching more state
fields.

Found debugging: rtw89
MFC after: 3 days

2 years agoRevert "LinuxKPI: 802.11: fix iwlwifi fw assert with older chipsets"
Bjoern A. Zeeb [Sun, 26 Jun 2022 18:50:36 +0000 (18:50 +0000)]
Revert "LinuxKPI: 802.11: fix iwlwifi fw assert with older chipsets"

This reverts commit 013e516dc9b1b32e9422ab02a875a05fc2d32f39.

2 years agoRemove references to named(8)
Fernando Apesteguía [Wed, 22 Jun 2022 16:39:30 +0000 (18:39 +0200)]
Remove references to named(8)

named(8) hasn't been in base for some time. Remove all references to it in
manual pages.

Approved by: manpages (Pau Amma)
Differential Revision: https://reviews.freebsd.org/D35586

2 years agotesting: move atf-pytest-wrapper to /usr/libexec
Alexander V. Chernikov [Sun, 26 Jun 2022 11:46:37 +0000 (11:46 +0000)]
testing: move atf-pytest-wrapper to /usr/libexec

Move pytest wrapper to the collection of the other atf wrappers
 in libexec. It solves the problem of combining bits & pieces from
 bsd.test.mk and bgs.prog.mk to address "test binary, but not the
 suite binary".

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D35604
MFC after: 2 weeks

2 years agoSupport of optional PMC classes.
Aleksandr Rybalko [Wed, 16 Feb 2022 00:18:04 +0000 (00:18 +0000)]
Support of optional PMC classes.

Reviewed by: mhorne
Differential Revision: https://reviews.freebsd.org/D32316

2 years agoSystem wide and NUMA domain wide counters support. PMC classes for ARM DMC-620 and...
Aleksandr Rybalko [Wed, 16 Feb 2022 00:17:02 +0000 (00:17 +0000)]
System wide and NUMA domain wide counters support. PMC classes for ARM DMC-620 and CMN-600.

Add support for system wide and NUMA domain wide counters support.
Add 3 new PMC classes for ARM DMC-620 and CMN-600 controllers PMU.

Reviewed by: mhorne
Sponsored By: ARM
Sponsored By: Ampere Computing
Differential Revision: https://reviews.freebsd.org/D35342

2 years agorouting: fix debug headers added in 6fa8ed43ee0c #2.
Alexander V. Chernikov [Sun, 26 Jun 2022 07:26:53 +0000 (07:26 +0000)]
routing: fix debug headers added in 6fa8ed43ee0c #2.

Move debug declaration out of COMPAT_FREEBSD32 in rtsock.c

MFC after: 2 weeks

2 years agoiommu_gas: Tidy up
Alan Cox [Sun, 26 Jun 2022 05:44:47 +0000 (00:44 -0500)]
iommu_gas: Tidy up

Move a comment to the code that it describes.  Improve the wording.

Style fixes.

MFC after: 2 weeks

2 years agorouting: fix debug headers added in 6fa8ed43ee0c.
Alexander V. Chernikov [Sat, 25 Jun 2022 23:05:25 +0000 (23:05 +0000)]
routing: fix debug headers added in 6fa8ed43ee0c.

- move debug headers out of COMPAT_FREEBSD32 in rtsock.c
- remove accidentally-added LOG_ defines from syslog.h

MFC after: 2 weeks

2 years agorouting: fix syslog include for rtsock.c
Alexander V. Chernikov [Sat, 25 Jun 2022 22:08:10 +0000 (22:08 +0000)]
routing: fix syslog include for rtsock.c

MFC after: 2 weeks

2 years agorouting: add tests/sys/net/routing to mtree
Alexander V. Chernikov [Sat, 25 Jun 2022 21:13:48 +0000 (21:13 +0000)]
routing: add tests/sys/net/routing to mtree

MFC after: 2 weeks

2 years agorouting: improve debugging.
Alexander V. Chernikov [Sat, 25 Jun 2022 19:53:31 +0000 (19:53 +0000)]
routing: improve debugging.

Use unified guidelines for the severity across the routing subsystem.
Update severity for some of the already-used messages to adhere the
guidelines.
Convert rtsock logging to the new FIB_ reporting format.

MFC after: 2 weeks

2 years agorouting: fix crash when RTM_CHANGE results in no-op for the multipath
Alexander V. Chernikov [Sat, 25 Jun 2022 19:32:59 +0000 (19:32 +0000)]
routing: fix crash when RTM_CHANGE results in no-op for the multipath
route.

Reporting logic assumed there is always some nhop change for every
 successful modification operation. Explicitly check that the changed
 nexthop indeed exists when reporting back to userland.

MFC after: 2 weeks
Reported by: Claudio Jeker <claudio.jeker@klarasystems.com>
Tested by: Claudio Jeker <claudio.jeker@klarasystems.com>

2 years agorouting: add multipath pytest tests
Alexander V. Chernikov [Sat, 25 Jun 2022 19:25:38 +0000 (19:25 +0000)]
routing: add multipath pytest tests

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

2 years agotesting: Add basic atf support to pytest.
Alexander V. Chernikov [Sat, 25 Jun 2022 19:01:45 +0000 (19:01 +0000)]
testing: Add basic atf support to pytest.

Implementation consists of the pytest plugin implementing ATF format and
a simple C++ wrapper, which reorders the provided arguments from ATF format
to the format understandable by pytest. Each test has this wrapper specified
after the shebang. When kyua executes the test, wrapper calls pytest, which
loads atf plugin, does the work and returns the result. Additionally, a
separate python "package", `/usr/tests/atf_python` has been added to collect
code that may be useful across different tests.

Current limitations:
* Opaque metadata passing via X-Name properties. Require some fixtures to write
* `-s srcdir` parameter passed by the runner is ignored.
* No `atf-c-api(3)` or similar - relying on pytest framework & existing python libraries
* No support for `atf_tc_<get|has>_config_var()` & `atf_tc_set_md_var()`.
 Can be probably implemented with env variables & autoload fixtures

Differential Revision: https://reviews.freebsd.org/D31084
Reviewed by: kp, ngie

2 years agorouting: fix RTM_CHANGE nhgroup updates.
Alexander V. Chernikov [Sat, 25 Jun 2022 18:54:37 +0000 (18:54 +0000)]
routing: fix RTM_CHANGE nhgroup updates.

RTM_CHANGE operates on a single component of the multipath route (e.g. on a single nexthop).
Search of this nexthop is peformed by iterating over each component from multipath (nexthop)
 group, using check_info_match_nhop. The problem with the current code that it incorrectly
 assumes that `check_info_match_nhop()` returns true value on match, while in reality it
 returns an error code on failure). Fix this by properly comparing the result with 0.
Additionally, the followup code modified original necthop group instead of a new one.
Fix this by targetting new nexthop group instead.

Reported by: thj
Tested by: Claudio Jeker <claudio.jeker@klarasystems.com>
Differential Revision: https://reviews.freebsd.org/D35526
MFC after: 2 weeks

2 years agocuse(3): Remove PAGE_SIZE from libcuse.
Hans Petter Selasky [Thu, 23 Jun 2022 20:34:45 +0000 (22:34 +0200)]
cuse(3): Remove PAGE_SIZE from libcuse.

To allow for a dynamic page size on arm64 remove the static value from libcuse.

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

2 years agobusdma: Protect ARM busdma bounce page counters using the bounce page lock.
Hans Petter Selasky [Thu, 23 Jun 2022 09:31:17 +0000 (11:31 +0200)]
busdma: Protect ARM busdma bounce page counters using the bounce page lock.

In bus_dmamap_unload() on ARM, the counters for free_bpages and reserved_bpages
appear to be vulnerable to unprotected read-modify-write operations that result
in accounting that looks like a page leak.

This was noticed on a 2GB quad core i.MX6 system that has more than one device
attached via FTDI based USB serial connection.

Submitted by: John Hein <jcfyecrayz@liamekaens.com>
Differential Revision: https://reviews.freebsd.org/D35553
PR: 264836
MFC after: 3 days
Sponsored by: NVIDIA Networking

2 years agorb_tree: optimize tree rotation
Doug Moore [Sat, 25 Jun 2022 07:40:16 +0000 (02:40 -0500)]
rb_tree: optimize tree rotation

The RB_ROTATE macros begin with fetching a field via a pointer. In
most cases, that value is one that has already been pulled into a
register, and the compiler cannot infer that. So, to eliminate those
needless fetches, have the caller of the RB_ROTATE macros present the
data in the third macro parameter, rather than having the macro fetch
it.

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

2 years agostress2: Added two syzkaller reproducers
Peter Holm [Sat, 25 Jun 2022 06:40:20 +0000 (08:40 +0200)]
stress2: Added two syzkaller reproducers

2 years agostress2: Added reagression tests
Peter Holm [Sat, 25 Jun 2022 06:21:30 +0000 (08:21 +0200)]
stress2: Added reagression tests
PR: 165392

2 years agobusdma_iommu: Fine-grained locking for the dmamap's map list
Alan Cox [Wed, 22 Jun 2022 21:51:47 +0000 (16:51 -0500)]
busdma_iommu: Fine-grained locking for the dmamap's map list

Introduce fine-grained locking on the dmamap's list of map entries,
replacing the use of the domain lock.  This is not the most significant
source of lock contention, but it is the easiest to address.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35557

2 years agonfscommon: Clean up the code by removing the vnode_vtype() macro
Rick Macklem [Fri, 24 Jun 2022 20:56:35 +0000 (13:56 -0700)]
nfscommon: Clean up the code by removing the vnode_vtype() macro

The vnode_vtype() macro was used to make the code compatible
with Mac OSX, for the Mac OSX port.
For FreeBSD, this macro just obscured the code and, therefore,
use of the macro has been deleted by previous commits.
This commit deletes the, now unused, macro.

This commit should not result in a semantics change.

2 years agonfscommon: Clean up the code by not using the vnode_vtype() macro
Rick Macklem [Fri, 24 Jun 2022 20:47:57 +0000 (13:47 -0700)]
nfscommon: Clean up the code by not using the vnode_vtype() macro

The vnode_vtype() macro was used to make the code compatible
with Mac OSX, for the Mac OSX port.
For FreeBSD, this macro just obscured the code, so
avoid using it to clean up the code.

This commit should not result in a semantics change.

2 years agotests/unix_passfd: compile SOCK_STREAM and SOCK_DGRAM versions
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:11 +0000 (09:09 -0700)]
tests/unix_passfd: compile SOCK_STREAM and SOCK_DGRAM versions

Most test pass identically on different kinds of sockets. However,
few edge cases work differently on stream and datagram sockets. We
want to exercise this and document.

Differential revision: https://reviews.freebsd.org/D35420

2 years agolibc/syslog: deprecate use of "/var/run/logpriv"
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:11 +0000 (09:09 -0700)]
libc/syslog: deprecate use of "/var/run/logpriv"

This additional socket was created in 2e89951b6f20 and 240d5a9b1ce76
to try workaround problems with classic PF_UNIX/SOCK_DGRAM sockets.

With recent changes in kernel this trick is no longer needed, so the
trick can be reverted.

In syslogd(8) we would still create the socket for the next several
major releases for compatibility.

Differential revision: https://reviews.freebsd.org/D35305

2 years agolibc/syslog: fully deprecate and don't try to open "/dev/log"
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:11 +0000 (09:09 -0700)]
libc/syslog: fully deprecate and don't try to open "/dev/log"

The "/dev/log" socket existed in pre-FreeBSD times.  Later it was
substituted to a compatibility symlink.  The symlink creation was
deprecated in FreeBSD 10.2 and 9-STABLE.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35304

2 years agounix/dgram: smart socket buffers for one-to-many sockets
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:11 +0000 (09:09 -0700)]
unix/dgram: smart socket buffers for one-to-many sockets

A one-to-many unix/dgram socket is a socket that has been bound
with bind(2) and can get multiple connections.  A typical example
is /var/run/log bound by syslogd(8) and receiving multiple
connections from libc syslog(3) API.  Until now all of these
connections shared the same receive socket buffer of the bound
socket.  This made the socket vulnerable to overflow attack.
See 240d5a9b1ce for a historical attempt to workaround the problem.

This commit creates a per-connection socket buffer for every single
connected socket and eliminates the problem.  The new behavior will
optimize seldom writers over frequent writers.  See added test case
scenarios and code comments for more detailed description of the
new behavior.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35303

2 years agounix/dgram: reduce mbuf chain traversals in send(2) and recv(2)
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:11 +0000 (09:09 -0700)]
unix/dgram: reduce mbuf chain traversals in send(2) and recv(2)

o Use m_pkthdr.memlen from m_uiotombuf()
o Modify unp_internalize() to keep track of allocated space and memory
  as well as pointer to the last buffer.
o Modify unp_addsockcred() to keep track of allocated space and memory
  as well as pointer to the last buffer.
o Record the datagram len/memlen/ctllen in the first (from) mbuf of the
  chain in uipc_sosend_dgram() and reuse it in uipc_soreceive_dgram().

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35302

2 years agom_uiotombuf: write total memory length of the allocated chain in pkthdr
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:11 +0000 (09:09 -0700)]
m_uiotombuf: write total memory length of the allocated chain in pkthdr

Data allocated by m_uiotombuf() usually goes into a socket buffer.
We are interested in the length of useful data to be added to sb_acc,
as well as total memory used by mbufs.  The later would be added to
sb_mbcnt.  Calculating this value at allocation time allows to save
on extra traversal of the mbuf chain.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35301

2 years agounix/dgram: use minimal possible socket buffer for PF_UNIX/SOCK_DGRAM
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:11 +0000 (09:09 -0700)]
unix/dgram: use minimal possible socket buffer for PF_UNIX/SOCK_DGRAM

This change fully splits away PF_UNIX/SOCK_DGRAM from other socket
buffer implementations, without any behavior changes.

Generic socket implementation is reduced down to one STAILQ and very
little code.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35300

2 years agosockets: enable protocol specific socket buffers
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:10 +0000 (09:09 -0700)]
sockets: enable protocol specific socket buffers

Split struct sockbuf into common shared fields and protocol specific
union, where protocols are free to implement whatever buffer they
want.  Such protocols should mark themselves with PR_SOCKBUF and are
expected to initialize their buffers in their pr_attach and tear
them down in pr_detach.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35299

2 years agounix: provide an option to return locked from unp_connectat()
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:10 +0000 (09:09 -0700)]
unix: provide an option to return locked from unp_connectat()

Use this new version in unix/dgram socket when sending to a target
address.  This removes extra lock release/acquisition and possible
counter-intuitive ENOTCONN.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35298

2 years agounix/dgram: inline sbappendaddr_locked() into uipc_sosend_dgram()
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:10 +0000 (09:09 -0700)]
unix/dgram: inline sbappendaddr_locked() into uipc_sosend_dgram()

This allows to remove one M_NOWAIT allocation and also makes it
more clear what's going on.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35297

2 years agounix/dgram: add a specific receive method - uipc_soreceive_dgram
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:10 +0000 (09:09 -0700)]
unix/dgram: add a specific receive method - uipc_soreceive_dgram

With this second step PF_UNIX/SOCK_DGRAM has protocol specific
implementation.  This gives some possibility performance
optimizations.  However, it still operates on the same struct
socket as all other sockets do.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35296

2 years agounix/dgram: cleanup uipc_send of PF_UNIX/SOCK_DGRAM, step 2
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:10 +0000 (09:09 -0700)]
unix/dgram: cleanup uipc_send of PF_UNIX/SOCK_DGRAM, step 2

Just remove one level of indentation as the case clause always match.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35295

2 years agounix/dgram: cleanup uipc_send of PF_UNIX/SOCK_DGRAM, step 1
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:10 +0000 (09:09 -0700)]
unix/dgram: cleanup uipc_send of PF_UNIX/SOCK_DGRAM, step 1

Remove the dead code.  The new uipc_sosend_dgram() handles send()
on PF_UNIX/SOCK_DGRAM in full.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35294

2 years agounix/dgram: add a specific send method - uipc_sosend_dgram()
Gleb Smirnoff [Fri, 24 Jun 2022 16:09:10 +0000 (09:09 -0700)]
unix/dgram: add a specific send method - uipc_sosend_dgram()

This is first step towards splitting classic BSD socket
implementation into separate classes.  The first to be
split is PF_UNIX/SOCK_DGRAM as it has most differencies
to SOCK_STREAM sockets and to PF_INET sockets.

Historically a protocol shall provide two methods for sendmsg(2):
pru_sosend and pru_send.  The former is a generic send method,
e.g. sosend_generic() which would internally call the latter,
uipc_send() in our case.  There is one important exception, though,
the sendfile(2) code will call pru_send directly.  But sendfile
doesn't work on SOCK_DGRAM, so we can do the trick.  We will create
socket class specific uipc_sosend_dgram() which will carry only
important bits from sosend_generic() and uipc_send().

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35293

2 years agoUFS rename: make it reliable when using SU and reaching nlink limit
Konstantin Belousov [Wed, 22 Jun 2022 13:54:01 +0000 (16:54 +0300)]
UFS rename: make it reliable when using SU and reaching nlink limit

PR: 165392
Reviewed by: mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D35577

2 years agoAdd the SVE reigster definitions
Andrew Turner [Fri, 24 Jun 2022 11:51:26 +0000 (11:51 +0000)]
Add the SVE reigster definitions

Sponsored by: The FreeBSD Foundation

2 years agoTrap SVE instructions until we have SVE support
Andrew Turner [Fri, 24 Jun 2022 11:50:28 +0000 (11:50 +0000)]
Trap SVE instructions until we have SVE support

When running on hardware that supports SVE send the correct signal when
an SVE instruction is run.

Sponsored by: The FreeBSD Foundation

2 years agoFix the zfs build for arm64
Andrew Turner [Fri, 24 Jun 2022 13:16:50 +0000 (13:16 +0000)]
Fix the zfs build for arm64

Remove -mgeneral-regs-only when building the arm64 blake3 code. It
uses simd instructions so will use non-general purpose registers.

Sponsored by: The FreeBSD Foundation

2 years agoifconfig.8: Document -g all and -G all
Mateusz Piotrowski [Fri, 24 Jun 2022 09:38:02 +0000 (11:38 +0200)]
ifconfig.8: Document -g all and -G all

The special group name "all" selects all the interfaces.

MFC after: 3 days

2 years agorc.conf.5: Add missing Ns macros
Mateusz Piotrowski [Fri, 24 Jun 2022 09:31:56 +0000 (11:31 +0200)]
rc.conf.5: Add missing Ns macros

MFC after: 3 days

2 years agoDrop atheros dead link from uath manual page
Sergio Carlavilla Delgado [Fri, 24 Jun 2022 09:22:56 +0000 (11:22 +0200)]
Drop atheros dead link from uath manual page

PR:             264256
MFC after:      2 weeks

2 years agoFix build break in 50dc4c7.
Kirk McKusick [Fri, 24 Jun 2022 02:54:18 +0000 (19:54 -0700)]
Fix build break in 50dc4c7.

No functional change intended.

MFC after:   1 month (with 076002f24d35)

2 years agoWhen a superblock integrity check fails, report the cause of the failure.
Kirk McKusick [Fri, 24 Jun 2022 00:39:05 +0000 (17:39 -0700)]
When a superblock integrity check fails, report the cause of the failure.

No functional change intended.

MFC after:   1 month (with 076002f24d35)
Differential Revision: https://reviews.freebsd.org/D35219

2 years agonfscl: Clean up the code by not using the vnode_vtype() macro
Rick Macklem [Thu, 23 Jun 2022 23:13:12 +0000 (16:13 -0700)]
nfscl: Clean up the code by not using the vnode_vtype() macro

The vnode_vtype() macro was used to make the code compatible
with Mac OSX, for the Mac OSX port.
For FreeBSD, this macro just obscured the code, so
avoid using it to clean up the code.

This commit should not result in a semantics change.

2 years agox86 mptable: Include <x86/legacvar.h> for legacy_get_pcibus().
John Baldwin [Thu, 23 Jun 2022 22:00:12 +0000 (15:00 -0700)]
x86 mptable: Include <x86/legacvar.h> for legacy_get_pcibus().

Fixes: b076d8d54c2f mptable_hostb: Use legacy_get_pcibus() to fetch PCI bus number.
MFC after: 1 week

2 years agouhid(4): Don't read-ahead from the USB IN endpoint.
Hans Petter Selasky [Thu, 23 Jun 2022 17:39:21 +0000 (19:39 +0200)]
uhid(4): Don't read-ahead from the USB IN endpoint.

This avoids an issue where IN endpoint data received from the device right
before the file handle is closed, gets lost.

PR: 263995
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agotcp: Correctly compute the TCP goodput in bits per second by using SEQ_SUB().
Hans Petter Selasky [Thu, 16 Jun 2022 02:42:46 +0000 (04:42 +0200)]
tcp: Correctly compute the TCP goodput in bits per second by using SEQ_SUB().

TCP sequence number differences should be computed using SEQ_SUB().

Differential Revision: https://reviews.freebsd.org/D35505
Reviewed by: rscheff@
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agosubr_bus: restore bus_null_rescan()
Mitchell Horne [Thu, 23 Jun 2022 18:44:28 +0000 (15:44 -0300)]
subr_bus: restore bus_null_rescan()

Partially revert the previous change; we need to keep this method as a
specific override for pci_driver subclasses which should not use
pci_rescan_method() -- cardbus and ofw_pcibus. However, change the return
value to ENODEV for the same reasoning given in the original commit, and
use this as the default rescan method in bus_if.m.

Reported by: jhb
Fixes: 36a8572ee8f5 ("bus_if: provide a default null rescan method")
MFC with: 36a8572ee8f5

2 years agobhyve: Enable suspend/resume support for virtio-blk.
Vitaliy Gusev [Thu, 23 Jun 2022 18:46:06 +0000 (11:46 -0700)]
bhyve: Enable suspend/resume support for virtio-blk.

Reviewed by: jhb
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D26267

2 years agobhyve: Snapshot impovements for 'blockif' backend
Vitaliy Gusev [Thu, 23 Jun 2022 18:46:06 +0000 (11:46 -0700)]
bhyve: Snapshot impovements for 'blockif' backend

When pausing a block I/O device model as part of suspending a VM, wait
for all active block I/O requests to finish before saving snapshot
data.  This avoids having to save information about in-flight requests
both in the block_if layer and in storage device models.

For the AHCI device model, the queues are now guaranteed to be idle
when taking a snapshot, so remove the code to save queue state and
rely on the initial state in a resumed VM having all queues already
idle.

This will also simplify adding NVMe snapshot support in the future.

Reviewed by: jhb
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D26267

2 years agoriscv timer: implement riscv_timer_et_stop()
Mitchell Horne [Tue, 21 Jun 2022 16:23:40 +0000 (13:23 -0300)]
riscv timer: implement riscv_timer_et_stop()

Simply by masking timer interrupts.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35463

2 years agoriscv timer: provide a function for cpu_ticks
Mitchell Horne [Tue, 21 Jun 2022 16:23:31 +0000 (13:23 -0300)]
riscv timer: provide a function for cpu_ticks

This is cheaper than the default of tc_cpu_ticks().

MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35462

2 years agoriscv timer: remove intermediate helper
Mitchell Horne [Tue, 21 Jun 2022 16:23:21 +0000 (13:23 -0300)]
riscv timer: remove intermediate helper

get_counts() doesn't do anything at the moment but return the result of
get_cycles(), so remove it.

For clarity, rename get_cycles() to get_timecount(); RISC-V defines
separate time and cyclecount CSRs, so let's avoid confusing the two.
They may be backed by the same underlying clock, but this is an
implementation detail.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35461

2 years agoriscv timer: cleanup
Mitchell Horne [Tue, 21 Jun 2022 16:22:40 +0000 (13:22 -0300)]
riscv timer: cleanup

- Prune unused definitions and includes
- Slight renaming of callback functions to indicate their usage
- Place vdso_fill_timehands callback logically in the file
- Small style nits

MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35460

2 years agoset_cputicker: use a bool
Mitchell Horne [Tue, 21 Jun 2022 16:22:26 +0000 (13:22 -0300)]
set_cputicker: use a bool

The third argument to this function indicates whether the supplied
ticker is fixed or variable, i.e. requiring calibration. Give this
argument a type and name that better conveys this purpose.

Reviewed by: kib, markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35459

2 years agobus_if: provide a default null rescan method
Mitchell Horne [Tue, 21 Jun 2022 13:29:53 +0000 (10:29 -0300)]
bus_if: provide a default null rescan method

There is an existing helper method in subr_bus.c, but almost no drivers
know to use it. It also returns the same error as an empty method,
making it not very useful. Move this to bus_if.m and return a more
sensible error code.

This gives a slightly more meaningful error message when attempting
'devctl rescan' on buses and devices alike:
  "Device not configured" --> "Operation not supported by device"

Reviewed by: imp
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35501

2 years agoif_ffec: free the dmamem allocation in detach
Mitchell Horne [Wed, 15 Jun 2022 15:53:25 +0000 (12:53 -0300)]
if_ffec: free the dmamem allocation in detach

Calling bus_dmamap_destroy() for a mapping which was allocated with
bus_dmamem_alloc() will result in a panic. This change is not run-time
tested, but I identified the issue while implementing the analogous
method in if_dwc(4), using this implementation as the template.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agoif_ffec: fix some misleading indentation
Mitchell Horne [Sat, 7 May 2022 20:26:44 +0000 (17:26 -0300)]
if_ffec: fix some misleading indentation

2 years agoif_dwc: avoid duplicate packet counts
Mitchell Horne [Tue, 21 Jun 2022 13:24:25 +0000 (10:24 -0300)]
if_dwc: avoid duplicate packet counts

We already increment the unicast IPACKETS and OPACKETS counters in the
rx/tx paths, respectively. Multicast packets are counted in the generic
ethernet code. Therefore, we shouldn't increment these counters in
dwc_harvest_stats().

Drop the early return from dwc_rxfinish_one() so that we still count
received packets with e.g. a checksum error.

PR: 263817
Reported by: Jiahao LI <jiahali@blackberry.com>
Reviewed by: manu
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35499

2 years agoif_dwc: enable RX checksum offload feature
Jiahao Li [Tue, 21 Jun 2022 13:23:43 +0000 (10:23 -0300)]
if_dwc: enable RX checksum offload feature

We claim support in ifcaps, but don't actually enable it.

PR: 263886
Reviewed by: manu
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35498

2 years agoif_dwc: recognize additional rgmii phy-modes
Mitchell Horne [Tue, 21 Jun 2022 13:22:53 +0000 (10:22 -0300)]
if_dwc: recognize additional rgmii phy-modes

Per the reports, some Allwinner device trees now list the desired
phy-mode as "rgmii-id". The manual string comparison fails to detect
this, and we end up falling back to MII mode. Instead, select the clock
name using the sc->phy_mode variable, which is set in the main attach
function.

The logic to actually handle rgmii-id mode delays will be added to the
relevant PHY driver.

PR: 261355, 264673
Reported by: Maren <marentoy@protonmail.com>
Reported by: Arie Bikker <src-2016@bikker.homeunix.net>
Reviewed by: manu
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35500

2 years agoif_dwc: add detach method
Mitchell Horne [Tue, 21 Jun 2022 13:26:44 +0000 (10:26 -0300)]
if_dwc: add detach method

It can be useful for testing.

Reviewed by: manu
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35496

2 years agoif_dwc: consistently use if.c helper methods
Mitchell Horne [Tue, 21 Jun 2022 13:28:06 +0000 (10:28 -0300)]
if_dwc: consistently use if.c helper methods

And if_t rather than struct ifnet *. No functional change intended.

Reviewed by: manu
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35497

2 years agomptable_hostb: Use legacy_get_pcibus() to fetch PCI bus number.
John Baldwin [Thu, 23 Jun 2022 17:49:09 +0000 (10:49 -0700)]
mptable_hostb: Use legacy_get_pcibus() to fetch PCI bus number.

The mptable_hostb driver is a child of legacy0 and has legacy bus
ivars, not PCI or PCI bridge ivars.

PR: 264819
Reported by: Dennis Clarke <dclarke@blastwave.org>
Diagnosed by: avg
Reviewed by: avg
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35548

2 years agozfs: fix static module build broken in 1f1e2261e
Martin Matuska [Thu, 23 Jun 2022 17:42:55 +0000 (19:42 +0200)]
zfs: fix static module build broken in 1f1e2261e

2 years agoses: don't panic if disk elements have really weird descriptors
Alan Somers [Fri, 10 Jun 2022 22:44:59 +0000 (16:44 -0600)]
ses: don't panic if disk elements have really weird descriptors

SES allows element descriptors to contain characters like spaces and
quotes that devfs does not allow to appear in device aliases.  Since SES
element descriptors are outside of the kernel's control, we should
gracefully handle a failure to create a device physical path alias.

PR: 264513
Reported by: Yuri <yuri@aetern.org>
Reviewed by: imp, mav
Sponsored by: Axcient
MFC after: 2 weeks

2 years agozfs: merge openzfs/zfs@deb121309
Martin Matuska [Thu, 23 Jun 2022 15:47:42 +0000 (17:47 +0200)]
zfs: merge openzfs/zfs@deb121309

Notable upstream pull request merges:
  #12918 Introduce BLAKE3 checksums as an OpenZFS feature
  #13553 Reduce ZIO io_lock contention on sorted scrub
  #13537 Improve sorted scan memory accounting
  #13540 AVL: Remove obsolete branching optimizations
  #13563 FreeBSD: Improve crypto_dispatch() handling

Obtained from: OpenZFS
OpenZFS commit: deb1213098e2dc10e6eee5e5c57bb40584e096a6

2 years agobsdinstall: improve zfsboots ability to handle datasets under a BE
Brad Davis [Tue, 7 Jun 2022 17:11:02 +0000 (11:11 -0600)]
bsdinstall: improve zfsboots ability to handle datasets under a BE

Currently we only set canmount=noauto on the root of the BE, this
change makes it so we set it on all datasets under the BE as well.

Reviewed by: allanjude
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35422

2 years agoAdd tests for TCP_MD5 getsockopt
Claudio Jeker [Thu, 23 Jun 2022 14:54:26 +0000 (15:54 +0100)]
Add tests for TCP_MD5 getsockopt

Add tests for TCP_MD5 getsockopt for ipv6 and ipv4. These will only run
when the kernel module is loaded, but will be in place if further
regressions are found.

Reviewed by: rscheff
MFC after: 3 days
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35532

2 years agoUnlock inp when handling TCP_MD5SIG socket options
Claudio Jeker [Thu, 23 Jun 2022 14:50:47 +0000 (15:50 +0100)]
Unlock inp when handling TCP_MD5SIG socket options

Unlock the inp when hanlding TCP_MD5SIG socket options. tcp_ipsec_pcbctl
handles locking the inp when the option is being modified.

This was found by Claudio Jeker while working on the OpenBGPd port.

On 14 we get a panic when trying to call getsockopt, on 13.1 the process
locks up using 100% CPU.

Reviewed by: rscheff (transport), tuexen
MFC after: 3 days
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D35532

2 years agoadjkerntz(8): revert "detect extra jailed invokation to keep logs clean"
Eugene Grosbein [Thu, 23 Jun 2022 14:46:08 +0000 (21:46 +0700)]
adjkerntz(8): revert "detect extra jailed invokation to keep logs clean"

This reverts commit 048ce0876f5421f70a6d348479bdeacdd8472bed
due to bugs. Reworked change will be committed later hopefully.

2 years agodiff3: Add man page description for version and help
Tom Jones [Thu, 23 Jun 2022 12:37:28 +0000 (13:37 +0100)]
diff3: Add man page description for version and help

Reviewed by: Pau Amma
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35325

2 years agolibsysdecode: Fix a typo in my email
Dmitry Chagin [Thu, 23 Jun 2022 09:29:29 +0000 (12:29 +0300)]
libsysdecode: Fix a typo in my email

Reported by: Mikaël Urankar
MFC after: 2 weeks

2 years agopf: copy out rather than m_pullup() in pf_test_eth_rule()
Kristof Provost [Wed, 22 Jun 2022 14:52:24 +0000 (16:52 +0200)]
pf: copy out rather than m_pullup() in pf_test_eth_rule()

Don't change the mbuf chain layout. We've encountered alignment issues
in the tcp syncookie code on armv7, which are triggered by the
m_pullup() here.

Reviewed by: mjg
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35551

2 years agowpa: Disable P2P in WPS
Cy Schubert [Thu, 23 Jun 2022 03:51:27 +0000 (20:51 -0700)]
wpa: Disable P2P in WPS

Disable P2P in WPS as it is not supported by FreeBSD. Also, it is not
enabled in wpa_supplicant so the WPS P2P code is redundant.

PR: 264238
Reported by: adrian
MFC after: 3 days

2 years agoffs: fix vn_read_from_obj() usage for PAGE_SIZE > block size
Chuck Silvers [Wed, 22 Jun 2022 21:52:42 +0000 (14:52 -0700)]
ffs: fix vn_read_from_obj() usage for PAGE_SIZE > block size

vn_read_from_obj() requires that all pages of a vnode (except the last
partial page) be either completely valid or completely invalid,
but for file systems with block size smaller than PAGE_SIZE,
partially valid pages may exist anywhere in the file.
Do not enable the vn_read_from_obj() path in this case.

Reviewed by: mckusick, kib, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D34836

2 years agonfsd: Clean up the code by not using the vnode_vtype() macro
Rick Macklem [Wed, 22 Jun 2022 20:20:32 +0000 (13:20 -0700)]
nfsd: Clean up the code by not using the vnode_vtype() macro

The vnode_vtype() macro was used to make the code compatible
with Mac OSX, for the Mac OSX port.
For FreeBSD, this macro just obscured the code, so
avoid using it to clean up the code.

This commit should not result in a semantics change.

2 years agorelease: arm - increase IMAGE_SIZE
Glen Barber [Wed, 22 Jun 2022 18:23:39 +0000 (14:23 -0400)]
release: arm - increase IMAGE_SIZE

For some reason, while 3072M is sufficient for 14-CURRENT, it is not
for 13-STABLE.  Notably, previous investigations suggest that there
are changes to makefs(8) in main that do not exist in stable/13,
in which 14-CURRENT seems perfectly happy to ignore the target image
size is smaller than the data being populated to it.

I have no futher investigative details at the moment, but as this had
caused arm failures for the past three weeks, this is the more hasty
measure, hence the MFC timeframe noted.

MFC after: 10 minutes
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agosrc.conf.5: regen after RELRO knob addition
Ed Maste [Wed, 22 Jun 2022 16:21:31 +0000 (12:21 -0400)]
src.conf.5: regen after RELRO knob addition

2 years agoAdd RELRO build knob, default to enabled
Ed Maste [Wed, 22 Jun 2022 12:58:04 +0000 (08:58 -0400)]
Add RELRO build knob, default to enabled

Note that lld enables relro by default, so that we already had either
partial or full RELRO, depending on the state of the BIND_NOW knob.

Add a RELRO knob so that the option can be disabled if desired, and so
that builds using the GNU toolchain are equivalent to those using the
standard Clang/LLVM toolchain.

Reviewed by: markj
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35545

2 years agorouting: improve debug logging
Alexander V. Chernikov [Wed, 22 Jun 2022 15:04:17 +0000 (15:04 +0000)]
routing: improve debug logging

Use standard logging (FIB_XX_LOG) across nhg code instead of using
 old-style DPRINTFs.
 Add debug object printer for nhgs (`nhgrp_print_buf`).

Example:

```
Jun 19 20:17:09 devel2 kernel: [nhgrp] inet.0 nhgrp_ctl_alloc_default: multipath init done
Jun 19 20:17:09 devel2 kernel: [nhg_ctl] inet.0 alloc_nhgrp: num_nhops: 2, compiled_nhop: 2

Jun 19 20:17:26 devel2 kernel: [nhg_ctl] inet.0 alloc_nhgrp: num_nhops: 3, compiled_nhop: 3
Jun 19 20:17:26 devel2 kernel: [nhg_ctl] inet.0 destroy_nhgrp: destroying nhg#0/sz=2:[#6:1,#5:1]
```

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

2 years agovendor/bc: update to upstream commit ca53adf83b7a
Stefan Eßer [Wed, 22 Jun 2022 13:41:40 +0000 (15:41 +0200)]
vendor/bc: update to upstream commit ca53adf83b7a

The filter_text function in scripts/functions.sh in version 5.3.3 had
commented out a "rm" command, probably for debugging purposes. This
caused temporary files to persist in /tmp when the bc program had been
built.

This commit fixes the build process with no change of the resulting
artefacts.

(cherry picked from commit 1576f66712876ee8b0fcc8b35fb062e1813b4fc0)

MFC after: 3 days

2 years agonetstat: print path weight when showing routes in structured output.
Alexander V. Chernikov [Mon, 20 Jun 2022 08:59:15 +0000 (08:59 +0000)]
netstat: print path weight when showing routes in structured output.

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

2 years agoUFS: make mkdir() and link() reliable when using SU and reaching nlink limit
Konstantin Belousov [Sat, 18 Jun 2022 10:59:31 +0000 (13:59 +0300)]
UFS: make mkdir() and link() reliable when using SU and reaching nlink limit

i_nlink overflow might be transient, i_effnlink indicates the final
value of the link count after all dependencies would be resolved. So if
i_nlink reached the maximum but i_efflink did not, we should be able to
make the link by syncing.

We must sync the whole filesystem to resolve dependencies,
which requires unlocking vnodes locked for VOPs.  Use existing
ERELOOKUP/VOP_UNLOCK_PAIR() mechanism to restart the VOP if sync with
unlock was done.

PR: 165392
Reported by: Vsevolod Volkov <vvv@colocall.net>
Reviewed by: mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D35514

2 years agolinprocfs: Skip printing of the guard page in the /proc/self/maps
Dmitry Chagin [Wed, 22 Jun 2022 11:49:40 +0000 (14:49 +0300)]
linprocfs: Skip printing of the guard page in the /proc/self/maps

To calculate the base (lowest addressable) address of the stack of the
initial thread glibc parses /proc/self/maps.
In fact, the base address is calculated as 'to' value of stack entry of the
/proc/self/maps - stack size limit (if the stack grows down).
The base address should fit in between preceding entry and stack entry of
the /proc/self/maps.
In FreeBSD, since 19bd0d9 (Implement address space guards), we actually
have two mappings for the stack region. The first one is the no-access
mapping for the region the stack can grow into (guard page), and the
second - initial stack region with size sgrowsiz.
The first mapping confuses Glibc, in the end which is improperly
calculate stack size and the base address.

PR: 253337
Reviewed by: kib
Differential revision: https://reviews.freebsd.org/D35537
MFC after: 2 week

2 years agokdump: Decode Linux *at() syscalls
Dmitry Chagin [Wed, 22 Jun 2022 11:29:38 +0000 (14:29 +0300)]
kdump: Decode Linux *at() syscalls

MFC after: 2 weeks