certctl: Unstickify (un)trusted certificates
Ever since certctl was rewritten in C, the rehash command has reingested
TRUSTDESTDIR / UNTRUSTDESTDIR in addition to TRUSTPATH / UNTRUSTPATH.
This seemed like a good idea at the time but was, in retrospect, a
mistake, as it means a (un)trusted certificate remains (un)trusted
forever (or at least until it expires) even if it is removed from
(UN)TRUSTPATH. Among other issues, it causes ports QA to fail for any
port that either installs certificates or depends on a port that does.
Although this behavior was undocumented, the change may surprise users
who have added certificates manually, so update the manual page to point
it out and add prominent warnings to the trust and untrust commands.
PR: 290078
MFC after: 1 week
Reviewed by: kevans, bcr
Differential Revision: https://reviews.freebsd.org/D56617
pf: do not reject rules with colliding hashes
We insert rules in pf_krule_global solely for the benefit of the
'keepcounters' feature. Failing to insert (beause the rule hash
collides, or an identical rule already exists) would be worse than
restoring counts to the wrong rule (or failing to restore them at all).
PR: 282863, 294860, 294859, 294858
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D56745
acpi_panasonic: acquire serial lock before calling hkey_sound_mute in shutdown
acpi_panasonic_shutdown() calls hkey_sound_mute() without holding
the ACPI serial lock. Every other call site holds
`ACPI_SERIAL_BEGIN(panasonic)` before calling it, as the locking
model is caller-owned.
This seems to affect the whole Panasonic Toughtbook lineup btw.
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D56718
md5: Don't generate test cases just to skip them
Don't waste time generating Perl test cases for algorithms that are not
supported in Perl mode only to skip them when they are run.
MFC after: 1 week
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D56687
stat: Set the timezone before testing -t flag
The test assumes UTC, which is what I use on my development systems and
clearly what is used on our CI runners.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D56836
mii: Fix SMSC name
The LAN8700 / LAN8710 PHYs were Standard Microsystems Corporation (SMSC)
parts. I presume SMC was chosen as an abbreviation, but the company
always used SMSC as its short name.
SMSC was acquired by Microchip in 2012. I kept the pre-acquisition
name, as NetBSD (from where we obtained miidevs) uses SMSC.
Reviewed by: adrian
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56819
mac_veriexec_priv_check block proc_write_*regs*
Writing to /proc/$pid/regs can also be leveraged to mess with memory.
Only allow a trusted process to do so.
Sponsored by: Hewlett Packard Enterprise Development LP.
Reviewed by: olce
Differential Revision: https://reviews.freebsd.org/D56763
Revert "libusb: change callback register handler to int"
This reverts commit ce9ced951a0b9d004a3b007d4ac6e9087a1301a2.
We should handle backward compatibility before introducing this patch as
people may rely on old ABI.
libusb: fix incorrect status type when completion on cancel the events
Reviewed by: lwhsu, markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51736
libusb: change callback register handler to int
libusb upstream uses int for register handler. This causes some library
user (like pyusb) to assume that we have int in all implementations and
therefore provides a 4 byte storage only. This causes Segmentation
fault as we will right the pointer.
Reviewed by: adrian
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54211
init: allow to specify a custom path for rc(8)
This is useful for testing alternative service managers
without modifying /etc/rc
MFC After: 1 weeks
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D56828
pfsync: reject invalid SCTP states
SCTP states should always have a src scrub object associated with them.
Crafted pfsync packets might not have this, leading to us derferencing a
NULL pointer on cleanup.
Validate the pfsync state insertion packet to make sure this is correct.
PR: 294989
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
pf: improve ASCONF chunk validation
When processing an ASCONF chunk we failed to verify that the chunk
length was at least 8 bytes. As a result we might end up passing a
negative length to pf_multihome_scan(). Fortunately this merely meant
the function did nothing, but we should discard such invalid packets, so
explicitly check for this.
MFC after: 1 week
Reported by: Mark Johnston
Sponsored by: Orange Business Services
(cherry picked from commit bea1c2fcd7839fd90a8ce96d6dc6a033779bc3c2)
pf: improve ASCONF chunk validation
When processing an ASCONF chunk we failed to verify that the chunk
length was at least 8 bytes. As a result we might end up passing a
negative length to pf_multihome_scan(). Fortunately this merely meant
the function did nothing, but we should discard such invalid packets, so
explicitly check for this.
MFC after: 1 week
Reported by: Mark Johnston
Sponsored by: Orange Business Services
(cherry picked from commit bea1c2fcd7839fd90a8ce96d6dc6a033779bc3c2)
nfs_pub: move from vfs_subr.c to vfs_export.c
nfs_pub is used only in vfs_export.c.
Reviewed by: kib, rmacklem
Differential Revision: https://reviews.freebsd.org/D56777
bsdinstall: Always use pkg.FreeBSD.org
The FreeBSD-base bits are accessible via pkg.FreeBSD.org, even for
releases, so there is no need to point at pkgbase.FreeBSD.org.
MFC after: 3 days
packages: Make create-sets.sh more robust during release
Commit d1c176fedfc9 made create-sets.sh exit when it encounters an
error, instead of creating an empty repository. However, this turns
out to cause some issues:
1. A package not having any sets is considered an error, but during
the release build, we stuff a 'pkg' package into the repository
which doesn't have any sets, which causes a failure. Avoid this
by simply ignoring the pkg package.
2. No error was printed in this case, which made the problem hard
to diagnose. Add an explicit error message.
3. A similar problem occurred running on a repository which already
contained sets, which is not usually done during the build, but
is not necessarly an inappropriate thing to do. Fix this one by
ignoring set packages when looking for sets.
[11 lines not shown]
nfs_nfsdserv.c: Clip number of callback slots
The client tells the server how many callback slots
it can handle in the callback session. However, the
NFSv4.1/4.2 server can only handle a maximum of
NFSV4_SLOTS slots. This patch clips the client's
value to that, to avoid using too high a slot#
for a callback.
Fortunately, I do not know of an extant client that
specifies a value greater than NFSV4_SLOTS, so this
patch is not really needed, as yet. Also, the client
rarely uses a slot# above 0 when doing callbacks.
MFC after: 2 weeks
Import smart revision 1.0.2
The smart command allows the user to monitor the various information
reported by Self-Monitoring, Analysis and Reporting Technology (SMART)
present on most ATA, SCSI, and NVMe storage media.
linuxkpi: Implement `module_*()` APIs as static functions
This fixes an "unused variable" warning when building DRM drivers.
Reviewed by: emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56780