Commit Graph

275980 Commits

Author SHA1 Message Date
Richard Scheffenegger
231e0dd5d1 tcp: skip sackhole checks on NULL
Inadvertedly introduced NULL pointer dereference during
sackhole sanity check in D35387.

Reviewed By:	glebius
PR:		263445
MFC after:	1 week
Sponsored by:	NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D35423
2022-06-07 18:18:42 +02:00
Ed Maste
92fc5822a8 Clarify WITHOUT_KERNEL_SYMBOLS description
Debug data is enabled via `makeoptions DEBUG=-g` in the kernel config
file (e.g. GENERIC).

If debug data is enabled and WITHOUT_KERNEL_SYMBOLS is set then debug
data is included in the kernel and module files.

PR:		264433
Discussed with:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-06-07 11:33:12 -04:00
Hans Petter Selasky
dd2a8c8f72 mlx4core: Use-after-free causes a resource leak in flow-steering detach
mlx4_QP_FLOW_STEERING_DETACH_wrapper first removes the steering
rule (which results in freeing the rule structure), and then
references a field in this struct (the qp number) when releasing the
busy-status on the rule's qp.

Since this memory was freed, it could reallocated and changed.
Therefore, the qp number in the struct may be incorrect,
so that we are releasing the incorrect qp. This leaves the rule's qp
in the busy state (and could possibly release an incorrect qp as well).

Fix this by saving the qp number in a local variable, for use after
removing the steering rule.

Linux commit:
3b01fe7f91c8e4f9afc4fae3c5af72c14958d2d8

PR:	     	264469
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-06-07 16:28:32 +02:00
Hans Petter Selasky
fe8c78f0d2 ktls: Add full support for TLS RX offloading via network interface.
Basic TLS RX offloading uses the "csum_flags" field in the mbuf packet
header to figure out if an incoming mbuf has been fully offloaded or
not. This information follows the packet stream via the LRO engine, IP
stack and finally to the TCP stack. The TCP stack preserves the mbuf
packet header also when re-assembling packets after packet loss. When
the mbuf goes into the socket buffer the packet header is demoted and
the offload information is transferred to "m_flags" . Later on a
worker thread will analyze the mbuf flags and decide if the mbufs
making up a TLS record indicate a fully-, partially- or not decrypted
TLS record. Based on these three cases the worker thread will either
pass the packet on as-is or recrypt the decrypted bits, if any, or
decrypt the packet as usual.

During packet loss the kernel TLS code will call back into the network
driver using the send tag, informing about the TCP starting sequence
number of every TLS record that is not fully decrypted by the network
interface. The network interface then stores this information in a
compressed table and starts asking the hardware if it has found a
valid TLS header in the TCP data payload. If the hardware has found a
valid TLS header and the referred TLS header is at a valid TCP
sequence number according to the TCP sequence numbers provided by the
kernel TLS code, the network driver then informs the hardware that it
can resume decryption.

Care has been taken to not merge encrypted and decrypted mbuf chains,
in the LRO engine and when appending mbufs to the socket buffer.

The mbuf's leaf network interface pointer is used to figure out from
which network interface the offloading rule should be allocated. Also
this pointer is used to track route changes.

Currently mbuf send tags are used in both transmit and receive
direction, due to convenience, but may get a new name in the future to
better reflect their usage.

Reviewed by:	jhb@ and gallatin@
Differential revision:	https://reviews.freebsd.org/D32356
Sponsored by:	NVIDIA Networking
2022-06-07 12:58:09 +02:00
Hans Petter Selasky
f0fca64618 ktls: Refer send tag pointer once.
So that the asserts and the actual code see the same values.

Differential revision:	https://reviews.freebsd.org/D32356
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-06-07 12:57:03 +02:00
Hans Petter Selasky
cb27627968 mlx5en(4): Set the leaf network interface field in the mbuf packet header.
This will be used for TLS RX.

Submitted by:	jhb@
Differential revision:	https://reviews.freebsd.org/D32356
Sponsored by:	NVIDIA Networking
2022-06-07 12:54:42 +02:00
Hans Petter Selasky
4d88d81c31 mbuf(9): Implement a leaf network interface field in the mbuf packet header.
When packets are received they may traverse several network interfaces like
vlan(4) and lagg(9). When doing receive side offloads it is important to
know the first network interface entry point, because that is where all
offloading is taking place. This makes it possible to track receive
side route changes for multiport setups, for example when lagg(9) receives
traffic from more than one port. This avoids having to install multiple
offloading rules for the same stream.

This field works similar to the existing "rcvif" mbuf packet header field.

Submitted by:	jhb@
Reviewed by:	gallatin@ and gnn@
Differential revision:	https://reviews.freebsd.org/D35339
Sponsored by:	NVIDIA Networking
Sponsored by:	Netflix
2022-06-07 12:54:42 +02:00
Hans Petter Selasky
892eded5b8 vlan(4): Add support for allocating TLS receive tags.
The TLS receive tags are allocated directly from the receiving interface,
because mbufs are flowing in the opposite direction and then route change
checks are not useful, because they only work for outgoing traffic.

Differential revision:	https://reviews.freebsd.org/D32356
Sponsored by:	NVIDIA Networking
2022-06-07 12:54:42 +02:00
Hans Petter Selasky
1967e31379 lagg(4): Add support for allocating TLS receive tags.
The TLS receive tags are allocated directly from the receiving interface,
because mbufs are flowing in the opposite direction and then route change
checks are not useful, because they only work for outgoing traffic.

Differential revision:	https://reviews.freebsd.org/D32356
Sponsored by:	NVIDIA Networking
2022-06-07 12:54:42 +02:00
Roger Pau Monné
1d528f95e8 xen/blkback: remove bounce buffering mode
Remove bounce buffering code for blkback and only attach if Xen
creates IOMMU entries for grant mapped pages.

Such bounce buffering consumed a non trivial amount of memory and CPU
resources to do the memory copy, when it's been a long time since Xen
has been creating IOMMU entries for grant maps.

Refuse to attach blkback if Xen doesn't advertise that IOMMU entries
are created for grant maps.

Sponsored by: Citrix Systems R&D
2022-06-07 12:29:53 +02:00
Roger Pau Monné
137381ca60 xen/blkback: fix tear-down issues
Handle tearing down a blkback that hasn't been fully initialized. This
requires carefully checking that fields are allocated before trying to
access them.  Also communication memory is allocated before setting
XBBF_RING_CONNECTED, so gating it's freeing on XBBF_RING_CONNECTED
being set is wrong and will lead to memory leaks.

Also stop using xbb_disconnect() in error paths. Use xenbus_dev_fatal
and let the normal disconnection procedure take care of the cleanup.

Reported by: Ze Dupsys <zedupsys@gmail.com>
Sponsored by: Citrix Systems R&D
2022-06-07 12:29:53 +02:00
Roger Pau Monné
f3d54ded28 xenbus: improve device tracking
xenbus needs to keep track of the devices exposed on xenstore, so that
it can trigger frontend and backend device creation.

Removal of backend devices is currently detected by checking the
existence of the device (backend) xenstore directory, but that's prone
to races as the device driver would usually add entries to such
directory itself, so under certain circumstances it's possible for a
driver to add node to the directory after the toolstack has removed
it.  This leads to devices not removed, which can eventually exhaust
the memory of FreeBSD.

Fix this by checking for the existence of the 'state' node instead of
the directory, as such node will always be present when a device is
active, and will be removed by the toolstack when the device is shut
down.  In order to avoid any races with the updating of the 'state'
node by FreeBSD and the toolstack removing it use a transaction in
xenbusb_write_ivar() for that purpose.

Reported by: Ze Dupsys <zedupsys@gmail.com>
Sponsored by: Citrix Systems R&D
2022-06-07 12:29:53 +02:00
Richard Scheffenegger
91d6afe6e2 tcp: Sanity check of SACK holes on retransmissions
Adding a few KASSERT() to validate sanity of sack holes, and
bail out if sack hole is inconsistent to avoid panicing non-invariant builds.

Reviewed By:	hselasky, glebius
PR:		263445
MFC after:	1 week
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D35387
2022-06-07 09:38:16 +02:00
Alexander Motin
eff9ee7c0c hwpmc: Increase thread priority while iterating CPUs.
This allows to profile already running high-priority threads, that
otherwise by blocking thread migration to respective CPUs blocked PMC
management, i.e. profiling could start only when workload completed.

While there, return the thread to its original CPU after iterating
the list.  Otherwise all threads using PMC end up on the last CPU.

MFC after:	1 month
2022-06-06 22:51:01 -04:00
Kyle Evans
8cdb6b2dd7 alc: force maximum payload size to 128 bytes for AR816X/AR817x
Otherwise, we'll trigger a DMA write error and render the device
unusable.

Obtained from:	OpenBSD (via Haiku, waddlesplash)
MFC after:	3 days
2022-06-06 20:52:55 -05:00
John Baldwin
81c857dd7e gcore: Don't hardcode VM write permissions.
This ensures read-only PT_LOAD segments are not marked as writable in
the phdr flags.

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35398
2022-06-06 16:43:02 -07:00
Doug Moore
b831865fe3 iommu_gas: restrict tree search to promising paths
In iommu_gas_lowermatch and iommu_gas_uppermatch, a subtree search is
quickly terminated if the largest available free space in the subtree
is below a limit, where that limit is related to the size of the
allocation request. However, that limit is too small; it does not
account for both of the guard pages that will surround the allocated
space, but only for one of them. Consequently, it permits the search
to proceed through nodes that cannot produce a successful allocation
for all the requested space. Fix that limit to improve search
performance.

Reviewed by:	alc, kib
Submitted by:	Weixi Zhu (wxzhu@rice.edu)
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D35414
2022-06-06 16:26:01 -05:00
Konstantin Belousov
156745b42d fdescfs: allow chown/utime etc on fdescfs fd for underlying files opened with O_PATH
Reported and tested by:	dchagin
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D35410
2022-06-06 22:27:36 +03:00
Alfonso S. Siciliano
559de8eedb
bsddialog(3): Fix text wrapping
Fix text wrapping with more than 1024 words.

Reported by:		brd
Reviewed by:		bapt, brd
Differential Revision:	https://reviews.freebsd.org/D35413
2022-06-06 21:12:36 +02:00
John Baldwin
ad52a7bb03 gcore: Remove unused elf_note_arm_vfp function.
Fixes:		add00c381e Use a regset for NT_ARM_VFP.
2022-06-06 11:06:49 -07:00
Gleb Smirnoff
d97922c6c6 unix/*: rewrite unp_internalize() cmsg parsing cycle
Make it a complex, but a single for(;;) statement.  The previous cycle
with some loop logic in the beginning and some loop logic at the end
was confusing.  Both me and markj@ were misleaded to a conclusion that
some checks are unnecessary, while they actually were necessary.

While here, handle an edge case found by Mark, when on 64-bit platform
an incorrect message from userland would underflow length counter, but
return without any error.  Provide a test case for such message.

Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35375
2022-06-06 10:05:28 -07:00
Yuichiro NAITO
8d95f50052 smp: Use local copies of the setup function pointer and argument
No functional change intended.

PR:		264383
Reviewed by:	jhb, markj
MFC after:	1 week
2022-06-06 11:29:51 -04:00
Justin Hibbits
139ba152c9 arm64: Print per-CPU cache summary
Summary:
It can be useful to see a summary of CPU caches on bootup.  This is done
for most platforms already, so add this to arm64, in the form of (taken
from Apple M1 pro test):

  L1 cache: 192KB (instruction), 128KB (data)
  L2 cache: 12288KB (unified)

This is printed out per-CPU, only under bootverbose.

Future refinements could instead determine if a cache level is shared
with other cores (L2 is shared among cores on some SoCs, for instance),
and perform a better calculation to the full true cache sizes.  For
instance, it's known that the M1 pro, on which this test was done, has 2
12MB L2 clusters, for a total of 24MB.  Seeing each CPU with 12288KB L2
would make one think that there's 12MB * NCPUs, for possibly 120MB
cache, which is incorrect.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	#arm64, andrew
Differential Revision: https://reviews.freebsd.org/D35366
2022-06-06 10:23:10 -05:00
Marc Fonvieille
45ef6b4b5d bsdinstall/scripts/docsinstall: Add Indonesian Documentation
Add Indonesian Documentation to docinstall menu.

Approved by:	doceng (implicit) re (gjb, implicit)
MFC after:	1 week
2022-06-06 13:44:43 +02:00
Hans Petter Selasky
85d7875d42 LinuxKPI: Fix dmi_matches() function
Make sure to check for NULL pointers and also check all search criterias,
not only the first one!

Bump the FreeBSD version.

Reviewed by:	manu@
Differential Revision:	https://reviews.freebsd.org/D35403
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-06-06 10:31:34 +02:00
Gordon Bergling
cd7e11f78d ixgbe(4): Fix common typos in source code comments
- s/filer/filter/

Obtained from:	NetBSD
MFC after:	3 days
2022-06-06 07:28:56 +02:00
PauAmma
eabfcbbfe1 firewire.4: Fix typo
While there, replace dead wiki URL with dev handbook one and fix markup.

Reviewed by:	gbe
Differential Revision:	https://reviews.freebsd.org/D35252
2022-06-05 23:52:34 -04:00
Brad Davis
3bcd261265 bsdinstall: allow overriding DISTRIBUTIONS in the normal auto mode
Reviewed by:	dteske
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35355
2022-06-05 19:04:04 -06:00
Bjoern A. Zeeb
71df58aefc LinuxKPI: 802.11: plug a ni leak in lkpi_sta_assoc_to_run()
In lkpi_sta_assoc_to_run() we are going through some code segments
twice (auth->assoc, assoc->authorized).  The 2nd time we shall not
re-gain a reference on the net80211 node as otherwise it'll leak.
Likewise we do not have to re-set lsta and sta.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-06-05 21:12:55 +00:00
Dimitry Andric
5e383e3603 Add more old clang files to (Optional)ObsoleteFiles.inc
There were a few more libclang_rt libraries added recently, but not yet
listed in the ObsoleteFiles.inc lists.

MFC after:	3 days
2022-06-05 22:45:52 +02:00
Bjoern A. Zeeb
728afa885f rtw88: plug various skb leaks in error cases
Based on manual inspection the skbs are not freed in those unlikely
cases, though all would give an error message so would have gone noticed
if happened.
While here fix a typo in one of these error messages.

MFC after:	3 days
2022-06-05 18:10:24 +00:00
Bjoern A. Zeeb
dbc06dd98a LinuxKPI: 802.11 plug mbuf leak in error cases
Manually free the mbuf in certain error cases from net80211 to not
leak it.
Note that the differences between ieee80211_input_mimo() and
ieee80211_input_mimo_all(), the former not consuming the mbuf while
the later does, is confusing.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-06-05 18:10:24 +00:00
Eugene Grosbein
20634f0261 if_qlxge: fix stand-alone module build
Fix module build outside of kernel build environment.

MFC after:	3 days
2022-06-06 01:05:02 +07:00
Eugene Grosbein
32467e47b7 if_glxgbe: fix stand-alone module build
Fix module build outside of kernel build environment.

MFC after:	3 days
2022-06-06 00:59:46 +07:00
Eugene Grosbein
966e279052 if_glxgb: fix stand-alone module build
Fix module build outside of kernel build environment.

MFC after:	3 days
2022-06-06 00:58:40 +07:00
Dimitry Andric
809922b010 Update rest of llvm-project build glue for 14.0.4
I completely forgot about updating the generated llvm-project config
files, which also contain version numbers, etc. Sorry for the churn.

PR:		261742
Fixes:		ab9d54731f
MFC after:	3 days
2022-06-05 18:39:43 +02:00
Gordon Bergling
f129473702 qlxgbe(4): Fix a common typo in a source code comment
- s/independant/independent/

MFC after:	3 days
2022-06-05 09:56:29 +02:00
Gordon Bergling
508a46c745 twe(4): Fix a common typo in a source code comment
- s/independant/independent/

MFC after:	3 days
2022-06-05 09:55:25 +02:00
Gordon Bergling
d3e0919b56 ffec: Fix a common typo in a source code comment
- s/independant/independent/

MFC after:	3 days
2022-06-05 09:54:39 +02:00
Gordon Bergling
9ae6b386ab mlx(4): Fix a common typo in a source code comment
- s/independant/independent/

MFC after:	3 days
2022-06-05 09:53:59 +02:00
Gordon Bergling
9e75b06f93 libgssapi: Fix a common typo in a source code comment
- s/independant/independent/

MFC after:	3 days
2022-06-05 09:53:24 +02:00
Gordon Bergling
860740ae0f vm: Fix a common typo in a source code comment
- s/independant/independent/

MFC after:	3 days
2022-06-05 09:52:32 +02:00
Gordon Bergling
565405095b nlist(3): Fix a common typo in a source code comment
- s/independant/independent/

MFC after:	3 days
2022-06-05 09:51:57 +02:00
Gordon Bergling
c2a249ad8f geom(4): Fix a common typo in a source code comment
- s/independant/independent/

MFC after:	3 days
2022-06-05 09:51:10 +02:00
Gordon Bergling
c44b5e090d stand: Fix a common typo in source code comments
- s/independant/independent/

MFC after:	3 days
2022-06-05 09:49:51 +02:00
Gordon Bergling
a87f167c41 qlnxe(4): Fix a typo in a source code comment
- s/indepent/independent/

MFC after:	3 days
2022-06-05 09:15:33 +02:00
Gordon Bergling
f207bdd2cc if_age(4): Fix a typo in a source code comment
- s/indepent/independent/

MFC after:	3 days
2022-06-05 09:14:17 +02:00
Gordon Bergling
5cacfa7092 libkern: Fix a typo in a source code comment
- s/involes/involves/

Obtained from:	NetBSD
MFC after:	3 days
2022-06-05 08:57:26 +02:00
Gordon Bergling
00b0158d2c mpt(4): Fix two typos in debug statements
- s/Intermidiate/Intermediate/

Obtained from:	NetBSD
MFC after:i	3 days
2022-06-04 20:41:15 +02:00
Gordon Bergling
e2dfabb589 nvmecontrol(8): Fix a typo in an error message
- s/insufficent/insufficient/

MFC after:	3 days
2022-06-04 20:30:48 +02:00