Commit Graph

279263 Commits

Author SHA1 Message Date
Navdeep Parhar
b2700160cc pcireg.h: Add values for ACS PCIe Extended capability.
These values come from section 7.7.11 ("ACS Extended Capability") of the
PCI Express Base Specification Revision 6.0, dated 16 Dec 2021.

MFC after:	1 week
Sponsored by:	Chelsio Communications
Reviewed by:	kib@
Differential Revision:	https://reviews.freebsd.org/D37270
2022-11-07 13:20:21 -08:00
Mark Johnston
3c0e9169a3 ksan: Build sanitizer runtimes without stack-smashing protection
On arm64 with per-thread stack canaries enabled (the PERTHREAD_SSP
option), the compiler may load curthread->td_md.md_canary in function
prologues.  This is not safe in data_abort(); see commit 2c10be9e06.
Thus, sanitizer runtimes must also avoid accessing the current thread's
canary.

Since SSP has limited utility in sanitizer runtimes, simply disable it
unconditionally to avoid unpleasant surprises in the future.

MFC after:	2 weeks
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
2022-11-07 16:10:48 -05:00
Mark Johnston
03bf40c5d8 arm64: Disable per-thread stack-smashing protection in data_abort()
With PERTHREAD_SSP configured, the compiler's stack-smashing protection
uses a per-thread canary value instead of a global value.  The value is
stored in td->td_md.md_canary; the sp_el0 register always contains a
pointer to that value, and certain functions selected by the compiler
will store the canary value on the stack as a part of the function
prologue (and will verify the copy as part of the epilogue).  In
particular, the thread structure may be accessed.

This happens to occur in data_abort(), which leads to the same problem
addressed by commit 2c10be9e06 ("arm64: Handle translation faults for
thread structures").  This commit fixes that directly, by disabling SSP
in data_abort() and a couple of related functions by using a function
attribute.  It also moves the update of sp_el0 out of C code in case
the compiler decides to start checking the canary in pmap_switch()
someday.

A different solution might be to move the canary value to the PCB, which
currently lives on the kernel stack and isn't subject to the same
problem as thread structures (if only because guard pages inhibit
superpage promotion).  However, there isn't any particular reason the
PCB has to live on the stack today; on amd64 it is embedded in struct
thread, reintroducing the same problem.  Keeping the reference canary
value at the top of the stack is also rather dubious since it could be
clobbered by a sufficiently large stack overflow.

A third solution could be to go back to the approach of commit
5aa5420ff2, and modify UMA to use the direct map for thread structures
even if KASAN is enabled.  But, transient promotions and demotions in
the direct map are possible too.

Reviewed by:	alc, kib, andrew
MFC after:	1 month
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37255
2022-11-07 16:05:58 -05:00
Ed Maste
4232f36eda sshd: sync tracing disable with upstream
Old versions of FreeBSD do not support using id 0 to refer to the
current pid for procctl, so pass getpid() explicitly.

Although this is not required in current FreeBSD branches I am merging
it to reduce differences with upstream.

Obtained from:	OpenSSH commit 0f7e1eba5525
2022-11-07 12:23:00 -05:00
Li-Wen Hsu
82e4a85de5
netlink: connect netlink(4), rtnetlink(4), genetlinl(4) to build
MFC after:	2 months
		(after 7366c0a49c)
2022-11-08 00:50:00 +08:00
Bjoern A. Zeeb
a62d5ff5b0 LinuxKPI: add linux/leds.h
This is just a dummy enum and struct in order to make drivers compile
more happily as some parts are simply not hidden behind #ifdefs and
this avoids a longer-term maintenance problem.

MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D37215
2022-11-07 12:52:41 +00:00
Bjoern A. Zeeb
6e8d676131 LinuxKPI: add devm_request_irq()
Add devm_request_irq() needed by a driver.  Turns out all we need
is a wrapper with the right arguments to lkpi_request_irq().

MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D37217
2022-11-07 12:51:01 +00:00
Bjoern A. Zeeb
6a647ae514 LinuxKPI: string.h implement memcpy_and_pad()
Add a memcpy variant which takes length of source and destination
buffers and a padding character in case there is free space in the
destination.  This is used by a wireless driver.

MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D37226
2022-11-07 12:49:01 +00:00
Bjoern A. Zeeb
4a67f1df8b LinuxKPI: 802.11: enable WME support
Most of the WME code has been there disabled for months.  One of the
reasons was that it lead to crashes early on.  It is now understood
that the crashes are independent event and we can enable WME.
Update the code and deal with the calls from net80211 and adjust the
updates to when mac80211 drivers expect them, coherently put it under
LKPI_80211_WME and enable the define locally.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-11-07 12:39:46 +00:00
Johannes Totz
a9a35c9e35 re.4: Mention vendor driver for if_re(4)
If this if_re(4) is causing problems then an updated driver from
the vendor can be found in the ports tree under net/realtek-re-kmod.

Reviewed by:	debdrup, koobs, emaste
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D33677
2022-11-07 13:16:52 +01:00
Baptiste Daroussin
4d184bd438 RELNOTES: document the switch from sendmail to dma 2022-11-07 12:52:20 +01:00
Baptiste Daroussin
a67b925ff3 mail: make The Dragonfly Mail Agent (dma) the default mta.
dma accepts mail from a local Mail User Agent (MUA) and delivers it
locally or to a smarthost for delivery. dma does not accept inbound
mail (i.e., it does not listen on port 25) and is not intended to
provide the same functionality as a full MTA like postfix or sendmail.
It is intended for use cases such as delivering cron(8) mail. which
is the default configuration and usage of sendmail in the default
setup of the base system.

In order to switch the default from sendmail to dma, we teach
mailwrapper to fallback on dma directly if the mailer.conf file cannot
be opened.
We install by default a mailer.conf file which points at dma
We install a mailer.conf file for sendmail in the examples.

Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D37035
2022-11-07 12:49:56 +01:00
Gordon Bergling
bdbc05bea9 tcp_rack: Add a manual page
- add a manual page for tcp_rack(4)
- link it in the tcp(4) and tcp_bbr(4) man pages
- hook it up to build in the Makefile

Reviewed by:	pauamma
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D37209
2022-11-07 12:28:39 +01:00
Li-Wen Hsu
160959df49
caroot: Update VCS instructions 2022-11-07 19:24:09 +08:00
Gordon Bergling
4d00d772e9 resolver.5: Add an EXAMPLES section
In case local-unbound(8) fails for some reason, it could be useful
to have a basic resolv.conf(5) example in the manual page.

Reviewed by:	karels, pauamma
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37183
2022-11-07 12:09:43 +01:00
Gordon Bergling
e0dfa1c4c4 shutdown.8: Add a note about needed priviledges to run the command
In order to use the shutdown command, the user must
have root privileges or be a member of the operator group.

PR:		266525
Reported by:	Zsolt Udvari <uzsolt at uzsolt hu>
Reviewed by:	pauamma
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36688
2022-11-07 12:00:11 +01:00
Gordon Bergling
8a220816c7 intro.3: Document 'libstdthreads' (the ISO C11 '<threads.h>' library).
It's still relatively uncommon to see C11 '<threads.h>' being used,
but it's worth documenting, especially since FreeBSD requires a
different library for C11 threads  compared to glibc (part of '-lpthread')
or musl libc  (included by default).

PR:	267551
Submitted by:	Alois Klink <alois plus freebsd at aloisklink dot com>
Reviewed by:	pauamma
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D37284
2022-11-07 11:34:00 +01:00
Gordon Bergling
9bdb5158d6 Update HISTORY and AUTHORS sections for cut(1) and paste(1)
In an e-mail Brian Walden wrote that:

"GWRL stands for Gottfried W. R. Luderer, the author of cut(1) and
paste(1), probably around 1978. Those came either from PWB or USG,
as he worked with, or for, Berkley Tague. Thus they made their way
into AT&T commercial UNIX, first into System III and the into System
V, and that's why they are missing from early BSD releases as they
didn't get into Research UNIX until the 8th Edition."

So update the HISTORY and AUTHORS sections for cut(1) and paste(1).

[1] https://minnie.tuhs.org/pipermail/tuhs/2020-January/019955.html

Reviewed by:	pauamma, imp
Obtained from:	OpenBSD (in partial)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36048
2022-11-07 11:23:33 +01:00
Michael Tuexen
126f8248cc Unbreak builds having SCTP support compiled in
Including sctp_var.h requires INET to be defined if IPv4 support
is needed.
2022-11-07 08:50:51 +01:00
Li-Wen Hsu
61273a28e8
rc.conf(5): Add mssing definite article
Reported by:	rpokala
2022-11-07 16:03:50 +08:00
Li-Wen Hsu
3bf53c4c8f
release(7): Enable zpoolupgrade rc script in ZFS based VM images
This will enable VM access to all ZFS feature automatically, only on a
newly installed or provisioned VM or cloud instance.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37283
2022-11-07 11:47:33 +08:00
Li-Wen Hsu
72a1cb05cd
rc(8): Add a zpoolupgrade rc.d script
If a zpool is created by makefs(8), its version is 5000, i.e., all
feature flags are off.  Introduce an rc script to run `zpool upgrade`
over the assigned zpools on the first boot.  This is useful to the
ZFS based VM images built from release(7).

Reviewed by:	imp, markj, mav
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37282
2022-11-07 11:30:09 +08:00
Michael Tuexen
f83db6441a sctp: minor changes due to upstreaming of Glebs recent changes 2022-11-06 23:06:40 +01:00
Richard Scheffenegger
37bf391d3c tcp: make tcp_packets_this_ack() only visible in kernel scope 2022-11-06 13:51:57 +01:00
Richard Scheffenegger
004bb636ca tcp: Move sysctl OIDs related to ECN to tcp_ecn.c
Keep all ECN related code in (mostly) one place.

No functional change.

Event:			IETF 115 Hackathon
Reviewed By:		tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D37285
2022-11-06 12:38:42 +01:00
Richard Scheffenegger
b1258b7643 tcp: add conservative d.cep accounting algorithm
Accurate ECN asks to conservatively estimate, when the
ACE counter may have wrapped due to a single ACK covering a larger
number of segments. This is described in Annex A.2 of the
accurate-ecn draft.

Event:			IETF 115 Hackathon
Reviewed By:		tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D37281
2022-11-06 12:05:22 +01:00
Richard Scheffenegger
22c81cc516 tcp: add AccECN CE packet counters to tcpinfo
Provide diagnostics information around AccECN into
the tcpinfo struct.

Event:			IETF 115 Hackathon
Reviewed By:		tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D37280
2022-11-06 11:56:02 +01:00
Justin Hibbits
d56c7ac87f dpaa: Go to cleanup exit point on fman attach error
If fman_init() fails it can leave things in a state where it cannot
attach at all in the future, because it would simply exit without
tearing down everything that was already set up.  Go to the exit point
to clean up on error instead, so that it can try again later.

MFC after:	1 week
2022-11-05 20:05:24 -04:00
Warner Losh
105019e0d6 bnxt: Remove from LINT
Until bnxt is fixed on i386, remove it from its lint. Create a new
section of the config file for things that work everywhere, except i386.

Sponsored by:		Netflix
2022-11-04 22:55:18 -06:00
Warner Losh
eb40e3e757 bnxt: Only filter out i386
Only i386 is missing bus_read_8. The other 32-bit platforms can be fixed
with a cast to a printf.

Suggested by:	kevans
Sponsored by:	Netflix
2022-11-04 22:40:00 -06:00
Kyle Evans
a28989483e wg: drop -Wno-cast-qual from CFLAGS
The latest update fixes the warning by applying const to the correct
part of the pointer.
2022-11-04 22:46:55 -05:00
Kyle Evans
2cb43631ab Merge commit '93bf91b4012a28610672d2266366dfa0a663b70f' into HEAD
This fixes a warning in wireguard-tools, as well as two issues pointed out by
FreeBSD's Coverity instance.

CID:		1500405, 1500421
2022-11-04 22:46:21 -05:00
Kyle Evans
93bf91b401 Update wireguard-tools to 139aac59a5ab7
This includes fixes for two issues pointed out by FreeBSD's Coverity,
as well as a -Wcast-qual complaint.

While we're here, ignore build artifacts as well upon import.
2022-11-04 22:43:12 -05:00
Warner Losh
269865a8ee stand: Update comment about devdesc
How devdesc is used is opaque until much code is read. Give a more
useful description of the theory behind it here.

Sponsored by:		Netflix
2022-11-04 19:46:44 -06:00
Ed Maste
9c231325e7 Clang: Add Diags for targets pre to i686 for -fcf-protection
Intel Control-flow Enforcement Technology (CET) provides new
instructions `endbr32/64` for the indirect branch control.
They are NOPs on i686 and new targets.  We need to check for that
in case it crashes on older targets.

PR:		264497
Reviewed by:	dim
MFC after:	1 week
Obtained from:	LLVM commit 52516782972730ff065a34123a9d8876da08c254
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37268
2022-11-04 20:42:26 -04:00
Warner Losh
75217c2b47 bnxt: Only build on 64-bit platforms
The driver uses bus_space_read_8 and friends, which do not exist on
32-bit i386 and break the build.

Sponsored by:		Netflix
2022-11-04 16:49:10 -06:00
Sumit Saxena
58d84ef870 if_bnxt: Added support for mgmt interface for passthrough hwrms
Added support for application management interface. There are two types of commands supported:

1. Firmware IOCTLs: These ioctls are meant for firmware
   consumption. Driver acts as a transport for these.
2. Driver only IOCTLs: These ioctls are meant for driver
   consumption. Driver will serve these ioctls without sending them down
   to firmware.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36448
2022-11-04 16:40:29 -06:00
Sumit Saxena
2ed061f08d if_bnxt: Add support for smaller backing_store_cfg message size
Add compat logic to fallback to the older/smaller backing_store_cfg
message size.

Reviewed by: imp
Differentil Revision: https://reviews.freebsd.org/D36447
2022-11-04 16:33:21 -06:00
Sumit Saxena
19a57f85ba if_bnxt: Fix the PORT_PHY_CFG HWRM requests while setting Pause
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36446
2022-11-04 16:31:24 -06:00
Sumit Saxena
baef1301a2 if_bnxt: Fix the issue when kernel invokes _init() again without _stop()
Fixed the issue when kernel invokes _init() when it is already in
_init() state by invoking _stop() in such case.

Reviewed by: imp
Differential Revsion: https://reviews.freebsd.org/D36445
2022-11-04 16:28:51 -06:00
Sumit Saxena
72e9dbb58c if_bnxt: Remove sysctl node vlan_only which is not being used
Removed sysctl node vlan_only which is not being used after migrating
from l2_set_rx_mask to l2_filter_alloc.

Reviewed by: imp
Differential Revsion: https://reviews.freebsd.org/D36444
2022-11-04 16:26:03 -06:00
Sumit Saxena
91fcacc355 if_bnxt: Add support for VLAN on Thor
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36443
2022-11-04 16:24:32 -06:00
Sumit Saxena
cfdca95f78 if_bnxt: Add support for RSS on Thor
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36442
2022-11-04 16:21:20 -06:00
Sumit Saxena
6033382aab if_bnxt: Display firmware version along with SIT package version
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36441
2022-11-04 16:18:38 -06:00
Sumit Saxena
fb4b7e02d2 if_bnxt: Add support for async link status update
Reivewed by: imp
Differential Revision: https://reviews.freebsd.org/D36440
2022-11-04 16:14:49 -06:00
Sumit Saxena
055196a7d7 if_bnxt: Add support for admin down/up and jumbo
Make ifconfig up/down work, as well as adding support for jumbo frames.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36439
2022-11-04 16:11:10 -06:00
Sumit Saxena
8945584f93 if_bnxt: add support for Thor controller
Added support for Thor controller.
Below are the supported operations:

1. IPv4 ping (ICMP)
2. iperf / netperf (IPv4 TCP)
3. Promiscuous (tcpdump)
4. Can achieve 20 Gbps on a 25 G link (Uni-Di)
5. Can achieve 60 Gbps on a 100 G link (Uni-Di)
6. Port level and queue level driver stats.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36438
2022-11-04 16:05:57 -06:00
Sumit Saxena
49a3df78c7 if_bnxt: Convert all doorbell writes into function pointers
This is preparatory patch for making a base for Broadcom's Thor
controller support. It converts all doorbell writes into function
pointers.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36437
2022-11-04 16:02:29 -06:00
Sumit Saxena
97315f68fe if_bnxt: update hsi_struct_def.h headers
Updates the drivers to Broadcom's latest:
	HWRM Version 1.10.2.34 using HSI definition version 1.8.4

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36436
2022-11-04 15:58:43 -06:00
Warner Losh
0e3b0045a8 sys/disk.h: Transition period for sys/conf.h over
There's no need to ever include sys/conf.h here anymore, so remove
it. It was added years ago as a transition and everything has been
updated.

Sponsored by:		Netflix
2022-11-04 15:40:12 -06:00