FreeBSD/src bafb055usr.bin/lockf/tests lockf_test.sh

lockf: Test that lockf does not spin on fd

PR:             294832
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56723

(cherry picked from commit 0733afdb4dad58cfe7ad7f5994e26bf148d78199)
DeltaFile
+18-0usr.bin/lockf/tests/lockf_test.sh
+18-01 files

FreeBSD/src 2052d09usr.bin/lockf lockf.c

lockf: Avoid spinning when operating on an fd

When operating on a file descriptor, acquire_lock() would ignore the
flags argument and always operate in non-blocking mode, resulting in
unnecessary busy-looping.

PR:             294832
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56722

(cherry picked from commit d90513ea85693da0ca5955173609f4e81e38ae16)
DeltaFile
+5-1usr.bin/lockf/lockf.c
+5-11 files

FreeBSD/src 5158575usr.bin/lockf/tests lockf_test.sh

lockf: Test that lockf does not spin on fd

PR:             294832
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56723

(cherry picked from commit 0733afdb4dad58cfe7ad7f5994e26bf148d78199)
DeltaFile
+18-0usr.bin/lockf/tests/lockf_test.sh
+18-01 files

FreeBSD/src 4a6c4f0usr.bin/lockf lockf.c

lockf: Avoid spinning when operating on an fd

When operating on a file descriptor, acquire_lock() would ignore the
flags argument and always operate in non-blocking mode, resulting in
unnecessary busy-looping.

PR:             294832
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56722

(cherry picked from commit d90513ea85693da0ca5955173609f4e81e38ae16)
DeltaFile
+5-1usr.bin/lockf/lockf.c
+5-11 files

FreeBSD/src 8e5f92busr.bin/lockf/tests lockf_test.sh

lockf: Test that lockf does not spin on fd

PR:             294832
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56723

(cherry picked from commit 0733afdb4dad58cfe7ad7f5994e26bf148d78199)
DeltaFile
+18-0usr.bin/lockf/tests/lockf_test.sh
+18-01 files

FreeBSD/src 651b82eusr.bin/lockf lockf.c

lockf: Avoid spinning when operating on an fd

When operating on a file descriptor, acquire_lock() would ignore the
flags argument and always operate in non-blocking mode, resulting in
unnecessary busy-looping.

PR:             294832
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56722

(cherry picked from commit d90513ea85693da0ca5955173609f4e81e38ae16)
DeltaFile
+5-1usr.bin/lockf/lockf.c
+5-11 files

FreeBSD/src 081d3absys/dev/ichsmb ichsmb_pci.c

ichsmb: add Ice Lake-LP (0x34a3) and Ice Lake-N (0x38a3) SMBus device IDs

Add PCI device IDs for two Ice Lake PCH SMBus controller variants:
- 0x34a3 (Ice Lake-LP), previously listed as the generic "Ice Lake" entry (ID_ICELAKE), renamed to ID_ICELAKELP for clarity.
- 0x38a3 (Ice Lake-N), a separate PCH variant not previously supported.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D56732
DeltaFile
+6-3sys/dev/ichsmb/ichsmb_pci.c
+6-31 files

FreeBSD/src 0979bfbsys/dev/usb/net if_smsc.c

smsc: Add missing newline to PHY timeout error printf
DeltaFile
+1-1sys/dev/usb/net/if_smsc.c
+1-11 files

FreeBSD/src 2fef18fusr.sbin/certctl certctl.c certctl.8, usr.sbin/certctl/tests certctl_test.sh

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
DeltaFile
+52-29usr.sbin/certctl/certctl.c
+13-2usr.sbin/certctl/certctl.8
+2-1usr.sbin/certctl/tests/certctl_test.sh
+67-323 files

FreeBSD/src c24b1d9lib/libpfctl libpfctl.c, sbin/pfctl pfctl.c

pfctl: handle errors from PFNL_CMD_GETSTATES

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+3-2sbin/pfctl/pfctl.c
+1-1lib/libpfctl/libpfctl.c
+4-32 files

FreeBSD/src a0e4c65sys/netpfil/pf pf_ioctl.c, tests/sys/netpfil/pf match.sh

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
DeltaFile
+36-0tests/sys/netpfil/pf/match.sh
+8-16sys/netpfil/pf/pf_ioctl.c
+44-162 files

FreeBSD/src 8334d46sys/kern sys_process.c

Fix typo in curthread
DeltaFile
+1-1sys/kern/sys_process.c
+1-11 files

FreeBSD/src 7619d14sys/dev/acpi_support acpi_panasonic.c

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
DeltaFile
+2-0sys/dev/acpi_support/acpi_panasonic.c
+2-01 files

FreeBSD/src fd386e7sbin/md5/tests md5_test.sh

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
DeltaFile
+6-6sbin/md5/tests/md5_test.sh
+6-61 files

FreeBSD/src 49e496dusr.bin/stat/tests stat_test.sh

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
DeltaFile
+2-2usr.bin/stat/tests/stat_test.sh
+2-21 files

FreeBSD/src 89c883csys/dev/mii miidevs smscphy.c

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
DeltaFile
+4-4sys/dev/mii/miidevs
+2-2sys/dev/mii/smscphy.c
+6-62 files

FreeBSD/src adad686sys/kern sys_process.c

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
DeltaFile
+16-3sys/kern/sys_process.c
+16-31 files

FreeBSD/src bf2c6d2lib/libusb libusb10_hotplug.c libusb.h

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.
DeltaFile
+18-32lib/libusb/libusb10_hotplug.c
+3-2lib/libusb/libusb.h
+0-2lib/libusb/libusb10.h
+0-1lib/libusb/libusb10.c
+21-374 files

FreeBSD/src 0627136lib/libusb libusb10.c

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
DeltaFile
+2-2lib/libusb/libusb10.c
+2-21 files

FreeBSD/src ce9ced9lib/libusb libusb10_hotplug.c libusb.h

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
DeltaFile
+32-18lib/libusb/libusb10_hotplug.c
+2-3lib/libusb/libusb.h
+2-0lib/libusb/libusb10.h
+1-0lib/libusb/libusb10.c
+37-214 files

FreeBSD/src efc0cedsys/modules/ath10k Makefile, sys/modules/ath11k Makefile

ath{10,11,12}k: Add missing header in Makefile

Reviewed by:    bz
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56693
DeltaFile
+2-0sys/modules/ath11k/Makefile
+2-0sys/modules/ath10k/Makefile
+2-0sys/modules/ath12k/Makefile
+6-03 files

FreeBSD/src 2610029lib/libusb libusb.h

libusb: Add libusb_endpoint_transfer_type enum

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
DeltaFile
+7-0lib/libusb/libusb.h
+7-01 files

FreeBSD/src 5f901e1lib/libifconfig libifconfig_bridge.c

libifconfig: Skip bridge VLAN config for span members

bridge(4) doesn't support BRDGGIFVLANSET for span members, which
means if a span interface is configured, libifconfig will fail to
fetch bridge members.  Skip this for IFBIF_SPAN members.

PR:     292634
MFC after:      3 days
Reported by:    Emrion <kmachine at free.fr>
Reviewed by:    pouria, zlei
Approved by:    re (cperciva)
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56694

(cherry picked from commit 454322c08b8aa181939c8d920472f03cfd591032)
(cherry picked from commit 0a919e2a9265b5cdaeb2c5d51c29791b4eb7335c)
DeltaFile
+5-0lib/libifconfig/libifconfig_bridge.c
+5-01 files

FreeBSD/src 9f2ad7csbin/init init.c init.8

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
DeltaFile
+15-3sbin/init/init.c
+9-1sbin/init/init.8
+24-42 files

FreeBSD/src c8167ebsys/dev/virtio/network if_vtnet.c if_vtnetvar.h

Revert "virtio_net: Use bus_dma for command/ack buffers"

This reverts commit b5bad6df467cc95bea641afe674c55cd5b9f1510.

Revert until we can fix reported issues
DeltaFile
+58-278sys/dev/virtio/network/if_vtnet.c
+0-6sys/dev/virtio/network/if_vtnetvar.h
+58-2842 files

FreeBSD/src dc00f11sys/dev/virtio/network if_vtnet.c if_vtnetvar.h

Revert "virtio_net: Use bus_dma for rxq/txq buffers"

This reverts commit c16c95192f01237a876eb7bc336e3bbda9310171.

Revert until we can fix reported issues
DeltaFile
+17-258sys/dev/virtio/network/if_vtnet.c
+0-10sys/dev/virtio/network/if_vtnetvar.h
+17-2682 files

FreeBSD/src bf6d00asys/netpfil/pf if_pfsync.c

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")
DeltaFile
+7-0sys/netpfil/pf/if_pfsync.c
+7-01 files

FreeBSD/src 9fe189csys/netpfil/pf pf.c

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)
DeltaFile
+7-0sys/netpfil/pf/pf.c
+7-01 files

FreeBSD/src 730fb48sys/netpfil/pf pf.c

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)
DeltaFile
+7-0sys/netpfil/pf/pf.c
+7-01 files

FreeBSD/src 6f84579sys/kern vfs_export.c vfs_subr.c, sys/sys mount.h

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
DeltaFile
+3-0sys/kern/vfs_export.c
+0-3sys/kern/vfs_subr.c
+0-1sys/sys/mount.h
+3-43 files