kgssapi: Remove broken MOD_UNLOAD code
The module panicked at unload with "recursing but non-recursive rw".
There is a comment that "Unloading of the kgssapi module is not
currently supported" and the MOD_UNLOAD case falls through to returning
EOPNOTSUPP anyway. Just #if 0 the code in the unload path, leaving it
as a hint in case someone implements unload support later on.
PR: 291249
Reviewed by: rmacklem
Fixes: ad704a34bc2c ("Use syscall_helper_register(9) rather than syscall_register().")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53949
(cherry picked from commit 6901376f59b870ddbb0d922e3455a388333cd460)
(cherry picked from commit ab4f4f4efaac85bbf235e60f2ced4876a9e916f2)
vt: Allow VT_SETMODE with frsig=0
Linux does not check that any of the signals in vt_mode VT_SETMODE ioctl
(relsig, acqsig, frsig) are valid, but FreeBSD required that all three
are valid. frsig is unusued in both Linux and FreeBSD, and software
typically leaves it unset. To improve portability, allow frsig to be
set to zero.
PR: 289812
Reported by: Dušan Gvozdenović
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52835
(cherry picked from commit 5198c32210039d8dc92554647384eee75688848c)
diff3: Use logical-not, not bitwise for booleans
And compare impcompat != 0 as it's actually an integer incremented on
each use of one of the AeExX3 options.
Reviewed by: fuz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53808
(cherry picked from commit abcb80f46c2607fc16564ca87cc25f0908f29f99)
diff3: Remove bespoke getopt.h
diff3's getopt.h included a function declaration without a prototype,
which produces a compiler warning. Just remove the bespoke getopt.h
and use the system header.
Reported by: Mark Millard
Reviewed by: fuz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53802
(cherry picked from commit 38829592dc77e9ead4259785e0bfb93bd4c2fe34)
kgssapi: Remove broken MOD_UNLOAD code
The module panicked at unload with "recursing but non-recursive rw".
There is a comment that "Unloading of the kgssapi module is not
currently supported" and the MOD_UNLOAD case falls through to returning
EOPNOTSUPP anyway. Just #if 0 the code in the unload path, leaving it
as a hint in case someone implements unload support later on.
PR: 291249
Reviewed by: rmacklem
Fixes: ad704a34bc2c ("Use syscall_helper_register(9) rather than syscall_register().")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53949
(cherry picked from commit 6901376f59b870ddbb0d922e3455a388333cd460)
agp: Export intel_gtt_read_pte, required by i915kms
This isn't used by modern cards, but is needed for i915kms to load
on a system that has agp as a module not compiled into the kernel.
PR: 291214
Reviewed by: cy
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53906
(cherry picked from commit a87c1e2dd8fc997d6ee603c252c543afe8a4d2a4)
mqueue: Export kern_kmq_* symbols from kernel module
linux.ko supports POSIX message queues using these symbols, so they need
to be exported rather than relying on the kernel linker's misfeature of
linking against debug or local symbols (which will soon be disabled by
default).
Reported by: mav
Reviewed by: zlei
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53907
(cherry picked from commit e00a781c216cb12603a0a71c9ca293dde3e06250)
(cherry picked from commit eb90470f5f2a0e5c820c47be329423f5c60ca247)
rman: Embed the mutex in struct rman instead of using a separate allocation
This used a separate allocation when rman was first imported (back
when the lock was a pre-SMPng "simplelock" instead of a mutex).
Reported by: des
Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D54143
rman: Simplify initialization of internal globals
Use TAILQ_HEAD_INITIALIZER and MTX_SYSINIT to remove the 'once' code
from rman_init.
Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D54142
lldb: Fix empty register set when trying to get size of register
The register set information is stored as a singleton in
GetRegisterInfo_i386. However, other functions later access this
information assuming it is stored in GetSharedRegisterInfoVector. To
resolve this inconsistency, we remove the original construction logic
and instead initialize the singleton using llvm::call_once within the
appropriate function (GetSharedRegisterInfoVector_i386).
PR: 289945
Obtained from: llvm-project 41859c27842eeda1ef6ff18f3b2fb269388c0857
(cherry picked from commit 1d1a2e6932d682c40ab878bf83cbbde02d8d0af1)
(cherry picked from commit ee286907ad455f967233f715bd468f1d0ff01f6c)
lldb: Fix Architecture parsing by reading the ELF header. (#162811)
Currently, LLDB in FreeBSD host sets the Process Architecture used by
lldbserver as Default one. Which cause problem when trying to debug a
32bit binary on amd64 platform since the lldb itself will found mismatch
architecture with lldbserver's return.
Notice that this patch is only a partial fix for the debugging problem.
We are still unable to debug x86 on x86_64 so that we don't provide
testcase in this patch.
PR: 289945
Obtained from: llvm-project 394e7ded8b6bcff1382468b407ca620a2837f41b
(cherry picked from commit fa1c56b3affaab7be6ece43070b36da2e75787cb)
(cherry picked from commit 87fdc35e586930d9782efee4c0217d5e19b9274a)
lldb: Fix empty register set when trying to get size of register
The register set information is stored as a singleton in
GetRegisterInfo_i386. However, other functions later access this
information assuming it is stored in GetSharedRegisterInfoVector. To
resolve this inconsistency, we remove the original construction logic
and instead initialize the singleton using llvm::call_once within the
appropriate function (GetSharedRegisterInfoVector_i386).
PR: 289945
Obtained from: llvm-project 41859c27842eeda1ef6ff18f3b2fb269388c0857
(cherry picked from commit 1d1a2e6932d682c40ab878bf83cbbde02d8d0af1)
lldb: Fix Architecture parsing by reading the ELF header. (#162811)
Currently, LLDB in FreeBSD host sets the Process Architecture used by
lldbserver as Default one. Which cause problem when trying to debug a
32bit binary on amd64 platform since the lldb itself will found mismatch
architecture with lldbserver's return.
Notice that this patch is only a partial fix for the debugging problem.
We are still unable to debug x86 on x86_64 so that we don't provide
testcase in this patch.
PR: 289945
Obtained from: llvm-project 394e7ded8b6bcff1382468b407ca620a2837f41b
(cherry picked from commit fa1c56b3affaab7be6ece43070b36da2e75787cb)
src.opts.mk: Enable LLDB for 32-bit arm
It was previously disabled when we built for older 32-bit arm targets
which lack 64-bit atomics. As we now support armv7 at a minimum there
is no need to disable LLDB.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52668
(cherry picked from commit 69415879e9e493cba78b3a4afb1a78d813a2eb8a)
trim.8: minor update for manual page
Further explain that trim(8) is not for trimming free blocks
in populated file systems/ZFS pools, as people still take it wrong sometimes.
MFc after: 1 week
if_ovpn: use epoch to free peers
Avoid a possible use-after-free in the rx path.
ovpn_decrypt_rx_cb() calls ovpn_finish_rx() which releases the lock,
but continues to use the peer.
Ensure that the peer cannot be freed until we're sure all potential
users have stopped using it (i.e. have left net_epoch).
Reported by: Kevin Day <kevin at your.org>
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
sys/_types.h: recognise char8_t as a builtin type in C++20
Unlike in C23 where it's a typedef, char8_t is a built in type in
C++20. Recognise it as such.
PR: 291449
Reported by: Tomoaki AOKI <junchoon at dec.sakura.ne.jp>
Approved by: markj (mentor)
Reviewed by: imp
Fixes: f0e541118c374869a8226eaa1320bb6eda248a20
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54124
pfctl: restore '-Tload -f pf.conf' functionality
Allow only tables to be loaded from a file, rather than everything (i.e.
including options, rules).
Add a test case for this.
PR: 291318
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit 7a283c40188ff7b0a4bae1a47bbd9ecc17ded132)
pfsync: fix incorrect unlock during destroy
During pfsync_clone_destroy() we clean up pending packets. This
may involve calling pfsync_undefer() or callout_drain(). We may not
hold the bucket lock during callout_drain(), but must hold it during
pfsync_undefer().
We incorrectly always released the lock, leading to assertion failures
during cleanup if there were pending deferred packets.
MFC after: 1 week
Sponsored by: Orange Business Services
(cherry picked from commit 639e65144aa71cb03b5431861803f528308760dc)