Commit Graph

277654 Commits

Author SHA1 Message Date
Luiz Amaral
485be9798a pfsync: replace struct pfsync_pkt with int flags
Get rid of struct pfsync_pkt. It was used to store data on the stack to
pass to all the submessage handlers, but only the flags part of it was
ever used. Just pass the flags directly instead.

Reviewed by:		kp
Obtained from:		OpenBSD
Sponsored by:		InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D36294
2022-08-22 23:46:50 +02:00
Jessica Clarke
fba998a3d8 tools/build: Unbreak bmake bootstrap on Linux
Currently make.py has a hack to add the cross-build headers to the
include search path when bootstrapping bmake on Linux (but not macOS).
This is a bit of an abuse of these headers, and e9ba1fd5ed was not
prepared for this, since sys/bitcount.h won't exist in that instance (it
gets copied into WORLDTMP during the legacy build). Work around this
until we can wean the bmake bootstrap off using these headers by not
including sys/bitcount.h when it doesn't exist.

Fixes:	e9ba1fd5ed ("tools/build: Provide FreeBSD's bitstring API when cross-building")
2022-08-22 22:02:53 +01:00
Rick Macklem
564ed8e806 nfsd: Allow multiple instances of rpc.tlsservd
During a discussion with someone working on NFS-over-TLS
for a non-FreeBSD platform, we agreed that a single server
daemon for TLS handshakes could become a bottleneck when
an NFS server first boots, if many concurrent NFS-over-TLS
connections are attempted.

This patch modifies the kernel RPC code so that it can
handle multiple rpc.tlsservd daemons.  A separate commit
currently under review as D35886 for the rpc.tlsservd
daemon.
2022-08-22 13:54:24 -07:00
Dmitry Salychev
a070c11afe
Add dsl to the src committers and bz as my mentor
Approved by:		bz (mentor)
Differential Revision:	https://reviews.freebsd.org/D36276
2022-08-22 15:59:21 +02:00
Bjoern A. Zeeb
11d08e7e8d arm/gic: fix a KASSERT in arm_gic_reserve_msi_range()
Fix the off-by-one in the KASSERT in arm_gic_reserve_msi_range()
allowing the MSIs being allocated at the end of the IRQ range.

Reported by:	bz
Submitted by:	andrew
Reviewed by:	andrew
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D36291
2022-08-22 11:59:02 +00:00
Hans Petter Selasky
57af517ac4 ibcore: Add support for RDMA/RoCE using VLAN(4) devices.
Classify VLAN devices as ethernet in rdma_copy_addr().
This fixes the following error message:

rdma_bind_addr: No such file or directory

Submitted by:	bartosz.sobczak@intel.com (Bartosz Sobczak)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36120
Sponsored by:	NVIDIA Networking
2022-08-22 10:04:26 +02:00
Hans Petter Selasky
e7314192ce sound(4): Fix order of parameters for custom equalizer band pass filter.
When specifying a custom band-pass filter for the sound(4) equalizer,
use the same format as used by the resulting C-code define to avoid
confusion.

PR:		195760
Sponsored by:	NVIDIA Networking
2022-08-22 10:04:26 +02:00
Mateusz Kozyra
7cb73f654f uart: Add ACPI entry for LS1046A UART
NXP defines unique name for LS1046A UART - "NXP0018".
It is ns8250 compatible, adding a new uart compat data entry is enough
to make it work.
Tested on LS1046ARDB.

Approved by:	mw(mentor)
Reviewed by:	mw, kd
Obtained from:	Semihalf
Differential Revision:	https://reviews.freebsd.org/D36260
2022-08-22 09:16:08 +02:00
Warner Losh
9d70108a74 stand: Use bool for stage_offset_set
stage_offset_set is a boolean, convert it to a bool.

Sponsored by:		Netflix
2022-08-21 09:48:02 -06:00
Gleb Smirnoff
9d54812421 snmp_mibII: use net.inet.ip.fragttl sysctl for ipReasmTimeout
Using IPFRAGTTL define was never correct, as it was measured in
PR_SLOWTIMO intervals.  The sysctl returns seconds, just what
ipReasmTimeout is.
2022-08-21 07:44:58 -07:00
Gleb Smirnoff
6498153665 ip_reass: don't drain all vnets on a vnet destroy 2022-08-21 07:44:58 -07:00
Robert Wing
3454a7caa0 kqueue: retire knlist_init_rw_reader()
Last usage was removed in afa85850e7.

Reviewed by:	pauamma, melifaro, kib
Differential Revision:	https://reviews.freebsd.org/D36205
2022-08-20 21:17:39 -08:00
Gleb Smirnoff
8338690a0a ip_reass: provide sysctl MIB returning IP fragment TTL
For now it is read-only, but eventually the cycle that goes over
all fragments should be refactored and this MIB should also become
read/write.

This MIB will allow SNMP daemons to implement MIB-II ipReasmTimeout MIB
straightfoward.  Right now net-snmp compilation is broken by 1922eb3e9c.
The base system bsnmpd is not broken just because it ignored PR_SLOWTIMO,
and thus always returned incorrectly doubled value for ipReasmTimeout.
2022-08-20 13:39:12 -07:00
Konstantin Belousov
f829268bcc Remove TDF_DOING_SA
We cannot see a thread with the flag set in unsuspend, after we stopped
doing SINGLE_ALLPROC from user processes.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:34:30 +03:00
Konstantin Belousov
5e5675cb4b Remove struct proc p_singlethr member
It does not serve any purpose after we stopped doing
thread_single(SINGLE_ALLPROC) from stoppable user processes.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:34:30 +03:00
Konstantin Belousov
2842ec6d99 REAP_KILL_PROC: kill processes in the threaded taskqueue context
There is a problem still left after the fixes to REAP_KILL_PROC.  The
handling of the stopping signals by sig_suspend_threads() can occur
outside the stopping process context by tdsendsignal(), and it uses
mostly the same mechanism of aborting sleeps as suspension.  In other
words, it badly interacts with thread_single(SINGLE_ALLPROC).

But unlike single threading from the process context, we cannot wait by
sleep for other single threading requests to pass, because we own
spinlock(s).

Fix this by moving both the thread_single(p2, SINGLE_ALLPROC), and the
signalling, to the threaded taskqueue which cannot be single-threaded
itself.

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:34:11 +03:00
Konstantin Belousov
5e9bba94bd fork_norfproc(): unlock p1 before retrying
Reported and reviewed by:	markj
Tested by:	pho
Syzkaller:	647212368c3f32c6f13f
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:18 +03:00
Konstantin Belousov
0a4f2ac3b7 kern_sig.c: style
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:18 +03:00
Konstantin Belousov
cdb58f9d04 ksiginfo_tryfree(): change return type to bool
The function result is already used as bool.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:18 +03:00
Konstantin Belousov
cc29f221aa ksiginfo_alloc(): change to directly take M_WAITOK/NOWAIT flags
Also style, and remove unneeded cast.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
5c78797e42 reap_kill_proc_locked(): remove outdated part of the comment
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
30b16a6bcf exit1(): update comment about thread_single()
We do not check single-threading conditions in trap, or when sleeping
uninterruptible.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
f835be5822 sleepq_set_timeout_sbt(): correct comment to not talk about ticks
It is sbt now.  Also, explain what flags are.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
da39a100db sleepq_check_ast_sc_locked(): update comment
The relock order is important not only for a signal delivery, but also
for the suspension requests.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
bd76586bb7 fork_norfproc(): style
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Ed Maste
6b598e263b pf: Reduce diffs against OpenBSD in pf_if.c
Use memset instead of bzero, memcpy instead of bcopy, and add some
optional {}s.

Reviewed by:	kp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36267
2022-08-20 11:52:05 -04:00
Søren Schmidt
ec556724d7 Add interrupt handling to rk_gpio driver. 2022-08-20 11:30:54 +00:00
Piotr Pawel Stefaniak
a142345641 sh: nullify ENV in tests
This is to avoid loading .shrc which may contain commands that would
result in output different than expected.

Reviewed by:	jilles
Differential Revision:	https://reviews.freebsd.org/D35876
2022-08-20 13:27:42 +02:00
Piotr Pawel Stefaniak
755a1be6d0 sh: accept fc options grouped behind one '-'
As per Utility Syntax Guidelines, accept both forms: -l -n and -ln.

To do that, anticipate the source string for the next option that will
be parsed by nextopt(). It's not always *argptr, sometimes it is
nextopt_optptr.

To simplify the check for not_fcnumber, slightly modify nextopt() to
always nullify nextopt_optptr in cases where it would have been set
to point to a NUL character.

Reviewed by:	jilles
Differential Revision:	https://reviews.freebsd.org/D35836
2022-08-20 13:26:05 +02:00
Mateusz Guzik
497240def8 Retire clone_drain_lock
It is only ever xlocked in drain_dev_clone_events and the only consumer of
that routine does not need it -- eventhandler code already makes sure the
relevant callback is no longer running.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D36268
2022-08-20 09:44:05 +00:00
Doug Moore
02d0c43c9e rb_tree: speed-up double rotation
RB_ROTATE_LEFT (and it symmetric twin) modify the rb-tree, adjusting
pointers so that what started as a proper tree ends up a proper
tree. When two consecutive rotations move the same node up the tree,
some of the pointers changed in the first rotation are immediately
changed again in the second - namely, the pointer from the rising node
to its new parent, and the pointer from that parent back to the rising
node. This change removes from RB_ROTATE macros the responsibility for
managing those two pointers, and leaves it to the code that calls for
rotations to fix up those pointers afterward. That drops a comparison
and a pair of assignments from every INSERT_COLOR or REMOVE_COLOR call
that ends in a double rotation.

A side-effect of this change is that the SWAP_CHILD macro must take as
a parameter a pointer to the node that is changing children, where it
is now computed from the old child. Since this macro is called in a
couple of places besides the RB_ROTATE macros, those calls are also
affected.

Reviewed by:	alc
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D36266
2022-08-19 18:11:29 -05:00
Navdeep Parhar
f6cc21e8e1 cxgbetool: remove unnecessary vertical whitespace.
No functional change.

MFC after:	3 days
2022-08-19 15:38:13 -07:00
John Baldwin
c94f30ea85 bhyve: Validate host PAs used to map passthrough BARs.
Reject attempts to map host physical address ranges that are not
subsets of a passthrough device's BAR into a guest.

Reviewed by:	markj, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36238
2022-08-19 15:03:01 -07:00
John Baldwin
16bedf532c pci: Add helper routines to iterate over a device's BARs.
Reviewed by:	imp, markj, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36237
2022-08-19 14:59:06 -07:00
John Baldwin
baf753cc19 bhyve: Support other schemes for naming pass-through devices.
Permit naming pass through devices using the syntax accepted by
pciconf (pci[<domain>:]<bus>:<slot>:<func>) as well as by device name
(e.g. "ppt0").

While here, fix an error in the manpage that had the bus and slot
arguments for the original /-delimited scheme swapped.

Reviewed by:	imp, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36147
2022-08-19 14:58:55 -07:00
Kristof Provost
7647626d33 e6000sw: fix incorrect locking
During attach we release the lock to call e6000sw_attach_miibus(), which
calls mii_attach(). The mii_attach() function calls miibus_readreg() /
miibus_writereg(). However, these are set to be
e6000sw_readphy_locked().

That is, the read/write phy functions do not acquire the lock, but
expect to be called while locked.  Simply do not unlock and relock while
calling mii_attach().

Reviewed by:	Hubert Mazur <hum@semihalf.com>
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36117
2022-08-19 23:09:11 +02:00
Gleb Smirnoff
820bafd0bc unix/dgram: don't panic if socket buffer has negative space
That's a legitimate scenario, although unlikely.

Reported by:	https://syzkaller.appspot.com/bug?extid=6e8be1ec8d77578a3df4
2022-08-19 12:15:38 -07:00
Ed Maste
97be6fced7 openssh: Remove description of VersionAddendum in upgrade doc 2022-08-19 10:39:17 -04:00
Ed Maste
bffe60ead0 ssh: retire client VersionAddendum
FreeBSD introduced VersionAddendum for the server as a local change in
2001 in commit 933ca70f8f and later extended it to the client in
commit 9e2cbe04ff.

In 2012 upstream added support for server VersionAddendum, in commit
23528816dc10.  They do not support it for the client.

The argument for supporting this in the client is not nearly as strong
as for the server, so retire this option to reduce the scope of our
local patch set.  This also avoids some cases of conflicts in ssh_config
during update, as a user's configuration would typically follow the
commented-out default VersionAddendum value.

Reviewed by:	gordon, glebius
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32930
2022-08-19 10:38:42 -04:00
Søren Schmidt
901df07a47 Code refactoring for existing rk_gpio driver.
It supports gpio type checking. Depending on gpio type some
register addresses are different.

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D36262
2022-08-19 13:22:01 +00:00
Kristof Provost
c780d3ad7b pf: clear ethernet rules prior to shutdown
Ethernet rule cleanup is postponed to an epoch callback. Ensure it's
been called before we remove the entire vnet, or we risk the rules still
getting hit after we've freed the uma zone, i.e. a use-after-free.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-08-19 14:53:09 +02:00
Emmanuel Vadot
319a4bddb0 linuxkpi: i2c: Fix 7bit/8bit addressing
Linux is using 7 bit addressing while FreeBSD uses 8 bit addresses
internally, but i2c(8) uses 7 bit address.
This confused me when originally doing the code and I thought that
0x50 was the 8bit EDID address while it's the 7bit address and since
I did all my testing using this I didn't noticed the problem.

Reported by:	avg
PR:		265920 (somewhat)
2022-08-19 14:39:16 +02:00
Peter Holm
dd89489769 stress2: Updated tests as a result of the latest updates to fsck_ffs(8) 2022-08-19 11:40:49 +02:00
Peter Holm
98b13e25fd stress2: Handle different spelling of "superblock" 2022-08-19 11:39:28 +02:00
Alexander Motin
3b7935f33b Decode couple arrays in NFIT table.
MFC after:	1 week
2022-08-18 21:30:38 -04:00
Mateusz Guzik
545db925c3 pipe: fix EOF case for non-blocking fds
In particular unbreaks 'go build'.
2022-08-18 21:23:53 +00:00
Bjoern A. Zeeb
8d37116489 net80211: LinuxKPI 802.11: harmonize IEEE80211_VHT_MCS_*
Rather than defining the same values in two places and having to do
conflict resulution on the name in LKPI, change the defines to an
enum in net80211.  In addition to de-duplication this also gives us
value checks in certain cases.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D36250
2022-08-18 20:34:30 +00:00
Bjoern A. Zeeb
bd29f81763 net80211: consistently use the IEEE80211_M_ memory related options
Replace a malloc() by IEEE80211_MALLOC().
For malloc flags even in the local ieee80211_freebsd.c there was a mix
of both versions M_ and IEEE80211_M_.
Consistently use the IEEE80211_M_ malloc options everywhere.
If the field is changed for malloc, it'll also be changed for the
other accessor functions taking a "how" field to avoid any confusion.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D36249
2022-08-18 20:32:24 +00:00
Bjoern A. Zeeb
9d2ba51806 net80211: ieee80211_ies_expand() add extra length check
Make sure the given IE length fits into the total length left when
parsing through the information elements.  In theory I would say
discard everything if there is an error but that proves hard with
the current code.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D36245
2022-08-18 20:29:25 +00:00
Bjoern A. Zeeb
4a7e8c7bd4 LinuxKPI: extend kfifo to be usable
Implement some basic kfifo pieces as needed by drivers.

MFC after:	2 weeks
Reviewed by:	wulf, hselasky
Differential Revision: https://reviews.freebsd.org/D35829
2022-08-18 20:26:20 +00:00