kern_jail_set(): do not double-free opts
If vfs_buildopts() failed, vfs_freeopts() must not be called.
Reported and tested by: pho
Reviewed by: jamie
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D53612
cam: Add a number of asserts to catch bad transactions
Ensure that we're in the right state / priority for each of the states
in the driver. These asserts assured that a prior patch that I committed
to fix a priority leak worked when a drive departed (and bounced back
too!). These have been running in our production since I committed the
change and haven't trigged.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D53259
sysrc.8: Rewrite examples for mdoc conformance
Tag SPDX while here. This is not a content change, so do not bump date.
PR: 274164
MFC after: 3 seconds
(cherry picked from commit 3f0dd7724658126dcfde488a994cf7698353a82c)
sysrc.8: Rewrite examples for mdoc conformance
Tag SPDX while here. This is not a content change, so do not bump date.
PR: 274164
MFC after: 3 seconds
(cherry picked from commit 3f0dd7724658126dcfde488a994cf7698353a82c)
freebsd-update: Swap pkg(8) flags in check_pkgbase()
Unbootstrapped pkg will ignore -N if -r is specified first. Flip the
order.
Prior to commit 66c75fa63aff this worked by accident.
PR: 290393
Reported by: olgeni
MFC after: 3 days
Fixes: 66c75fa63aff ("freebsd-update: Fix the pkgbase check")
stand: Teach the zfs loader about dynamic gang headers
There is a pool feature, dynamic_gang_header, that is enabled by default
in new pools. When this feature is active, gang headers may be larger
than 512 bytes. The loader needs to be taught to cope with that.
Try using the vdev ashift to pick the gang block header size. If the
checksum fails, fall back to the old gang block header size.
This is based on a patch by Paul Dagnelie, with testing, bug-fixing and
some simplifications from me.
PR: 289690
Co-authored by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53578
lib/ofed: Move to the rdma package
We have an existing rdma package for IB/rdma-related files, but most
of ofed isn't in that package, making it rather useless. Move all of
lib/ofed to the rdma package.
Add a separate rdma-lib package using LIB_PACKAGE, since utilities
depends on the rdma libraries and we don't want that to pull in all
of rdma.
This change moves files between packages so, until we have a proper
policy on how to handle this in release/stable branches, it should
not be MFC'd.
PR: 263227
MFC after: never
Reviewed by: manu
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53604
lib/googletest: Move to a new googletest package
gtest/gmock are not normally used by users unless running the tests,
so they shouldn't be in the utilities package. Move them to a new
googletest package, to match what we did with ATF/Kyua.
While here, move tests dependencies from tests-all.ucl to tests.ucl,
which is the canonical place for that.
This change adds a new package to the system so, until we have a proper
policy on how to handle this in release/stable branches, it should not
be MFC'd.
MFC after: never
Reported by: emaste
Reviewed by: manu
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53607
periodic: Move 320.whatis to the mandoc package
This periodic script only makes sense if mandoc is installed, so move
it to the mandoc package like other periodic scripts.
/usr/libexec/makewhatis.local only exists for the enjoyment of this
script, and doesn't work without mandoc installed, so move that as
well.
This change moves files between packages so, until we have a proper
policy on how to handle this in release/stable branches, it should
not be MFC'd.
MFC after: never
Reviewed by: ziaee, manu
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53609
share/doc/llvm: Move to the clang package
This change moves files between packages so, until we have a proper
policy on how to handle this in release/stable branches, it should
not be MFC'd.
MFC after: never
Reviewed by: manu, dim
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53608
ncurses: Move termcap and tabset to ncurses-lib
termcap and tabset are currently in runtime, but since ncurses is the
only thing which uses them, they belong in the ncurses package.
curses without termcap is not very useful, so put them in the -lib
subpackage rather than ncurses itself, so that installing ncurses-lib
provides a working curses.
This change moves files between packages so, until we have a proper
policy on how to handle this in release/stable branches, it should
not be MFC'd.
MFC after: never
Discussed with: kevans
Reviewed by: manu, kevans
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D53610
Revert "kern: RACCT: Keep process credentials alive via references"
The change causes a panic on boot with INVARIANTS kernels. Revert for
now.
This reverts commit a5d1a0c9bfcca38528b861c5afb51ea9b1696b65.
Reported by: syzbot+74624c6fcbb384ea0113 at syzkaller.appspotmail.com
ice.4: Add ToC and E835 and editorial pass
This manual is large enough and well structured enough that we can have
a clickable table of contents. Use that to move some subsections which
should not appear in Hardware Release Note to the description section.
Adjust subsection names so this will work, preserving parentheticals
for search by moving them to the bodies just below.
Strip unnecessary copyright symbols and escaped hyphens. Copyright
symbols never appear in the content of manual pages, including other
Intel manual pages, and appear to break the Hardware Release Notes.
Escaped hyphens were necessary decades ago for manual pages written
in man(7), but this page is written in mdoc(7). Also misc touchups.
Add the recently added E835 devices to the supported HARDWARE list.
Add the speed ranges to description like the other ethernet drivers.
PR: 290778
MFC after: 1 day
[7 lines not shown]
mixer(8): Update FILES section
While here, change "N" to "X" to match sndctl.8's notation.
Sponsored by: The FreeBSD Foundation
MFC after: 4 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D53503
etc/mtree/BSD.include.dist: Remove libipt-dev
This package only exists on amd64, which means on other platforms we
produce an empty package containing nothing but this directory, and
without a base package (libipt) that package fails to install due to
a missing dependency.
For now, fix this by removing the libipt-dev package tag, which moves
this directory to clibs.
Fixes: 436618a427b4 ("etc/mtree: Add package tags for /usr/include")
Reported by: cperciva
MFC after: 3 seconds
(cherry picked from commit 2a8a6179eb6cef8ba1a417a4c8a1f7063c704533)
etc/mtree/BSD.include.dist: Remove libipt-dev
This package only exists on amd64, which means on other platforms we
produce an empty package containing nothing but this directory, and
without a base package (libipt) that package fails to install due to
a missing dependency.
For now, fix this by removing the libipt-dev package tag, which moves
this directory to clibs.
Fixes: 436618a427b4 ("etc/mtree: Add package tags for /usr/include")
Reported by: cperciva
MFC after: 3 seconds
cron: Use reallocarray() to prevent integer overflow
Apply OpenBSD env.c,v 1.24 and 1.25, which replaces manual size
calculations with reallocarray() to prevent possible integer
overflow.
(cherry picked from commit 40d21618382108fefa84f8576b14302f65452718)
cron: Use reallocarray() to prevent integer overflow
Apply OpenBSD env.c,v 1.24 and 1.25, which replaces manual size
calculations with reallocarray() to prevent possible integer
overflow.
(cherry picked from commit 40d21618382108fefa84f8576b14302f65452718)
kern: RACCT: Keep process credentials alive via references
In system calls changing process credentials, on RACCT, calls to
racct_proc_ucred_changed() must be issued on the new credentials.
Currently, this is done after the new credentials have been installed on
the process via proc_set_cred() or proc_set_cred_enforce_proc_lim(),
which modifies 'p_ucred'. Only the process lock guarantees that the new
credentials pointed to by 'p_ucred' cannot themselves be concurrently
modified, which would cause their 'struct ucred' to potentially lose its
last reference from the process before the call to
racct_proc_ucred_changed(), which needs one.
For better code understandability and to avoid errors in future
modifications, stop relying on proc_set_cred*() storing the passed
'struct ucred' in the process 'p_ucred' and on the process lock to avoid
the reference taken by proc_set_cred*() to vanish. Instead, ensure that
a reference is held when racct_proc_ucred_changed() is called.
As racct_proc_ucred_changed() is actually passed explicit pointers to
[24 lines not shown]