Commit graph

286304 commits

Author SHA1 Message Date
Michael Tuexen f9425b3a85 sctp: cleanup locking for notifications
All notifications are now queued via sctp_ulp_notify(). Do
the locking of the inp read lock there and validate this in all
functions being used.
This is one step in avoiding race conditions when closing the
read end of an SCTP socket.

MFC after:	3 days
2023-09-08 16:20:51 +02:00
Mike Karels 48514c5724 mountd: do not warn about using class mask with -mask
The previous code would warn that the mask was being defaulted to
an obsolete class mask even if -mask was present after -network.
Import a fix from Peter Much with a little tweaking, deferring the
warning until after all parameters are processed.

PR:		263011
Obtained from:	pmc at citilink.dinoex.sub.org
MFC after:	3 days
Reviewed by:	rmacklem
Differential Revision:	https://reviews.freebsd.org/D41774
2023-09-08 09:06:42 -05:00
Andrew Turner a35e47369f arm64: Add TCR register masks
These will be used by bhyve to implement page table walking.

Sponsored by:	Arm Ltd
2023-09-08 14:31:26 +01:00
Andrew Turner aea5405389 arm64: Fix the TCR_TBI0 macro to use UL
This needs to be 1UL to ensure the type is large enough for the shift.

Sponsored by:	Arm Ltd
2023-09-08 14:31:25 +01:00
Joel Bodenmann b4b89476fa Add myself as ports committer, update mentor/mentee
This completes step 5 from Committer's Guide.

Approved by:		zirias (mentor)
Differential Review:	https://reviews.freebsd.org/D41782
2023-09-08 15:20:01 +02:00
Michael Tuexen 3ac7664774 sctp: make sure all SCTP RESET notifications use sctp_ulp_notify()
While there, improve consistency of the notification related code.
No functional change intended.

MFC after:	3 days
2023-09-08 14:19:56 +02:00
Michael Tuexen cd3770c5fe sctp: cleanup SCTP AUTH related notification
This makes consistent use of the parameters and ensures that
all SCTP AUTH related notifications are using sctp_ulp_notify().

No functional change intended.

MFC after:	3 days
2023-09-08 13:13:43 +02:00
Dag-Erling Smørgrav 9a071e4e57 Assert that ifnet_detach_sxlock is held where needed.
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D41770
2023-09-08 10:06:11 +00:00
Emmanuel Vadot 17c17872ca cpufreq_dt: Find the closest frequency
When building the frequencies table we convert the value in the DTS to
megahertz and loose precision. While it's not a problem for most of the
DTS it is when the expected frequency value is strict down to the hertz.
So it's either we don't truncate the value and have some ugly and long
values in the sysctls or we just find the closest frequency.
Do the latter.

Reviewed by:	mmel
Differential Revision:	https://reviews.freebsd.org/D41762
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-09-08 09:44:32 +02:00
Emmanuel Vadot 229c65a83f kern: Globally define abs64
So we can use it in non-linuxkpi sources.

Reviewed by:	emaste, mmel
Differential Revision:	https://reviews.freebsd.org/D41767
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-09-08 09:44:06 +02:00
Kyle Evans 602d360186 arm64: start defining a std.apple configuration
The M1 uses FDT, and has bge to start with.  Add a SOC_* option for
the first SoC we'll be supporting.

IOMMU is added commented out because it does have it, but IOMMU is not
well-tested on aarch64.  An initial version of the DART driver will be
upstreamed that just puts the DARTs that support bypass mode into bypass
mode -- we'll be missing some functionality, but we at least still end
up with some USB ports.

Reviewed by:	karels, manu
Input from:	jrtc27 (IOMMU)
Differential Revision:	https://reviews.freebsd.org/D39823
2023-09-08 00:53:51 -05:00
Volker Mauel 12ce45f260
Intel QAT 1.7 compatibility
Based on the intel QAT samples which are bundled in the 1.x drivers, 
this is the preferred approach since api version 1.6.  See:

https://www.intel.de/content/www/de/de/download/19734/intel-quickassist-technology-driver-for-linux-hw-version-1-x.html?

Reviewed-by: Weigang Li <weigang.li@intel.com>
Signed-off-by: Volker Mauel <volkermauel@gmail.com>
Closes #15190
2023-09-07 14:38:17 -07:00
Andrea Righi 3602775330
Linux 6.5 compat: spl: properly unregister sysctl entries
When register_sysctl_table() is unavailable we fail to properly
unregister sysctl entries under "kernel/spl".

This leads to errors like the following when spl is unloaded/reloaded,
making impossible to properly reload the spl module:

[  746.995704] sysctl duplicate entry: /kernel/spl/kmem/slab_kvmem_total

Fix by cleaning up all the sub-entries inside "kernel/spl" when the
spl module is unloaded.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Closes #15239
2023-09-07 14:36:32 -07:00
Ed Maste c9315099f6 ssh-keygen: Generate Ed25519 keys when invoked without arguments
Ed25519 keys are convenient because they're much smaller, and the next
OpenSSH release (9.5) will switch to them by default.  Apply the change
to FreeBSD main now, to help identify issues as early as possible.

Reviewed by:	kevans, karels, des
Relnotes:	Yes
Obtained from:	OpenBSD 9de458a24986
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41773
2023-09-07 13:34:21 -04:00
Kristof Provost 97340b68d1 pf tests: extend SCTP tests to test state removal through ASCONF
pf can now mark shut down multihomed connections shutting down. Verify
that pf does the right thing.

MFC after:	3 weeks
Sponsored by:	Orange Business Services
2023-09-07 19:05:01 +02:00
Kristof Provost 4d3af82f78 pf: mark removed connections within a multihome association as shutting down
Parse IP removal in ASCONF chunks, find the affected state(s) and mark
them as shutting down. This will cause them to time out according to
PFTM_TCP_CLOSING timeouts, rather than waiting for the established
session timeout.

MFC after:	3 weeks
Sponsored by:	Orange Business Services
2023-09-07 19:05:01 +02:00
Kristof Provost f1cc29af84 pf: inherit v_tag values to multihomed connections
When we create a new state for an existing SCTP association inherit the
v_tag values from the original connection.

MFC after:	3 weeks
Sponsored by:	Orange Business Services
2023-09-07 19:05:01 +02:00
Kristof Provost 51a78dd276 pf: improve SCTP state validation
Only create new states for INIT chunks, or when we're creating a
secondary state for a multihomed association.

Store and verify verification tag.

MFC after:	3 weeks
Sponsored by:	Orange Business Services
2023-09-07 19:05:01 +02:00
Kristof Provost 1a28d5fea7 pf tests: basic SCTP multihoming test
The SCTP server will announce multiple addresses. Block one of them with
pf, connect to the other have the client use the blocked address. pf
is expected to have created state for all of the addresses announced by
the server.

In a separate test case add the secondary (client) IP after the
connection has been established. The intent is to verify the
functionality of the ASCONF chunk parsing.

MFC after:	3 weeks
Sponsored by:	Orange Business Services
Differential Revision:	https://reviews.freebsd.org/D41638
2023-09-07 19:05:01 +02:00
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