Commit graph

294349 commits

Author SHA1 Message Date
Joseph Mingrone 407a9cced6
ObsoleteFiles.inc: Update after libpcap upgrade from 1.10.4 to 1.10.5
Sponsored by:	The FreeBSD Foundation
2024-09-14 14:19:26 -03:00
Joseph Mingrone afdbf109c6 libpcap: Update to 1.10.5
Changes:	https://git.tcpdump.org/libpcap/blob/bbcbc9174df3298a854daee2b3e666a4b6e5383a:/CHANGES
Reviewed by:	emaste
Obtained from:	https://www.tcpdump.org/release/libpcap-1.10.5.tar.gz
Sponsored by:	The FreeBSD Foundation
2024-09-14 14:09:34 -03:00
Ahmad Khalifa 92adaa5862 gpiobus(4): Add an acpi variant of gpiobus
This currently only implements the address space handler and attempts to
configure pins with flags obtained from ACPI.

Reviewed by:	wulf
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1359
2024-09-14 12:02:33 +03:00
Igor Ostapenko 641fbfc828 pf tests: Do not handle ipfw presence
Initially, it was added to cover a conflicting case of ipfw and pf used
together. But there are more drawbacks than benefits:
- A half of these tests are always skipped. That leads to
  misunderstanding, while the test suite strives to avoid ambiguous
  situations.
- Handling enabled ipfw on the test level is tedious, error-prone, and
  less maintainable.
- CI and similar parties already know how to deal with ipfw for the test
  suite, like making it open by default. Extra complexity is not needed.

In addition, ipfw+pf use cases are not officially supported.

Reviewed by:	kp, markj
Approved by:	kp (mentor), markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D46655
2024-09-14 08:08:06 +00:00
Baptiste Daroussin 696922fbfa flua: add freebsd.kenv, kenv(2) bindings
Add bindings for kenv(2) right now only get() has been created
it allows do dump into a key/value table the kernel environement if
no argument is passed, or it returns the value associated to the
provided key.

Reviewed by:	imp, kevans, markj
Accepted by:	imp, kevans
Differential Revision:	https://reviews.freebsd.org/D46654
2024-09-14 07:43:50 +02:00
Chattrapat Sangmanee 50a03971d3 ps3: add elfv2 support
ps3 are broken since we moved to clang/elfv2.  Fix this by updating the
hypercall glue to the new ABI.

Signed-off-by: Chattrapat Sangmanee <aomsin27@hotmail.co.th>
Reviewed by:	jhibbits
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1413
2024-09-13 23:13:05 -04:00
Mark Johnston afd096326a kassert: Further remove KASAN integration from DEBUG_POISON_POINTER
Fixes:	47112d359b ("kassert: Remove KASAN marking from DEBUG_POISON_POINTER")
2024-09-14 01:36:44 +00:00
Mark Johnston 47112d359b kassert: Remove KASAN marking from DEBUG_POISON_POINTER
While this approach works for trapping reads of an uninitialized
pointer, it means that any attempt to store to the variable triggers a
KASAN report, which is not what we want.  Simply remove the kasan_mark()
call.  KMSAN will catch these kinds of bugs automatically anyway.

Reported by:	syzbot+c5e279db5763b58e8d69@syzkaller.appspotmail.com
MFC after:	1 week
2024-09-14 01:34:12 +00:00
Adrian Chadd 50982d26e4 net80211: add MMIC element ID (for management frame protected group action frames)
* add the MMIC element ID
* add a comment showing the source of this table from the 802.11-2016
  specification.

Differential Revision: https://reviews.freebsd.org/D46505
2024-09-13 14:13:58 -07:00
Adrian Chadd 3e52b265ef net80211: fix fast BSS transition element ID name
This is a straight up typo!

Differential Revision: https://reviews.freebsd.org/D46504
2024-09-13 14:13:51 -07:00
R. Christian McDonald 4269d1a2e4 rc.subr: fix typo "save_dot" -> "safe_dot"
Reviewed by:	sjg
Approved by:	kp
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46644
2024-09-13 16:51:40 -04:00
Doug Moore fd1d666289 pctrie: create iterator
Define a pctrie iterator type. A pctrie iterator is a wrapper around a
pctrie that remembers a position in the trie where the last search
left off, and where a new search can resume. When the next search is
for an item very near in the trie to where the last search left off,
iter-based search is faster because instead of starting from the root,
the search usually only has to back up one or two steps up the
root-to-last-search path to find the branch that leads to the new
search target.

Every kind of lookup (plain, lookup_ge, lookup_le) that can begin with
the trie root can begin with an iterator instead. An iterator can also
do a relative search ("look for the item 4 greater than the last item
I found") because it remembers where that last search ended. It can
also search within limits ("look for the item bigger than this one,
but it has to be less than 100"), which can save time when the next
item beyond the limits and that is known before we actually know what
that item it is. An iterator can also be used to remove an item that
has already been found, without having to search for it again.

Iterators are vulnerable to unsynchronized data changes. If the
iterator is created with a lock held, and that lock is released and
acquired again, there's no guarantee that the iterator path remains
valid.

Reviewed by:	markj
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D45627
2024-09-13 10:36:54 -05:00
Tom Jones 40d0f179a8 imx8mp: Add clock tree
Add clock tree for imx8mp SOC. This provides clocks sufficient for
several sub systems to work including USB and SD/MMC.

Reviewed by:	manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46642
2024-09-13 09:18:55 +01:00
Tom Jones be9fefafc2 imx_ccm: Rearrange clock control module driver
Rearrange the IMX clock control module driver so it is more straight
forward to support clock trees from other SOCs in the family.

Move the existing imx8mq_ccm driver to a more generic imx_ccm (based on
rk_cru) and update the previous driver to sub class imx_ccm.

Reviewed by:	manu
Sponsored by:	The FreeBSD Foundations
Differential Revision: https://reviews.freebsd.org/D46641
2024-09-13 09:15:19 +01:00
Baptiste Daroussin fa4b5aa51f freebsd.sys.linker: remove license to only keep SPDX line 2024-09-13 07:07:23 +02:00
Doug Moore 4876924c0c vm_page: fuse two allocation loops
Combine two loops, each iterating over the same array of pages to
initialize them, into a single loop.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D46609
2024-09-12 23:41:01 -05:00
Bjoern A. Zeeb c1c989588d LinuxKPI: 802.11: add futher defines to ieee80211.h and nl80211.h
Upstream new defines, enum values, etc. for coming driver updates which
are non-conflicting with the current state.

The only notable change is the rename of the enum ieee80211_ap_reg_power
but the enum name had not been used so far by any driver in the tree
(only in mac80211.h) but an updated version of ath11k does use it so we
need to correct our initial naming.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-09-13 00:26:26 +00:00
Bjoern A. Zeeb 4b972f77a1 LinuxKPI: some additions for mt76
Add changes required for later mt76 drivers.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-09-13 00:25:31 +00:00
Bjoern A. Zeeb 6ed447b51a LinuxKPI; add more defintions to netdevice.h
Add new enums to netdevice.h (including one which is referenced but
no value of it is used in a driver so we have to add a "dummy" value
to avoid an empty enum).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-09-13 00:24:48 +00:00
Bjoern A. Zeeb c12e3a0525 LinuxKPI: add more fields to mhi.h
Add more fields required by updated wireless drivers to mhi.h.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-09-13 00:23:35 +00:00
Bjoern A. Zeeb 01e1131e4a LinuxKPI: add pci_err()
Add pci_err() as a wrapper to dev_err() as needed by an updated driver.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D46660
2024-09-13 00:20:53 +00:00
Bjoern A. Zeeb 7728586800 mt76: add mt7615 to the pile of buildable drivers
Ignoring page_pools with the few needed adjustments and ignoring 7622
mt7615 seems to build as well.  Add it so once we can connect it to
the build people can start testing and debugging.
(The actual work was done on a newer version of the mt76 drivers but
it seems the to-build-changes equally apply here already).

Requested by:	Radu-Cristian Fotescu (freebsd-wireless, 2024-07-31)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-09-13 00:18:02 +00:00
Eugene Grosbein becd0079c0 ng_ipfw(4): add missing change after previous commit
The function ng_ipfw_input() used to enjoy implicit
32->16 bits truncation of its second argument.
Make it explicit to recover from the breakage.

PR:		281082
Reported by:	Ruben van Staveren <ruben@verweg.com>
Tested by:	Ruben van Staveren <ruben@verweg.com>
MFC after:	3 days
Fixes:		20e1f207cc
2024-09-13 02:09:28 +07:00
Kristof Provost 17c9ac457c if_ovpn: declare our dependency on the crypto module
PR:		281460
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-09-12 19:32:05 +02:00
Doug Ambrisko 408087f128 zfskeys: allow prompt to entered during boot up
If the ZFS key is setup in prompt mode, use zfs to prompt to load the key
during boot to unlock it.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D36081
2024-09-12 08:46:49 -07:00
Kristof Provost 3c95262007 if_ovpn: only install tunnel callback once
Rather than attempt to install the tunnel callback every time we add a peer only
do so the first time.

Reviewed by:	zlei
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46651
2024-09-12 15:11:36 +02:00
Baptiste Daroussin cbf53f5e37 flua: install linker in the right patch
When moving the freebsd.sys.linker sources the installation path
was lost.

Fixes 7899f917b1
2024-09-12 14:43:56 +02:00
Brooks Davis 5b92737502 kcmp(2): fix whitespace in symbol list
Fixes:		211bdd601e Add kcmp(2) userspace bits
2024-09-12 12:35:04 +01:00
Brooks Davis 7ca260df8c proccontrol: use a table for modes
Add a central table of modes and loop over it rather than spelling out
10 essentialy identical strcmp if statemnts.  Use the stable to generate
usage as well reducing the number of ifdefs.

Disallow multiple -m options.  Previouly multiple were allowed, but only
the last one was used and there was no indication this happened.

Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D46426
2024-09-12 12:35:04 +01:00
Kristof Provost 3acf7e0da4 if_ovpn: avoid LOR between ovpn and UDP locks
When we install the tunneling function we had the ovpn lock, and then took the
UDP lock. During normal data flow we are called with the UDP lock held and then
take the ovpn lock.
This naturally produces a lock order reversal warning.

Avoid this by releasing the ovpn lock before installing the tunnel function.
This is safe, in that installing the tunnel function does not fail (other than
with EBUSY, which would mean another thread has already installed the function).

On cleanup the problem is more difficult, in that we cannot reasonably release
the ovpn lock before we can remove the tunneling function callback.

Solve this by delaying the removal of the tunnel callback until the ovpn_softc
is cleaned up. It's still safe for ovpn_udp_input() to be caled when all peers
are removed. That will only increment counters (which are still allocated),
discover there are no peers and then pass the message on to userspace, if
any userspace users of the socket remain.

We ensure that the socket object remains valid by holding a reference, which
we release when we remove the ovpn_softc. This removes the need for per-peer
reference counting on the socket, so remove that.

Reviewed by:	zlei
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision::	https://reviews.freebsd.org/D46616
2024-09-12 09:44:19 +02:00
Baptiste Daroussin 7899f917b1 flua: move modules source into the main source directory
Follow the path of what is done with bsnmp, build the modules along
with the main binary, this allows to build the modules at a moment
where all needed libraries are already built and available in the
linker path instead of having to declare all the libraries which a
flua module will be linked to in _prebuild_libs.

Discused with:	markj
Reviewed by:	markj, jrtc27, kevans, imp
Accepted by:	kevans, imp
Differential Revision:	https://reviews.freebsd.org/D46610
2024-09-12 09:03:44 +02:00
Navdeep Parhar d82cb5c608 cxgbe(4): Make sure that the tracing filters are usable after restart.
The destination queue for tracing filters is destroyed during stop or
suspend and the software state needs to reflect this.  A new destination
queue will be setup when the adapter resumes operation.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-09-11 12:12:32 -07:00
Navdeep Parhar 171e57967b cxgbe/t4_tom: Demote STALE L2 table entries to RESOLVING in uld_stop.
The STALE state means the L2T entry is valid in hardware but needs to be
refreshed (ARP/NDP) in software.  But stop/suspend wipes the hardware
L2T and STALE entries need to be updated just like VALID entries to match
actual hardware state.

Fixes:	c1c524852f cxgbe/t4_tom: Implement uld_stop and uld_restart for ULD_TOM.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-09-11 12:09:48 -07:00
Jessica Clarke 796c6031cd Merge commit 88433e640ddb from upstream OpenZFS (by Jessica Clarke)
sys/types32.h: Remove struct timeval32 from libspl's header (#16491)

  macOS Sequoia's sys/sockio.h, as included by various bootstrap tools
  whilst building FreeBSD, has started to include net/if.h, which then
  includes sys/_types/_timeval32.h and provide a conflicting definition
  for struct timeval32. Since this type is entirely unused within OpenZFS,
  simply delete the type rather than adding in some kind of OS detection.

  This fixes building FreeBSD on macOS Sequoia (Beta).

  Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
  Reviewed-by: Rob Norris <rob.norris@klarasystems.com>
  Reviewed-by: Alexander Motin <mav@FreeBSD.org>
  Reviewed-by: Tony Hutter <hutter2@llnl.gov>

MFC after:	1 week
2024-09-11 18:01:06 +01:00
Kristof Provost 299175f2e5 Revert "Assert that mbufs are writable if we write to them"
This reverts commit f08247fd88.

This assertion is triggered by
ktls_test:ktls_transmit_aes128_cbc_1_0_sha1_control. Remove the assertion until
we fully understand why.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-09-11 17:04:35 +02:00
Mariusz Zaborski 7f4731ab67 libnv: correct the calculation of the structure's size
Reported by:	Milosz Kaniewski <milosz.kaniewski@gmail.com>
2024-09-11 16:43:43 +02:00
Kristof Provost db11a04828 pf: fix debug printf
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46574
2024-09-11 13:17:49 +02:00
Kristof Provost b27d3f71c2 pf tests: improved test for CVE-2019-5598
Ensure that we verify that the inner and outer IP address matches for ICMP error
messages. This is a more detailed test for CVE-2019-5598, which was fixed back
in 2019.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46573
2024-09-11 13:17:49 +02:00
Kristof Provost 423b1069af pf: ensure mbufs are writable
Ensure that we can modify mbufs before we start processing them. There are a
number of paths where pf will m_copyback() or otherwise modify a packet. Ensure
that this is safe to do.

For example, ip6_forward() will m_copym() the packet before handing it to the
output pfil hook. This results in a non-writable mbuf, which would trigger
assertion failures (see previous commit).

Reviewed by:	glebius (previous version)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46628
2024-09-11 13:17:48 +02:00
Kristof Provost f08247fd88 Assert that mbufs are writable if we write to them
m_copyback() modifies the mbuf, so it must be a writable mbuf.

Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46627
2024-09-11 13:17:48 +02:00
Andrew Turner 4ec5fbdded sys/conf: Remove LD_EMULATION_armv6
Armv6 support has been removed, we can remove LD_EMULATION for it.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45959
2024-09-11 10:41:04 +00:00
Andrew Turner 66a6e1d613 arm: Remove support for Armv6 CPU cores
The ARM1176 is an Armv6 CPU. As Armv6 support has been removed we can
also remove ARM1176 support.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45958
2024-09-11 10:40:35 +00:00
Andrew Turner d29771a722 arm: Assume __ARM_ARCH == 7
The only supported 32-bit Arm architecture is Armv7. Remove old checks
for earlier architecture revisions.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45957
2024-09-11 10:40:13 +00:00
Andrew Turner bf18be5ab7 bcm2835: Remove support for SoCs with an Armv6 CPU
Armv6 has been removed, there is no need to keep this in the tree.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45956
2024-09-11 10:39:42 +00:00
Andrew Turner d546313602 arm64: Add CPTR_TRAP_ALL and use it in vmm
Add a new macro that enables all CPTR_EL2 traps. This helps ensure we
trap all extensions we don't support.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46516
2024-09-11 10:25:09 +00:00
Andrew Turner 9f3d15fda2 arm64: Add CPTR_E2H_TTA
The TTA field moves depending on the HCR_EL2.E2H field. Add a macro to
hold the E2H == 1 case.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46515
2024-09-11 10:25:09 +00:00
Andrew Turner 16e661921a arm64: Add E2H to CPTR_EL2 register values
Rename register fields that are only valid when HCR_EL2.E2H == 1. Some
fields move around depending on the value of the E2H field.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46514
2024-09-11 10:25:09 +00:00
Andrew Turner 7a488d83b3 arm64: Adjust the indentation of CPTR_EL2 values
Reviewed by:	emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46513
2024-09-11 10:25:08 +00:00
Andrew Turner d99e6b22c0 arm64: Make L1_BLOCKS_SUPPORTED dynamic
When FEAT_LPA2 is implemented and the TCR_EL1.DS field is set we can
create blocks at level 1 with a 16kB page size. Add a variable to
tell the kernel this is enabled.

This will be used by other parts of pmap.c with a 4k page kernel so
make it visible there.

Reviewed by:	alc, kib, markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46395
2024-09-11 10:25:08 +00:00
Andrew Turner 769eeb0932 arm64: Trap floating-point registers with VHE
When VHE is enabled we disabled trapping floating-point instructions to
EL2 in locore.S. As the kernel is running in EL2 then vfp.c will manage
enabling floating-point instructions as needed.

Sponsored by:	Arm Ltd
2024-09-11 10:25:08 +00:00