ctld: correctly parse LUN size on 32-bit arches
Disk offset values must always be 64-bit, not size_t.
PR: 214874
Submitted by: pprocacci at gmail.com
MFC after: 2 weeks
Event: January 2025 Bug-busting session
certctl: Set METALOG ownership to root:wheel
This sets the correct ownership values when building base.txz
This is an updated version of commit 10fa3f2518d4, omitting the
`-N ${DESTDIR}${DISTBASE}/etc` from the original commit.
install(1) does not validate the arguments passed to -o or -g
(see PR283355) so there's no need to have the passwd db available
for now. Future work includes plumbing the appropriate passwd db
path through certctl, and validating uid and gid in install(1).
PR: 283340
Reviewed by: jrtc27
Differential Revision: https://reviews.freebsd.org/D48506
cam: Add 3e/3 as a fatal code
We see this error:
(da4:mps0:0:3:0): SCSI sense: HARDWARE FAILURE asc:3e,3 (Logical unit failed self-test)
for drives that have failed. Our vendor tells us there's no recovery
from that state, though we can still grab logs from the drives and run
their diagnostics. Drives in this state need to bascially be
remanufactured because some part of them has failed. The prior default
behavior is to retry, and retrying takes a long time to work
out. Instead, short-circuit the retries and fail right away. I selected
ENXIO because no I/O to LBAs is possible for drives in this state (both
my experience and per vendor). Some googling suggests that other vendors
behave identically, but it was inconclusive. Should this be too
pessimistic, we can adjust in the future. Also, this is with some aging
drives in our fleet, and if we have more than one drive in this state,
our systems take so long to get to mountroot that the watchdog fires
sometimes. Adding this patch makes them boot reliably again.
[5 lines not shown]
nfscl: Simplify the deleg argument for nfscl_deleg()
The deleg argument to nfscl_deleg() is a "struct nfscldeleg **"
although the returned pointer value is never used by callers.
This patch changes the argument to "struct nfscldeleg *" to
simplify the call and avoid any confusion w.r.t. use of the
returned value.
This patch should not create any NFS semantics change.
sockets: virtualize kern.ipc.numopensockets
To avoid breaking POLA on the host machine it reports the same value as
before. In a VNET jail it now reports number of sockets in this jail.
PR: 219655
Differential Revision: https://reviews.freebsd.org/D48315
(cherry picked from commit 59498e099cc055da7afca8266087b7668be6d7cb)
sockets: virtualize kern.ipc.numopensockets
To avoid breaking POLA on the host machine it reports the same value as
before. In a VNET jail it now reports number of sockets in this jail.
PR: 219655
Differential Revision: https://reviews.freebsd.org/D48315
(cherry picked from commit 59498e099cc055da7afca8266087b7668be6d7cb)
sed: The change ("c") command should start a new cycle.
The "c" command should start the next cycle as clarified in POSIX 2024.
This is also consistent with historical and gnu sed behavior.
This patch is from OpenBSD by way of NetBSD with a tweak to the man page
date by me.
Confirmed the test case in the bug now works.
PR: 271817
Obtained from: NetBSD (1.39 uwe), OpenBSD (1.39 millert)
Sponsored by: Netflix
(cherry picked from commit a2d78713171cf138b5ae50d61f82df1af7574c95)
sed: The change ("c") command should start a new cycle.
The "c" command should start the next cycle as clarified in POSIX 2024.
This is also consistent with historical and gnu sed behavior.
This patch is from OpenBSD by way of NetBSD with a tweak to the man page
date by me.
Confirmed the test case in the bug now works.
PR: 271817
Obtained from: NetBSD (1.39 uwe), OpenBSD (1.39 millert)
Sponsored by: Netflix
(cherry picked from commit a2d78713171cf138b5ae50d61f82df1af7574c95)
Fix "vrefact: wrong use count 0" with DRM
Bump the vnode use count, not its hold count. This fixes a panic triggered
by fstatat(..., AT_EMPTY_PATH) on DRM device nodes, which happens to be
what glxinfo(1) from Ubuntu Jammy is doing.
PR: kern/274538
Reviewed By: kib (earlier version), olce
Differential Revision: https://reviews.freebsd.org/D47391
(cherry picked from commit fc595a6b76642dfdfdb8e6f9b9bbc734e95fb59c)
Fix "vrefact: wrong use count 0" with DRM
Bump the vnode use count, not its hold count. This fixes a panic triggered
by fstatat(..., AT_EMPTY_PATH) on DRM device nodes, which happens to be
what glxinfo(1) from Ubuntu Jammy is doing.
PR: kern/274538
Reviewed By: kib (earlier version), olce
Differential Revision: https://reviews.freebsd.org/D47391
(cherry picked from commit fc595a6b76642dfdfdb8e6f9b9bbc734e95fb59c)
libc: Fix getentropy POSIX 2024 conformance issues
GETENTROPY_MAX should be defined in limits.h. EINVAL is the return
value for buflen > GETENTROPY_MAX.
PR: 282783
Reviewed by: markj, asomers, jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47689
Revert "certctl: Set METALOG ownership to root:wheel"
This introduces a circular dependency because it requires an existing
dbdir for install -N, which might not yet exist.
I imagine we can use install -o 0 -g -0, avoiding the need for the
dbdir, but install emits uname=0 gname=0 rather than uid=0 gid=0.
So just revert for now pending a full fix.
This reverts commit 10fa3f2518d4582c98d74527f79af9f30b1eceab.
PR: 283340
Event: January 2025 Bug-busting session
Sponsored by: The FreeBSD Foundation
UPDATING: Remove tarfs reference that slipped through
Forgot to add my modifications to UPDATING to the git index (should have
made it in the previous commit).
Differential Revision: https://reviews.freebsd.org/D48093
RELNOTES: Document recent file handle layout changes
Reviewed by: olce, rmacklem, imp, emaste
Differential Revision: https://reviews.freebsd.org/D48093
(cherry picked from commit e0b7a9b6bee16f4855b392c0941e76b7fef777a0)
This commit has been adapted for stable/13 (references of the relevant
commits and the date have been changed) and the commits that actually
have been MFCed so far (mentions of tarfs and tmpfs have been removed).
RELNOTES: Document recent file handle layout changes
Reviewed by: olce, rmacklem, imp, emaste
Differential Revision: https://reviews.freebsd.org/D48093
(cherry picked from commit e0b7a9b6bee16f4855b392c0941e76b7fef777a0)
This commit has been adapted for stable/14 (references of the relevant
commits and the date have been changed) and the commits that actually
have been MFCed so far (mention of tmpfs has been removed).
libc: Add include path for aarch64 memchr.S
Reported by: bapt
Sponsored by: The FreeBSD Foundation
Fixes: d355c28a0954 ("depend-cleanup: bea89d038ac5 also moved memchr")
iwmbtfw: Check firmware exists before trying to upload it
In the case of an Intel 7260 device, the device needs to be put
into something called "manufacturer mode" before the firmware
is uploaded. The firmware is then upladed, and the card is
taken out of this mode, at which point it disconnects and
reconnects to the USB bus, and is at that point usable.
However, iwmbtfw(8) puts the device into manufacturer mode
before verifying that there exists a copy of the firmware to
upload. As a result, in the case where there is no firmware
available on disk, the device is put into manufacturer mode,
the firmware can't be found so isn't uploaded, and the card is
brought out of manufacturer mode, so it disconnects and
reconnects to the USB bus.
Enter devd(8). There are rules in /etc/devd/iwmbtfw.conf to
call iwmbtfw(8) when the device appears. When there's no
firmware on disk, devd will call iwmbtfw, iwmbtfw will try to
[11 lines not shown]
iwm: add sku_cap_mimo_disable; populate sku_cap_11n_enable
This is a flag to be used to disable >1 antenna support, even if
the radio supports it.
Also populate sku_cap_11n_enable, which indicates HT is available.
It's a no-op right now; it's one of the requirements for properly
configuring HT support and transmit/receive antenna configurations.
Obtained from: OpenBSD (at a6e25c727a2214219715b51ba6af2221d7e0d674, 22-Oct-2021)
Differential Revision: https://reviews.freebsd.org/D48210
Reviewed by: bz
iwm: update rate tables from OpenBSD
These are from an earlier version of the driver (22-Oct-2021) which
I started to sync against back in 2021.
These pull in the rest of the VHT and HT rates.
Since that driver has functioning 802.11n support, it makes a good
intermediary checkpoint.
Locally tested:
* 7260, STA mode, 11g and 11a modes
Differential Revision: https://reviews.freebsd.org/D48209
Obtained from: OpenBSD (at a6e25c727a2214219715b51ba6af2221d7e0d674, 22-Oct-2021)
pf tests: reproduce use-after-free in fragment reassembly
Produce an IPv6 packet that's longer than 65535 bytes so it'll get dropped in
pf_reassemble6(). This can then causes pf_normalize_ip6() to return an error,
which led pf_setup_pdesc() to fail to update *m0, eventually ending up with
pf_scrub() attempting to modify *m0 (now different from pd->m), a freed mbuf.
This does depend on pf_join_fragment()'s call to m_cat() freeing the relevant
mbuf rather than adding it to the chain. Accomplish this by ensuring there's
sufficient free space, by having dummymbuf re-allocate larger mbufs for our
fragments.
PR: 283705
Reported by: Yichen Chai <yichen.chai at gmail.com>, Zhuo Ying Jiang Li <zyj20 at cl.cam.ac.uk>
Sponsored by: Rubicon Communications, LLC ("Netgate")
dummymbuf: add 'enlarge'
Teach dummymbuf to replace mbufs with larger ones.
This can be useful for testing for bugs that depend on mbuf layout.
Sponsored by: Rubicon Communications, LLC ("Netgate")
pf: clean up mbuf passing for reassembly
When we call pf_normalize_ip() or pf_normalize_ip6() we passed the mbuf twice.
Once as m0, and once inside the struct pf_pdesc. Remove the former to avoid
confusion when we free *m0, but don't update pd->m.
This could lead to use-after-free errors e.g. if reassembly failed.
PR: 283705
Reported by: Yichen Chai <yichen.chai at gmail.com>, Zhuo Ying Jiang Li <zyj20 at cl.cam.ac.uk>
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
depend-cleanup: bea89d038ac5 also moved memchr
Commit bea89d038ac5 added strlcat but also introduced a memchr wrapper
in the source tree rather than using the autogenerated one used for
AARCH64_STRING_FUNCS. Move memchr.S to MDSRS and add a cleanup rule for
the old wrapper.
Reviewed by: fuz
Sponsored by: The FreeBSD Foundation
Fixes: bea89d038ac5 ("lib/libc/aarch64/string: add strlcat SIMD implementation")
Differential Revision: https://reviews.freebsd.org/D48502
ext2fs: 'struct ufid': Re-order fields and unpack
Re-ordering the fields suppresses the trailing padding which was causing
the structure to overflow 'struct fid'.
While here, re-indent in a more visually pleasing way.
Reviewed by: rmacklem, emaste, markj
Approved by: markj (mentor)
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D47955
(cherry picked from commit 8ae6247aa966989412bd75fc7c26728690b9e944)
Sponsored by: The FreeBSD Foundation
ext2fs: Fix the size of struct ufid and add a static assert
File system specific *fid structures are copied into the generic
struct fid defined in sys/mount.h.
As such, they cannot be larger than struct fid.
This patch packed the structure and checks via a __Static_assert().
Reviewed by: markj
MFC after: 2 weeks
(cherry picked from commit bfc8e3308bee23d0f7836d57f32ed8d47da02627)