Commit Graph

276017 Commits

Author SHA1 Message Date
Stefan Eßer
78bc019d22 usr.bin/bc: update to version 5.3.1
This version adds support for command line editing and history using
the libedit or readline libraries in addition to the line editing
features available in previous versions.

The version in the base system is configured to use libedit.

This allows to choose between emacs and vi line editing commands and
to use command overrides via a ~/.editrc file.

Merge commit 'bd54318046bfee055b140705a5cfd4148e78da07'

PR:		264010

MFC after:	2 weeks
2022-06-11 13:14:37 +02:00
Stefan Eßer
bd54318046 vendor/bc: import of version 5.3.1
This update does not contain any functional change, but fixes two
minor build issues:

- Temporary files were created in the source directory, causing build
  failures if the sources were not writable at build time.
- A message catalogue contained extra characters that were ignored but
  made gencat print warning messages.
2022-06-11 11:54:23 +02:00
Stefan Eßer
5bdd626528 vendor/bc: import of version 5.3.0
This version adds support for command line editing and history using
the editline or readline libraries in addition to the line editing
features available in previous versions.
2022-06-11 11:50:28 +02:00
Doug Moore
36447829ae rb_tree: drop needless tests from rb_next, rb_prev
In RB_NEXT, when there is no RB_RIGHT node, the search must proceed
through the parent node.

There is code written to handle the case when the parent is non-NULL
and the current element is the left child of that parent. If you
assume that the current element is either the left child of its
parent, or the right child of its parent, but not both, then this test
is not necessary. Instead of assigning RB_PARENT(elm, field) to elm
when elm == RB_LEFT, removing the test has the code assign
RB_PARENT(elm, field) to elm when elm != RB_RIGHT. There's no need to
examine the RB_LEFT field at all.

This change removes that needless RB_LEFT test, and makes a similar
change to the RB_PREV implementation.

Reviewed by:	alc
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35450
2022-06-10 16:53:16 -05:00
Doug Moore
19bb5a7244 iommu_gas: pass size to iommu_map without rounding
Let the caller to iommu_map pass the size parameter without rounding
it up to a multiple of page size.  Let iommu_map round it up when
necessary, which is not all of the time, so that in some cases less
space is reserved.

Reviewed by:	alc, kib (previous version)
Tested by:	pho, br
Discussed with:	andrew
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D35424
2022-06-10 13:56:54 -05:00
Muhammad Moinur Rahman
1d7c4b7d86 Update organization.dot with new CORE.12 members
Approved by:	core (bofh with core-secretary@ hat on)
2022-06-10 12:11:45 -05:00
Bjoern A. Zeeb
d0d2911035 LinuxKPI: 802.11: rework handling of the special IEEE80211_NUM_TIDS queue
Rework the way we are dealing with the last queue.  If the driver
opts in to STA_MMPDU_TXQ then preferably send all non-data frames
via the last (IEEE80211_NUM_TIDS) queue which otherwise is not used
in station mode.
If we do not have that queue we do individual tx() calls for non-data
frames now.
Everything else goes via the selected queue if possible for as long as
we have a ni (sta) and otherwise resorts to direct tx.

Tested on:	Intel AX200 and AX210
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-06-10 14:18:57 +00:00
Eugene Grosbein
796d48ec41 ftpd(8): do not refer to now unused libxo(3)
In 2018, the commit r328100 (0fdf7fa846)
removed libxo(3) support from ls(1), so ftpd has no reasons to link
with libxo since then.

ls(1) does not depend on libxo in both of stable/12 and stable/13.

MFC after:	2 weeks
2022-06-10 21:09:20 +07:00
Bjoern A. Zeeb
0e981d79b1 LinuxKPI: move pm_message_t from kernel.h to pm.h
Move pm_message_t from kernel.h to pm.h and remove a private define
in usb.h as well as adjust the implementation in linux_usb.c.
This cleans up what I believe to be a historic shortcut and is
needed for future wireless driver updates.

Leave a note in UPDATING that drm-kmod users need to update to the
latest version before re-compiling a new kernel to avoid errors
(see PR).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
PR:		264449 (drm-kmod port update, thanks wulf)
Obtained from:	bz_git_iwlwifi (Dec 2020) (partly)
Reviewed by:	hselasky, imp
Differential Revision: https://reviews.freebsd.org/D35276
2022-06-10 14:05:12 +00:00
Baptiste Daroussin
60408c23c9 pci_vendors: udpate to 2022-05-18 2022-06-10 12:55:43 +02:00
Toomas Soome
e50e40684a loader: add support for gzip compression
As we do have zlib code in loader, we should also support gzip
compression in zfs.

PR:		153173
Submitted by:	Mikhail Zakharov <zmey20000@yahoo.com>
Reviewed by:	imp, markj, delphij
Differential Revision: https://reviews.freebsd.org/D35320
MFC after:	1 month
2022-06-09 20:54:30 +03:00
John Baldwin
ca341f3cf5 hwpmc: Permit the minimum sampling count to be set as a sysctl.
A rarely occurring event (e.g. an event that occurs less than 1000
times during execution of a program) may require a lower minimum
threshold than 1000.  Replace the hardcoded 1000 with a sysctl that
the administrator can use to permit smaller sampling count values.

Reviewed by:	mhorne, mav
Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D35400
2022-06-09 11:05:34 -07:00
John Baldwin
74536fca79 .github: Add a build on Ubuntu 22.04 using llvm 14.
Reviewed by:	uqs
Pull Request:	https://github.com/freebsd/freebsd-src/pull/599
2022-06-09 10:20:03 -07:00
John Baldwin
1c44d2bf86 usr.bin/dtc: Include <limits> for std::numeric_limits<>.
This is needed when building natively as a cross-tool on hosts such as
Linux using more recent versions of libstdc++.

Co-authored-by:	Alexander Richardson <arichardson@FreeBSD.org>
Obtained from:	CheriBSD
2022-06-09 10:20:03 -07:00
John Baldwin
3491ed652e .github: Cross-build aarch64 as well as amd64 kernels.
This required adding an explicit os list to the matrix.

Reviewed by:	uqs
Pull Request:	https://github.com/freebsd/freebsd-src/pull/599
2022-06-09 10:20:03 -07:00
John Baldwin
49335eda0f .github: Update compilers used for cross-build testing.
- Drop clang 9 build, and switch the remaining ubuntu build to
  the more modern clang 12.

- Update the label for the macos-latest builds which are now using
  clang 13 rather than clang 12.

Reviewed by:	uqs
Pull Request:	https://github.com/freebsd/freebsd-src/pull/599
2022-06-09 10:20:02 -07:00
Ed Maste
a7bd57de86 Sort SPLIT_KERNEL_DEBUG correctly in kern.opts.mk
Fixes:		e3709cfe6a ("Add SPLIT_KERNEL_DEBUG knob")
2022-06-09 10:39:52 -04:00
Hans Petter Selasky
bc2e447338 upgt(4): Adjust all pause calls to use milliseconds instead of ticks.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-06-09 15:18:02 +02:00
Hans Petter Selasky
c6c22ebb38 urtw(4): Adjust all pause calls to use milliseconds instead of ticks.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-06-09 15:18:02 +02:00
Vitaliy Gusev
e7d34aeda4 vmm: move bumping VMEXIT_USERSPACE stat to the right place
Statistic for "number of vm exits handled in userspace" should be
increased in vm_run() instead of vmx_run() because in some cases
vm_run() doesn't exit to userspace and keeps entering the guest.

Also svm_run's implementation even wrongly misses that stat.

Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35350
2022-06-09 08:57:25 -04:00
Doug Moore
3003117253 iommu_gas: Change find_space lower search order
iommu_gas_lowermatch looks right, then left, then right again in its
search for free space.  Change to a more straightforward last-fit
search that touches fewer tree nodes and improves performance.

Reported by:	wxzhu@rice.edu
Reviewed by:	alc, kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D35439
2022-06-08 23:14:28 -05:00
Colin Percival
1d2e46d408 EC2: Enable ephemeral swap by default
The latest version of the ec2-scripts package includes a completely
rewritten "use EC2 ephemeral disks for swap space" script.  Now that
we have something which works on recent versions of FreeBSD, turn it
on since it's a great way to use the ephemeral disks.

Note that the option for controlling this, ec2_ephemeral_swap_enable,
is not the same as the option (ec2_ephemeralswap_enable) used with the
previous ephemeral-swap script; this change was deliberate to avoid
astonishment for users who upgraded their ec2-scripts package and had
a setting left behind in rc.conf.
2022-06-08 15:50:30 -07:00
Cy Schubert
a39a5a6905 unbound: Vendor import 1.16.0
Merge commit '5f9f82264b91e041df7cba2406625146e7268ce4' into main

MFC after:	1 month
2022-06-08 15:08:42 -07:00
Michael Tuexen
ee9ee699d6 sctp: remove book keeping not needed anymore
MFC after:	3 days
2022-06-08 23:30:52 +02:00
Ed Maste
330b7dccd8 src.conf.5: regen for SPLIT_KERNEL_DEBUG knob 2022-06-08 17:15:11 -04:00
Ed Maste
e3709cfe6a Add SPLIT_KERNEL_DEBUG knob
Prior to 9b6edf364e WITHOUT_KERNEL_SYMBOLS split kernel debug data
into standalone debug files at build time, but did not install those
files.  As of 9b6edf364e it stopped splitting the debug data, leaving
it in the kernel and modules (the default kernel configs include
DEBUG=-g).

Revert 9b6edf364e and introduce a new build-time SPLIT_KERNEL_DEBUG
knob, as some people rely on the pre-9b6edf364eb0 WITHOUT_KERNEL_SYMBOLS
behaviour and that was imp's original intent.

PR:		264433
Reviewed by:	eugen, imp
MFC after:	3 weeks
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35437
2022-06-08 17:14:46 -04:00
Michael Tuexen
ad6ae52d1c sctp: cleanup, no functional change
MFC after:	3 days
2022-06-08 22:35:14 +02:00
Ed Maste
9f009e066f sshd_config: clarify password authentication options
Passwords may be accepted by both the PasswordAuthentication and
KbdInteractiveAuthentication authentication schemes.  Add a reference to
the latter in the description/comment for PasswordAuthentication, as it
otherwise may seem that "PasswordAuthentication no" implies passwords
will be disallowed.

This situation should be clarified with more extensive documentation on
the authentication schemes and configuration options, but that should be
done in coordination with upstream OpenSSH.  This is a minimal change
that will hopefully clarify the situation without requiring an extensive
local patch set.

PR:		263045
Reviewed by:	manu (earlier version)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35272
2022-06-08 16:20:46 -04:00
Cy Schubert
5f9f82264b unbound: Vendor import 1.16.0 2022-06-08 07:43:13 -07:00
Richard Scheffenegger
57317c8971 tcp: exclude KASSERTS when rescue retransmissions are in play.
The KASSERT criteria needs to be checked against the
sendbuffer so_snd in a subsequent version.

Reviewed By:	tuexen, #transport
PR:		263445
MFC after:	1 week
Sponsored by:	NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D35431
2022-06-08 14:51:31 +02:00
Hans Petter Selasky
d5d6949031 mlx5en(4): Allow RX TLS to be enabled and disabled by ifconfig(8).
While at it, fix double initialization of the "drv_ioctl_data_d" structure
and the "mask" variable.

Reviewed by:	kib@
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-06-08 13:53:26 +02:00
Richard Scheffenegger
ce2525c810 tcp: remove goto and address another NULL deref in SACK
Missed another NULL dereference during KASSERTS after traversing
the scoreboard. While at it, scratch the goto by making the
traversal conditional, and remove duplicate checks using an
unconditional loop with all checks inside.

Reviewed By:	hselasky
PR:		263445
MFC after:	1 week
Sponsored by:	NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D35428
2022-06-08 09:18:32 +02:00
Hans Petter Selasky
c4c5981c14 Bump the FreeBSD version after recent mbuf(9) structure changes.
Differential revision:	https://reviews.freebsd.org/D35339
Sponsored by:	NVIDIA Networking
2022-06-08 08:37:26 +02:00
Baptiste Daroussin
0a9541d9f3 pw: reinitialize struct tm before every call to strptime
This prevents corrupted result due to leftover of previous failed
call to strptime
2022-06-07 22:32:35 +02:00
Hans Petter Selasky
30c85a085e mbuf(9): Update comment about pkthdr structure size.
Differential revision:	https://reviews.freebsd.org/D35339
Sponsored by:	NVIDIA Networking
2022-06-07 22:19:11 +02:00
Hans Petter Selasky
b8394039dc mbuf(9): Fix size of mbuf for all 32-bit platforms (i386, ARM, PowerPC and RISCV)
Do this by reducing the size of the MBUF_PEXT_MAX_PGS, causing "struct mbuf" to
be bigger than M_SIZE, and also add a missing padding field to ensure 64-bit
alignment.

Reviewed by:	gallatin@
Reported by:	Elliott Mitchell
Differential revision:	https://reviews.freebsd.org/D35339
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-06-07 22:09:10 +02:00
Jens Schweikhardt
5d7c65ff36 Correct a typo in a string literal. 2022-06-07 21:48:59 +02:00
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