Commit Graph

293963 Commits

Author SHA1 Message Date
Tom Alexander aa68fad71e Add custom kernel config. 2024-09-16 15:39:42 +00:00
Tom Jones 855c3dacfc imx clk: Skip reconfiguring the clock if we don't have a new best_parent
imx_clk_composite_find_best_parent can fail, when it does for all the
clocks checked we attempt to configure an uninitialized best_parent
leading to a panic.

Initialize best_parent and skip reconfiguring the clock if we don't find
a new best_parent to use.

Reviewed By: manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46662
2024-09-16 15:45:26 +01:00
Kristof Provost 80eb861dc2 pfctl: lex <=, >=, and != into a single token
lex <=, >=, and != into a single token for correctness and to reduce the
lookahead in the parser
ok henning otto

Reviewed by:	zlei
Obtained from:	OpenBSD, deraadt <deraadt@openbsd.org>, e6e3ecf338
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46582
2024-09-16 13:48:58 +02:00
Kristof Provost 357c95ea46 pf tests: ensure we correctly optimize { any, 192.0.2.3 }
Reviewed by:	zlei
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46581
2024-09-16 13:48:54 +02:00
Kristof Provost 637d81c52d pfctl: fix incorrect optimization
In the non-optimized case, an address list containing "any" (ie. { any 10.0.0.1 })
should be folded in the parser to any, not to 10.0.0.1.  How long this bug has
been with us is unclear.
ok guenther mcbride

Obtained from:	OpenBSD, deraadt <deraadt@openbsd.org>, e3b4bc25a0
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46580
2024-09-16 13:48:49 +02:00
Kristof Provost e80f2a1087 pf.conf.5: document received-on
Reviewed by:	zlei
Obtained from:	OpenBSD, dlg <dlg@openbsd.org>, 456093dddc
Obtained from:	OpenBSD, jmc <jmc@openbsd.org>, 2bf0158fa8
Obtained from:	OpenBSD, deraadt <deraadt@openbsd.org>, be785dc6e2
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46579
2024-09-16 13:48:40 +02:00
Kristof Provost 661d0031bb pf tests: test the new received-on feature
Reviewed by:	zlei
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46578
2024-09-16 13:48:20 +02:00
Kristof Provost 2339ead638 pf: allow filtering on the receive interface
add support to pf for filtering a packet by the interface it was received
on. use the received-on IFNAME filter option on a pf.conf rule to restrict
which packet the interface had to be received on. eg:

  pass out on em0 from $foo to $bar received-on fxp0

ive been running this in production for a week now. i find it particularly
usefull with interface groups.

no objections, and a few "i like"s from henning, claudio, deraadt, mpf

Obtained from:	OpenBSD, dlg <dlg@openbsd.org>, 95b4320893
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46577
2024-09-16 13:47:07 +02:00
Kristof Provost 50ecaf1bd4 pf: use AF_INET6 when comparing IPv6 addresses
Reviewed by:	zlei
MFC after:	1 week
Obtained from:	OpenBSD, henning <henning@openbsd.org>, cf7c0bf78a
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46576
2024-09-16 13:46:14 +02:00
Kristof Provost 2ca286d0d2 pf: always drop ICMPv6 in IPv4 datagrams
Not only when compiled with INET6.

Suggested by Max Laier.
ok henning@

Reviewed by:	zlei
Obtained from:	OpenBSD, jsing <jsing@openbsd.org>, 0ba1e6e32b9
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46575
2024-09-16 13:46:09 +02:00
Michael Tuexen 1c6bb4c578 tcp: remove TCP_OFFLOAD_DISABLE
TCP_OFFLOAD_DISABLE is nowhere else used or defined. So remove it.
No functional change intended.

Reviewed by:		np
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46669
2024-09-15 11:44:49 +02:00
Peter Holm 4f4b483d31 stress2: Added a comment about a problem found and fixed 2024-09-16 10:17:50 +02:00
Konstantin Belousov 678bc2281c la57: do not set global bit for PML5 entry
The bit is reserved for PLM5, causing #PF on KVA access on real
hardware, unlike QEMU.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-09-16 11:13:51 +03:00
Konstantin Belousov 280e50461a amd64 la57_trampoline: save registers in memory
AMD64 ARM states that 64bit part of the architectural state is undefined
after 32<->64 mode switching.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-09-16 11:12:25 +03:00
Konstantin Belousov 687b896f8e amd64 la57_trampoline: lgdt descriptor is always 10 bytes in long mode
Extend its storage to be compliant.
This is currently nop due to padding and nul gdt descriptor right after
the lgdt descriptor.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-09-16 11:11:54 +03:00
Konstantin Belousov 1be58e67eb amd64 la57_trampoline: turn off global pages and PCID before turning off paging
SDM is explicit that having CR4.PCID=1 while toggling CR3.PG causes #GP.
To be safe and to avoid some more effects, also turn off CR4.PGE.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-09-16 11:10:16 +03:00
Konstantin Belousov b7ea2b69ef amd64 la57_trampoline: disable EFER.LME around setting CR4.LA57
Changing paging mode while LME is set seems to be not allowed.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	jThe FreeBSD Foundation
MFC after:	1 week
2024-09-16 11:09:38 +03:00
Konstantin Belousov 9a49c98baf amd64 la57_trampoline: stop using %rdx to remember original %cr0
Store %cr0 in %ebp.  %rdx is needed for MSR access.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-09-16 11:09:20 +03:00
Konstantin Belousov 180c8ab079 amd64 la57_trampoline: jump immediately after re-enabling paging
Literally follow requirements from SDM and execute jmp right after
%cr0 CR0_PG bit is toggled back.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-09-16 11:09:03 +03:00
Konstantin Belousov 787259bfe5 amd64 pmap: flush whole TLB after LA57 trampoline is installed
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-09-16 11:08:53 +03:00
Konstantin Belousov 2912c2fbd4 amd64 pmap: be more verbose around entering and leaving LA57 trampoline
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-09-16 11:08:53 +03:00
Doug Moore bae517022c swap_pager: enhance meta_transfer comments
Clarify comments about what happens to source blocks in
swp_pager_meta_transfer.  No functional changes.

Reviewed by:	alc
Differential Revision:	https://reviews.freebsd.org/D46682
2024-09-16 00:31:11 -05:00
Konstantin Belousov 4b273a7fb9 softdep_mount: report failure of the softdepflush thread creation
and do not hang waiting forever for an ack from non-existing thread.

PR:	281511
Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-09-15 17:59:10 +03:00
Konstantin Belousov 8276c6ea9c softdep_mount: on journal start failure, report the mount point path
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-09-15 17:59:02 +03:00
Konstantin Belousov e3b777534b procstat(1): make rlimit_param[] size assertion automatic
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46619
2024-09-15 09:30:13 +03:00
Konstantin Belousov 3a2a5d6060 getrlimit(2): document RLIMIT_UMTXP
Reviewed by:	olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46619
2024-09-15 09:30:00 +03:00
Doug Moore 4ccad54520 swap_pager: avoid meta_transfer race
Function swp_pager_meta_transfer expects that after dropping and
reacquiring an object lock, the swap block it's processing still
exists, and has not been removed from the trie and freed.  Rewrite to
avoid depending on that, by scrubbing, removing and freeing it before
releasing the lock.

Reviewed by:	alc, markj
Differential Revision:	https://reviews.freebsd.org/D46629
2024-09-15 01:00:00 -05:00
Joseph Mingrone f0bcebe67e
pflogd: Define structures removed in libpcap-1.10.5
In libpcap-1.10.5, two structures that we rely on, pcap_timeval and
pcap_sf_pkthdr, were made private.

c2d8cbb977

Temporarily define them here to fix the build.  kp and I will
investigate a permanent solution at EuroBSDCon in Dublin.

Reviewed by:	kp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46676
2024-09-14 17:28:27 -03:00
Enji Cooper 77864b545b sys/crypto/openssl: update powerpc* ASM
This change updates the crypto powerpc* ASM via the prescribed process
documented in `crypto/openssl/FREEBSD-upgrade`.

This change syncs the ASM with 3.0.15's generated ASM.

MFC after:	1 week
MFC with:	a7148ab39c
MFC with:	cc717b574d
Differential Revision:	https://reviews.freebsd.org/D46604
2024-09-14 12:38:17 -07:00
Colin Percival 0a5443da81 man4: Add a comment about Hardware Notes
The Hardware Notes for each release are generated automatically from a
template file and the HARDWARE sections of driver man pages.  When man
pages for new drivers are added here, they should usually be added to
the release notes template file.

Suggested by:	bz
Sponsored by:	Amazon
2024-09-14 12:23:31 -07:00
Robert Clausecker 61ed5748e4 lib/libc/tests/string: improve memccpy "bounds" unit test
The purpose of the "bounds" test is to check that the function does not
overread the array bounds.  The old unit test, copied from the strlcpy()
one, always ensured that we see the character c memccpy() is looking for
in the source array before the array ends.  While this is correct for
strlcpy(), memccpy()'s specification does not guarantee that c is
present within the given size limit.

The updated test handles this case better, ensuring that the source
array ends early if c is not supposed to be present.

Reported by:	getz
Approved by:	emaste
See also:	D46052
Event:		GSoC 2024
Differential Revision:	https://reviews.freebsd.org/D46051
2024-09-14 20:42:19 +02:00
Joseph Mingrone ecb75be376
libpcap: Add changes missed in update to 1.10.5
Fixes:		afdbf109c6 (libpcap: Update to 1.10.5)
Sponsored by:	The FreeBSD Foundation
2024-09-14 14:35:58 -03:00
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