Commit graph

286285 commits

Author SHA1 Message Date
Kristof Provost 10aa9ddb4d pf: support SCTP multihoming
SCTP may announce additional IP addresses it'll use in the INIT/INIT_ACK
chunks, or in ASCONF chunks at any time during the connection. Parse these
parameters, evaluate the ruleset for the new connection and if allowed
create the corresponding states.

MFC after:	3 weeks
Sponsored by:	Orange Business Services
Differential Revision:	https://reviews.freebsd.org/D41637
2023-09-07 19:05:00 +02:00
Ed Maste 5449d0144d src.conf.5: regen after SSP option description update 2023-09-07 11:59:46 -04:00
Ed Maste b461276d75 Update WITH_/WITHOUT_SSP descriptions
ProPolice refers to a specific implementation by Hiroaki Etoh and
Kunikazu Yoda.  The implementation in contemporary Clang and GCC is
somewhat different and newer, so use a generic term in the src.conf
descriptions.

Sponsored by:	The FreeBSD Foundation
2023-09-07 11:59:46 -04:00
Martin Matuska f10f65999f libarchive: merge security fix from vendor branch
This commit fixes a couple of security vulnerabilities in the PAX writer:
1. Heap overflow in url_encode() in archive_write_set_format_pax.c
2. NULL dereference in archive_write_pax_header_xattrs()
3. Another NULL dereference in archive_write_pax_header_xattrs()
4. NULL dereference in archive_write_pax_header_xattr()

Security:	No known reference yet
Obtained from:	https://github.com/libarchive/libarchive/commit/1b4e0d0f9
MFC after:	3 days
2023-09-07 17:22:34 +02:00
Ed Maste 2afef29b2c syscons: refer to it as the legacy console
vt(4) is the default console, and although there is no firm deprecation
plan for syscons(4) yet it it is not actively maintained and is not
compatible with contemporary systems (i.e., those booting via UEFI).

Reviewed by:	manu
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2023-09-07 11:16:00 -04:00
Wolfram Schneider cd89fe3923 switch groff parameter -man to -mandoc for new groff release 1.23.0
PR: 273565
2023-09-07 14:59:12 +00:00
Ed Maste ee12faa062 bspatch: use C23 overflow checking math now that it is available
Reviewed by:	des
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41771
2023-09-07 10:36:50 -04:00
Martin Matuska a5913a473b Update vendor/libarchive to libarchive/libarchive@1b4e0d0f9
Changes to not yet connected unzip command only.

Obtained from:		libarchive
Libarchive commit:	1b4e0d0f9d445ba3e4d0c7db7ce0b30300572fe8
2023-09-07 16:21:24 +02:00
Shailend Chand 5f62584a9a gve: Make LRO work for jumbo packets
Each Rx descriptor points to a packet buffer of size 2K, which means
that MTUs greater than 2K see multi-descriptor packets. The TCP-hood of
such packets was being incorrectly determined by looking for a flag on
the last descriptor instead of the first descriptor.

Also fixed and progressed the version number.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41754
2023-09-07 09:28:26 -04:00
Dag-Erling Smørgrav cb8dd292c7 less: We have <stdckdint.h> now.
Reviewed by:	delphij
Differential Revision:	https://reviews.freebsd.org/D41736
2023-09-07 06:40:14 +00:00
Dag-Erling Smørgrav 4fbb9c43aa include: Add tests for N2867.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D41735
2023-09-07 06:40:14 +00:00
Dag-Erling Smørgrav e6615b1034 include: Implement N2867.
This adds macros for checked addition, subtraction, and multiplication with semantics similar to the builtins gcc and clang have had for years.

Reviewed by:	kib, emaste
Differential Revision:	https://reviews.freebsd.org/D41734
2023-09-07 06:40:14 +00:00
Dag-Erling Smørgrav 12b1c1e3fb libc: Add test cases for N2680.
This adds test cases for %wN and %wfN to the printf(3) and scanf(3) tests.

While here, fix a few nits in the N2630 test cases.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D41743
2023-09-07 06:40:14 +00:00
Dag-Erling Smørgrav bce0bef3c6 libc: Implement N2680.
This adds specific width length modifiers in the form of wN and wfN (where N is 8, 16, 32, or 64) which allow printing intN_t and int_fastN_t without resorting to casts or PRI macros.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D41725
2023-09-07 06:40:14 +00:00
Dag-Erling Smørgrav 294bd2827e libc: Suppress format checks on printf() / scanf() tests.
Reviewed by:	jrtc27, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D41727
2023-09-07 06:40:14 +00:00
Dag-Erling Smørgrav 4ec9ee9912 libc: Add a wide version of snprintf_test.
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D41726
2023-09-07 06:40:14 +00:00
David E. O'Brien 2322159a2b Update HISTORY section. 2023-09-06 23:36:27 -07:00
Wolfram Schneider 035f7c9a36 switch groff parameter -man to -mandoc
groff 1.23.0 changed the semantics of the -man parameter, and many
manual pages are not rendered. The -mandoc parameter brings back
the old behavior, as in groff 1.22.4 and earlier.

PR: 273565, 273245

Reviewed by:	emaste, bapt
MFC after: 1 week for all supported branches (stable/12, 13, 14)
Differential Revision:	https://reviews.freebsd.org/D41737
2023-09-07 06:28:24 +00:00
Konstantin Belousov 03a7c36ddb __crt_aligned_alloc_offset(): fix ov_index for backing allocation address
Wrong value of ov_index resulted in magic check failure, and refuse to
free() the memory allocated with __crt_aligned_alloc_offset().
Then the TLS segments of exited threads leaked.

Reported and tested by:	glebius
Fixes:	c29ee08204
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-06 22:38:15 +03:00
Ed Maste b7528b16c6 release: remove inet blackhole sysctls from GCE config
Other cloud images do not do this, and it can produce confusing results.

Reviewed by:	Jose Luis Duran, delphij
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41751
2023-09-06 14:56:40 -04:00
Colin Percival 1926d5cef6 init_main: Record completed SYSINITs
When removing them from sysinit_list, append them to sysinit_done_list;
print this list from 'show sysinit' along with the list of future
sysinits.

Reviewed by:	jhb, gallatin (previous version)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41749
2023-09-06 11:36:36 -07:00
Colin Percival 71679cf468 init_main: Switch from SLIST to STAILQ, fix order
Constructing an SLIST of SYSINITs by inserting them one by one at the
head of the list resulted in them being sorted in anti-stable order:
When two SYSINITs tied for (subsystem, order), they were executed in
the reverse order to the order in which they appeared in the linker
set.

Note that while this changes struct sysinit, it doesn't affect ABI
since SLIST_ENTRY and STAILQ_ENTRY are compatible (in both cases a
single pointer to the next element).

Fixes:	9a7add6d01 "init_main: Switch from sysinit array to SLIST"
Reported by:	gallatin
Reviewed by:	jhb, gallatin, emaste
Tested by:	gallatin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41748
2023-09-06 11:36:36 -07:00
Andrew Turner 8f26d01f53 arm64: Fix the TCR_EPD0 definition
Sponsored by:	Arm Ltd
2023-09-06 18:32:49 +01:00
Andrew Turner 9e2cafe4fb arm64: Enable FEAT_E0PD when supported
FEAT_E0PD adds two fields to the tcr_el1 special register that, when
set, cause userspace access to either the top or bottom half of the
 address spaces without a page walk.

This can be used to stop userspace probing the kernel address space
as the CPU will raise an exception in the same time if the probed
address is in the TLB or not.

Reviewed by:	kevans
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D41760
2023-09-06 18:32:49 +01:00
Dag-Erling Smørgrav aacbe73842 unifdef: Handle redefined symbols correctly.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D41758
2023-09-06 17:11:13 +00:00
Baptiste Daroussin b37a6938e3 diff3: make the diff3 -E -m and diff3 -m behaviour match gnu diff3
In gnu diff3 3 way merging files where the new file and the target are
already the same will die and show what has failed to be merged except
if -E is passed in argument, in this case it will finish the merge.

This difference in behaviour was breaking one of the etcupdate testcase
with bsd diff3

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D41730
2023-09-06 17:06:39 +02:00
Austin Shafer 09b0401e91 linuxkpi: fix iteration in __sg_alloc_table_from_pages
Commit 3f686532c9 tried to fix an issue with not properly starting
at the first page in the sg list to prevent a panic. This worked but
with the side effect of incrementing "s" during the final iteration
causing it to be NULL since the list had ended.
In cases non-DEBUG kernels this causes a panic with drm-5.15, since
"s" is NULL when we later pass it to sg_mark_end().
This change decouples the iteration sg from the return value so that
it is never incremented past the final page in the chain.

MFC after:	3 days
Reviewed by:	manu
Differential Revision: https://reviews.freebsd.org/D41574
2023-09-06 14:37:12 +00:00
Piotr Kasierski 22cf89c938 qat: Intel 4xxx Series driver API extension
This commit introduces:
- Quick Assist API update for partial decompress and zero padding.
- Refactor of UIO locking.
- VF driver hotplug fix.
- Minor code style fixes for firmware API.

Patch co-authored by: Krzysztof Zdziarski <krzysztofx.zdziarski@intel.com>
Patch co-authored by: Michal Gulbicki <michalx.gulbicki@intel.com>
Patch co-authored by: Piotr Kasierski <piotrx.kasierski@intel.com>
Patch co-authored by: Karol Grzadziel <karolx.grzadziel@intel.com>

Sponsored by:	Intel Corporation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41613
2023-09-06 10:00:59 -04:00
Domagoj Stolfa 8527bb2aee dtrace: Fix a kernel panic in printm()
When using printm(), one should always pass a scratch pointer to it.
This is achieved by calling printm with memref

  BEGIN { printm(fixed_len, memref(ptr, var_len)); }

which will return a pointer to the DTrace scratch space of size
sizeof(uintptr_t) * 2. However, one can easily call printm() as follows

  BEGIN { printm(10, (void *)NULL); }

and panic the kernel as a result. This commit does two things:

  (1) adds a new macro DTRACE_INSCRATCHPTR(mstate, ptr, howmany) which
      checks if a certain pointer is in the DTrace scratch space;
  (2) uses DTRACE_INSCRATCHPTR() to implement a check on printm()'s DIFO
      return value in order to avoid the panic and sets CPU_DTRACE_BADADDR
      if the address is not in the scratch space.

Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D41722
2023-09-06 10:00:59 -04:00
Ed Maste 56e3123fc8 libcasper: reference system.fileargs service
Reviewed by:	oshogbo
MFC after:	3 days
Fixes:		cdd6ea94b0 ("libcasper: introduce cap_fileargs...")
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41761
2023-09-06 09:53:01 -04:00
Martin Matuska 969071be93 vfs: copy_file_range() between multiple mountpoints of the same fs type
VOP_COPY_FILE_RANGE(9) is now caled when source and target vnodes
reside on the same filesystem type (not just on the same mountpoint).
The check if vnodes are on the same mountpoint must be done in the
filesystem code. There are currently only three users - fusefs(5) already
has this check, ZFS can handle multiple mountpoints and a check has been
added to NFS client.

ZFS block cloning is now possible between all snapshots and datasets
of the same ZFS pool.

MFC after:	1 week
Reviewed by:	rmacklem
Differential Revision:	https://reviews.freebsd.org/D41721
2023-09-06 14:28:23 +02:00
Baptiste Daroussin bf986d5245 pci_vendors: update to 2023-08-12 2023-09-06 14:23:27 +02:00
Baptiste Daroussin 358f8a7add sendmail: remove all m4 files with WITHOUT_SENDMAIL 2023-09-06 14:23:27 +02:00
Zhenlei Huang 49d6743da1 net: Check per-flow priority code point for untagged traffic
Commit 868aabb470 introduced per-flow priority. There's a defect in the
logic for untagged traffic, it does not check M_VLANTAG set in the mbuf
packet header or MTAG_8021Q/MTAG_8021Q_PCP_OUT tag set by firewall, then
can result missing desired priority in the outbound packets.

For mbuf packet with M_VLANTAG in header, some interfaces happen to work
due to bug in the drivers mentioned in D39499. As modern interfaces have
VLAN hardware offloading, the defect is barely noticeable unless the
feature per-flow priority is widely tested.

As a side effect of this defect, the soft padding to work around buggy
bridges is bypassed. That may result in regression if soft padding is
requested.

PR:		273431
Discussed with:	kib
Fixes:	868aabb470 Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39536
2023-09-06 18:15:14 +08:00
黃清隆 cb1a0aab4f sys/dev/arcmsr: Update Areca RAID driver to version 1.50.00.06.
- Suppressed a harmless warning message, "arcmsr_dr_handle: target=f,
   lun=0, GONE!!!," which could appear a few seconds after UEFI system
   boot due to the boot volume UEFI initialization.
 - Corrected various typing errors.
 - Refactored arcmsr_initialize() to improve code readability.
 - Added support for device IDs 1883 and 1886 controllers.
 - Introduced support for controllers requiring host memory for the
   RAID 5 and 6 XOR engines.

Many thanks to Areca for continuing to support FreeBSD.

MFC after:	3 days
2023-09-06 01:11:55 -07:00
Dag-Erling Smørgrav 117c54a78c split: Fix linecount parsing.
The “undocumented kludge” which unfortunately can't be dropped for backward compatibility reasons was prone to segfaulting and would improperly allow a new linecount when one was already set.  Fix these issues and add regression tests.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D41757
2023-09-06 03:29:31 +00:00
Dag-Erling Smørgrav 851bf856d1 split: Code cleanup.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D41756
2023-09-06 03:29:31 +00:00
Dag-Erling Smørgrav cbea5eddb1 split: Add missing test cases.
This adds test cases for c4f7198f47 and ac17fc816e.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D41755
2023-09-06 03:29:28 +00:00
Dag-Erling Smørgrav 8091b82e29 time.h: Fix visibility check for C11 and C23 features.
__BSD_VISIBLE is always defined; we need to check if it's true.

Fixes:		d02489d11a 9b5d724cad
MFC after:	3 days
Reviewed by:	brooks, imp
Differential Revision:	https://reviews.freebsd.org/D41733
2023-09-06 03:38:01 +02:00
Jake Freeland 918966a274 timerfd: Relocate 32-bit compat code
32-bit compatibility code is conventionally stored in
sys/compat/freebsd32. Move freebsd32_timerfd_gettime() and
freebsd32_timerfd_settime() from sys/kern/sys_timerfd.c to
sys/compat/freebsd32/freebsd32_misc.c.

MFC After: 3 days
Reviewed by: imp, markj
Differential Revision; https://reviews.freebsd.org/D41640
2023-09-05 16:25:07 -06:00
Jake Freeland fb5daae920 timerfd: Namespace pollution adjustments
Do not pollute userspace with <sys/proc.h>, instead declare struct thread
    when _KERNEL is defined.

    Include <sys/time.h> instead of <sys/timespec.h>. This causes intentional
    namespace pollution that mimics Linux. g/musl libcs include <time.h> in
    their <sys/timerfd.h>, exposing clock gettime, settime functions and
    CLOCK_ macro constants. Ports like Chromium expect this namespace
    pollution and fail without it.

MFC After: 3 days
Reviewed by:	imp, markj
Differential Revision:	https://reviews.freebsd.org/D41641
2023-09-05 16:25:01 -06:00
Jake Freeland a1f506156c timerfd: Define a locking regime
Define a locking regime for the members of struct timerfd and document
    it so future code can follow the standard. The lock legend can be found
    in a comment above struct timerfd.

    Additionally,
    * Add assertions based on locking regime.
    * Fill kn_data with the expiration count when EVFILT_READ is triggered.
    * Report st_ctim for stat(2).
    * Check if file has f_type == DTYPE_TIMERFD before assigning timerfd
      pointer to f_data.

MFC After: 3 days
Reviewed by:	imp, kib, markj
Differential Revision:	https://reviews.freebsd.org/D41600
2023-09-05 16:24:41 -06:00
Navdeep Parhar 3814249f1e cxgbe(4): Avoid hang on kldunload on netlink enabled kernels.
netlink(4) calls back into the driver during detach and it attempts to
start an internal synchronized op recursively, causing an interruptible
hang.  Fix it by failing the ioctl if the VI has been marked as DOOMED
by cxgbe_detach.

Here's the stack for the hang for reference.
 #6  begin_synchronized_op
 #7  cxgbe_media_status
 #8  ifmedia_ioctl
 #9  cxgbe_ioctl
 #10 if_ioctl
 #11 get_operstate_ether
 #12 get_operstate
 #13 dump_iface
 #14 rtnl_handle_ifevent
 #15 rtnl_handle_ifnet_event
 #16 rt_ifmsg
 #17 if_unroute
 #18 if_down
 #19 if_detach_internal
 #20 if_detach
 #21 ether_ifdetach
 #22 cxgbe_vi_detach
 #23 cxgbe_detach
 #24 DEVICE_DETACH

MFC after:	3 days
Sponsored by:	Chelsio Communications
2023-09-05 15:10:02 -07:00
Warner Losh b19d8afe4d msun: LIBCSRCDIR is too fragile, use ${SRCTOP}/lib/libc instead
LIBCSRCDIR is defined in bsd.libnames.mk, which is read in later in the
Makefile than the line:

.if exists(${LIBCSRCDIR}/${MACHINE_ARCH})

so we test to see if /${MARCHIN_ARCH} exists which it usually doesn't
(but did for me since I mounted 13.2R SD image there).  Move to defining
our own LIBC_SRCTOP in terms of SRCTOP to treat these uniformily.

Sponsored by:		Netflix
Reviewed by:		sjg
Differential Revision:	https://reviews.freebsd.org/D41661
2023-09-05 16:08:02 -06:00
Bjoern A. Zeeb 815b7436a7 iwlwifi/LinuxKPI: 802.11: update ieee80211_request_smps()
Update ieee80211_request_smps() to the new number of arguments in
LinuxKPI (which was already prepared) and update the one call in the
older iwlwifi driver version.
This will allow iwlwifi as-is now and rtw88 to compile in case someone
else wants to work on the latter in parallel to predominant efforts on
the former.

Sponsored by:	The FreeBSD Foundation
MFC after:	20 days
2023-09-05 21:14:25 +00:00
Bjoern A. Zeeb 90aac0d83b rtw88: update driver from upstream
This is a combined version of updates of the rtw88 driver based
on wireless-testing
(wt-2023-05-11) 711dca0ca3d77414f8f346e564e9c8640147f40d (after v6.4-rc1),
(wt-2023-06-09) 7bd20e011626ccc3ad53e57873452b1716fcfaaa (after v6.4-rc5),
(wt-2023-07-24) 62e409149b62a285e89018e49b2e115757fb9022 (after v6.5-rc3),
(wt-2023-08-06) 2a220a15be657a24868368892e3e2caba2115283 (after v6.5-rc4).

This update follows other currently disconnected LinuxKPI based wireless
drivers to lift them all to a same version in case someone else wants to
work on this driver in parallel to predominant iwlwifi efforts.

MFC after:	20 days
2023-09-05 21:13:19 +00:00
Bjoern A. Zeeb 712468443d rtw88: temporary disconnect from build
As announced on freebsd-wireless [1] disconnect rtw88 from the build.
Add a note to the man page about the current state but leave the man
page in place for now as this is supposed to be temporary.

[1] https://lists.freebsd.org/archives/freebsd-wireless/2023-September/001377.html

MFC after:	20 days
X-MFC:		will see about 14/13
2023-09-05 21:13:19 +00:00
Bjoern A. Zeeb cf94672363 rtw88/rtw89: remove local firmware.
Remove firmware from src/ in favor of the ports/packages and fwget(8).
This will allow us to shrink the size of src (and installed modules).
Update the rtw88 man page to reflect the change.

MFC after:	20 days
X-MFC:		will see about 14/13
2023-09-05 21:13:18 +00:00
Bjoern A. Zeeb aece2a4fb1 rtw88: detach firmware from build
Firmware is kept in ports now and fwget will find the right one to
install.

MFC after:	20 days
X-MFC:		will see about 14/13
2023-09-05 21:13:18 +00:00
Jamie Gritton 165234d552 jail.conf(5): Fix and expand description of ".include".
Escape a period that caused a line not to be includesd.  Also mention
that glob(3) patterns may be included, and a consequence of that.

PR:		273561
Reported by:	crest@rlwinm.de
Reviewed by:	emaste
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41723
2023-09-05 13:35:54 -07:00