exterr(9): add a few tests of new message formats
This is enough to show that the idea works (and to exercise
uexterr_set()), but isn't complete by any means.
Reviewed by: kib
Effort: CHERI upstreaming
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D58060
runtime: add the ability to set exterrors in userspace
The UEXTERROR(3) macro is a partial analog to EXTERROR(9) that sets
the current user exterror state and errno. The main difference is
that it returns no value and sets errno directly since that's the
typical pattern in libraries.
While here move the storage and constructor for single-threaded
program's uexterr to its own file.
Reviewed by: kib
Effort: CHERI upstreaming
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D58059
exterr: relax format restrictions
Rather than passing the format string to printf and forcing the
arguments to be (u)intmax_t, partially parse format strings and cast
p1 and p2 to the correct type before running the individual format
though printf. This restructure has a couple motivatations:
- We can skip formats that make no sense (floating point, %n, etc.).
- It is possible to special case the printing of pointers in the
CHERI case.
The first case is motivated by a suggestion from the audiance at
one of Kirk's BSDCan talks on exterr to allow userspace to set exterr
status. Allowing arbitrary format strings including %n creates a
write-what-where gadget so we need to not do that.
The second case is motivated by our experinces with CHERI and debugging
mmap issues using a different textual error reporting framework. With
CHERI, pointers are more than integer addresses and it's useful to
include more details. Doing so will follow in a future commit.
[8 lines not shown]
msun: Fix a typo in a source code comment
- s/uneccessarily/unnecessarily/
Obtained from: NetBSD
(cherry picked from commit cd4aae2fa9d35015248c445752e23800e75e8517)
msun: Fix a typo in a source code comment
- s/uneccessarily/unnecessarily/
Obtained from: NetBSD
(cherry picked from commit cd4aae2fa9d35015248c445752e23800e75e8517)
e1000: Report 82571 packet buffer ECC errors
The 82571 PBA_ECC register contains a 12-bit count of packet buffer ECC
detections. The shared code enables single-bit correction, but neither
FreeBSD nor the DPDK base driver consumes the counter.
Sample it with the ordinary statistics timer, accumulate the value under
dev.em.N.memory_errors.detected_packet_buffer, and clear the hardware
counter while preserving correction and reserved register state. Do not
enable its shared interrupt: the register does not distinguish corrected
from uncorrectable events and does not provide a safe fatal recovery
policy.
Validated on a dual port 82571EB. Both functions reported zero after a
clean boot, and a controlled link down/up cycle left the counter at zero
while the management link recovered at 1 Gb/s without issue.
MFC after: 2 weeks
Sponsored by: BBOX.io
New version of jng (9.1)
Update examples and comments to return eifaces in exec.prestop
with ifconfig -vnet (before jng shutdown in poststop).
Reported by: jlduran
PR: 268397
MFC after: 1 week
Reviewed by: kfv, jlduran
Differential Revision: https://reviews.freebsd.org/D58939
tarfs: remove PRIV_VFS_MOUNT_PERM check
The backing file is already opened successfully, so there is
no need to override the permissions.
Reviewed by: des
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58832
netlink: Parse repeated nested attributes
Modern Netlink arrays encode their elements as repeated attributes of
the same type rather than as children of an additional array container.
Add an SNL callback that parses one nested element for each occurrence
and appends it to a geometrically grown parser array. Retain the
existing parray callback for protocols that use the legacy container
form.
Store the growth capacity in struct snl_parray, appended after its
existing public count and items fields so their offsets remain stable
on LP64 and ILP32. Require parser targets to be real snl_parray
objects, and convert bitset, generic Netlink, and route multipath arrays
accordingly. This avoids relying on layout aliases for private growth
state.
Add regression coverage for a nested bit array that grows beyond its
initial allocation, while preserving replacement semantics when a
[5 lines not shown]
linux: Add STF type and convert some if_type to ARPHRD
Convert IFT_BRIDGE and IFT_L2VLAN to ARPHRD_ETHER, and IFT_LOOP
to ARPHRD_LOOPBACK in linux netlink.
Also, add ARPHRD_SIT and convert IFT_STF to it.
Reviewed by: kfv
Differential Revision: https://reviews.freebsd.org/D58573
nhop.9: Rewrite relics of rtentry.9 into nhop.9
Parts of rtentry.9 information such as information related to
the nexthop is outdated.
Remove those relics and add the new design into separate
manual instead.
Reviewed by: bcr
Discussed with: ziaee
Differential Revision: https://reviews.freebsd.org/D58564