Commit Graph

282635 Commits

Author SHA1 Message Date
Cheng Cui
fcad8ada9a
Revert "Add myself (cc) as a src commiter."
Summary: This reverts commit 134ced89c4.

Reviewers: rscheff, tuexen
Subscribers: imp
Approved by: tuexen (mentor)
Differential Revision: https://reviews.freebsd.org/D39363
2023-03-31 05:58:14 -04:00
Mark Johnston
a54370f4ab arm64: Ensure that thread0's PCB flags are initialized
On arm64, the PCB is stored at the top of the thread stack.  For thread0
this comes from the static "initstack" region, which is placed in the
.init_pagetable section, which is not part of the BSS and thus doesn't
get zeroed by locore.  (See the comment in ldscript.arm64.)  It is thus
possible for the pcb_flags field to be uninitialized, which can result
in PCB_SINGLE_STEP being set.

Fix this by simply initializing the field.  A separate commit will move
initstack out of the .init_pagetable section, since it has no reason to
be there, but it is preferable to explicitly initialize PCB fields
anyway.  In particular, regular kernel stacks are not zeroed upon
allocation, so we should be consistent here.

Reviewed by:	andrew
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	Juniper Networks
Differential Revision:	https://reviews.freebsd.org/D39343
2023-03-31 09:50:34 -04:00
Dmitry Chagin
960562652c linux(4): Fix opt_netlink.h inclusion
Add opt_netlink.h to the linux_common module, on i386, where we don't
uses linux_common module, move opt_netlink.h inclusion under
i386 condition.

MFC after:		2 weeks
2023-03-31 14:56:59 +03:00
Dmitry Chagin
126df352f5 linux(4): Move inclusion of i386-specific files under common condition 2023-03-31 14:56:29 +03:00
Dmitry Chagin
f94b5734bc Revert "linsysfs(4): Reimplement listnics() using ifAPI"
This reverts commit 0b56641cfc.

As it poorly interacts with vnet subsystem
2023-03-31 14:54:33 +03:00
Kristof Provost
28921c4f7d carp: allow commands to use interface name rather than index
Get/set commands can now choose to provide the interface name rather
than the interface index. This allows userspace to avoid a call to
if_nametoindex().

Suggested by:	melifaro
Reviewed by:	melifaro
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39359
2023-03-31 11:29:58 +02:00
Andrew Turner
3a0cc6fe61 Handle the arm64 unknown exception separately
Rather than falling through to the default case handle the unknown
exception with its own panic message. As ESR_EL1 is zero for this
exception stop printing it.

Sponsored by:	Arm Ltd
2023-03-31 10:15:45 +01:00
Bjoern A. Zeeb
3f0083c4e3 LinuxKPI: 802.11: use ic_printf more consistently
Rather than printing ic_name ourselves (or not at all) use ic_printf()
as a common function from net80211 where possible.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-03-31 07:14:32 +00:00
Juraj Lutter
c322cf0f48 committers-ports.dot: Fix double space
Fix double space in pgollucci's entry.

Approved by:		fernape
Differential Revision:	https://reviews.freebsd.org/D39345
2023-03-31 09:02:19 +02:00
Corvin Köhne
d3e03d235e
bhyve: scan PCI device functions to find host LPC
At least on some AMD devices the host LPC bridge could be located as
seperate function of another PCI device.

Fixes:			f4ceaff56d
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39310
2023-03-31 08:00:06 +02:00
Cheng Cui
134ced89c4
Add myself (cc) as a src commiter.
Summary: Adding mentor relationships for cc when committing new diffs.

Reviewers: rscheff, tuexen
Subscribers: imp
Reviewed by:    rscheff (mentor), tuexen (mentor)
Approved by:    rscheff (mentor), tuexen (mentor)
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D39342
2023-03-30 16:27:02 -04:00
Mark Johnston
615bf03e33 cap_dns tests: Convert to ATF, avoid failing when lookups don't resolve
The cap_dns tests require Internet access.  Currently they fail when
that's not available, which for CI purposes is undesirable.  Let's
instead skip the tests if none of the non-casper name/addr lookups
succeed.

To that end:
- Convert the tests to ATF so that skipping is easier to implement.
- Break up the tests into separate test cases.
- If one of the system (i.e., non-casper) lookup functions fails, skip
  the test if all of them failed, otherwise fail the tests, since
  partial failure indicates something is flaky and deserves a closer
  look.

Reviewed by:	oshogbo
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39241
2023-03-30 19:36:00 -04:00
Mark Johnston
5d96ca7a30 cap_sysctl tests: Serialize
These tests fail spuriously when run in parallel, since some of them
write a value to a global sysctl, read it back, and expect to see the
written value.  These tests complete quite quickly in any case.

MFC after:	1 week
2023-03-30 19:35:59 -04:00
Mark Johnston
b60600ceeb pf tests: Serialize
These tests reuse jail names and cannot run in parallel.  Until this is
fixed - which is desirable since these takes take a while to run - tell
kyua to serialize them.

MFC after:	1 week
2023-03-30 19:35:59 -04:00
Mark Johnston
196f390121 if_ovpn tests: Serialize
These tests reuse jail names and so cannot run in parallel.

MFC after:	1 week
2023-03-30 19:35:59 -04:00
Mark Johnston
34b696e412 acl tests: Serialize
Some of these tests import a ZFS pool with a hard-coded name, so they
cannot run in parallel.

MFC after:	1 week
2023-03-30 19:35:59 -04:00
Mark Johnston
9cefc0fb13 aio tests: Use unique names for zvols
Otherwise tests which create zvols cannot be run in parallel.

MFC after:	1 week
2023-03-30 19:35:59 -04:00
Mark Johnston
cdb192434c netpfil tests: Serialize
These tests reuse jail names and so cannot run in parallel.

MFC after:	1 week
2023-03-30 19:35:59 -04:00
Ed Maste
d33cdf16df fs/cd9660: add header include guards
Diff reduction against NetBSD files in sys/fs/cd9660/ and OpenBSD files
in usr.sbin/makefs/cd9660/.

Sponsored by:	The FreeBSD Foundation
2023-03-30 19:20:54 -04:00
Konstantin Belousov
7170774e2a ifcapnv: cap_bit in ifcap2_nv_bit_names[] is bit, not index
Sponsored by:	Nvidia networking
2023-03-31 02:08:15 +03:00
Joseph Mingrone
512c553671
tcpdump: Backport a fix required for upcoming libpcap update
See also:	51f9c3b947
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2023-03-30 19:52:10 -03:00
John Baldwin
47d1e67874 sys: Disable errors for -Wunused-function on GCC.
This matches the handling of this warning on clang.
2023-03-30 15:43:48 -07:00
Ed Maste
f0bef3d20e makefs: #define Apple Partition bits
NetBSD defines these in sys/bootblock.h, which we don't have.  Add local
defintions in cd9660_eltorito.c (as OpenBSD did) to reduce diffs between
the three makefs implementations.

Obtained from:	OpenBSD
Sponsored by:	The FreeBSD Foundation
2023-03-30 18:27:30 -04:00
John Baldwin
a827077e01 Add libcap_netdb.so.1 to the list of libcasper helper libraries.
Reported by:	Yuri <yuri@aetern.org>
Fixes:		7d8e1e8dd9 libcasper: Move helper libraries from /lib/casper to /lib.
2023-03-30 14:54:48 -07:00
Navdeep Parhar
21b778fbeb cxgbe(4): Remove dead code.
Fixes:	e7e0844422 cxgbe(4): Replace T4_PKT_TIMESTAMP with something slightly less hackish.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2023-03-30 14:13:07 -07:00
Joseph Mingrone
0c59e0b4e5
pflogd: Do not access obsolete structure member pcap.tzoff
This change is in preparation for a libpcap update.

See also:	d4d65e7c4c
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2023-03-30 15:58:45 -03:00
Mark Johnston
889b5662ce fdgrowtable tests: Address a set-but-not-used warning
MFC after:	1 week
2023-03-30 13:55:06 -04:00
Mark Johnston
5ea1e35d7d ktls tests: Populate sockaddr fields before binding
Reported by:	Jenkins
Fixes:		b4b33821fa ("ktls: Fix interlocking between ktls_enable_rx() and listen(2)")
2023-03-30 13:52:04 -04:00
Mark Johnston
fd02d0bc14 graid3: Pre-allocate the timeout event structure
As in commit 2f1cfb7f63 ("gmirror: Pre-allocate the timeout event
structure"), graid3 must avoid M_WAITOK allocations in callout handlers.

Reported by:	graid3 regression tests
MFC after	2 weeks
2023-03-30 13:38:15 -04:00
Ed Maste
efe6a1574e makefs: correct "filname" typo
Obtained from:	NetBSD cd9660.c r1.58
2023-03-30 12:21:26 -04:00
Ed Maste
30da840c62 memmem: add a note about other systems which have memmem
memmem started as a GNU extension but is now widely available.

Reviewed by:	mhorne (slightly earlier version)
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39337
2023-03-30 12:14:26 -04:00
Corvin Köhne
e37edc91b6
bhyve: return EEXIST when adding a fwcfg item twice
Reviewed by:		rew
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39338
2023-03-30 18:10:31 +02:00
Ed Maste
52c68e1625 makefs: Whitespace cleanup to sync with NetBSD 2023-03-30 11:45:13 -04:00
Hans Petter Selasky
4c6bcffd04 libusb(3): Implement libusb_init_context() and the needed structures and definitions.
Differential Revision:	https://reviews.freebsd.org/D38212
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2023-03-30 17:26:55 +02:00
Fernando Apesteguía
463c88e634 committers-ports.dot: Use gj@ last commit date
Use the date of the last commit from gj@ (d276a4dfa6f5f3711808eff44ff20a92114b4d6e)
Note that for other developers the date is that when the commit bit was taken
in.
2023-03-30 17:18:30 +02:00
Fernando Apesteguía
d56bea401b committers-ports.dot: Fix alexbl entry and add gj
Reported by:	garyj@gmx.de yuri@aetern.org
2023-03-30 16:55:22 +02:00
Mark Johnston
cab1056105 kdb: Modify securelevel policy
Currently, sysctls which enable KDB in some way are flagged with
CTLFLAG_SECURE, meaning that you can't modify them if securelevel > 0.
This is so that KDB cannot be used to lower a running system's
securelevel, see commit 3d7618d8bf.  However, the newer mac_ddb(4)
restricts DDB operations which could be abused to lower securelevel
while retaining some ability to gather useful debugging information.

To enable the use of KDB (specifically, DDB) on systems with a raised
securelevel, change the KDB sysctl policy: rather than relying on
CTLFLAG_SECURE, add a check of the current securelevel to kdb_trap().
If the securelevel is raised, only pass control to the backend if MAC
specifically grants access; otherwise simply check to see if mac_ddb
vetoes the request, as before.

Add a new secure sysctl, debug.kdb.enter_securelevel, to override this
behaviour.  That is, the sysctl lets one enter a KDB backend even with a
raised securelevel, so long as it is set before the securelevel is
raised.

Reviewed by:	mhorne, stevek
MFC after:	1 month
Sponsored by:	Juniper Networks
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37122
2023-03-30 10:45:00 -04:00
Ed Maste
45e405603b makefs: do not pass mode to open() call lacking O_CREAT
Obtained from:	OpenBSD ffs.c 1.35
2023-03-30 09:20:00 -04:00
Ed Maste
cc4adc4c4e makefs: remove vestigial '?' cases from top-level getopt(3) loop
getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument.  We can
handle this case with the "default" failure case with no loss of
legibility.

Obtained from:	OpenBSD makefs.c 1.22
2023-03-30 09:20:00 -04:00
Fernando Apesteguía
a2d2f25dd4 committers-ports.dot: Fix alexbl entry
Copy-paste error.

Reported by:	dchagin
Fixes:		5faf90050e
2023-03-30 14:46:47 +02:00
Fernando Apesteguía
5faf90050e committers-ports.dot: Bring file up to date.
Many listed committers are actually alumni.

Related to this change: 52f5764598

Approved by:		bcr@
Differential Revision:	https://reviews.freebsd.org/D39340
2023-03-30 14:17:10 +02:00
Corvin Köhne
4046899086
bhyve: remove unnecessary const qualifier in acpi_device.h
Those const qualifier declare that the function doesn't change the
values internally. It makes no sense to add them in the header file.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39318
2023-03-30 13:05:15 +02:00
Alexander V. Chernikov
b755f1a009 netlink: Fix adding routes with nexthops on p2p interfaces.
Use full-featured ifa_ifwithroute() to guess route ifa/ifp
 instead of ifa_ifwithnet(). This change makes the route addition
 logic closer to the rt_getifa_fib() used by rtsock.

Reported by:	glebius
Tested by:	glebius
Differential Revision: https://reviews.freebsd.org/D39335
MFC after:	2 weeks
2023-03-30 09:53:50 +00:00
Alexander V. Chernikov
140ddeba08 route: try to autoload netlink(4) module if not present in the kernel.
Differential Revision: https://reviews.freebsd.org/D39324
2023-03-30 09:53:06 +00:00
Mateusz Guzik
f5a365e51f inet6: protect address manipulation with a lock
This is a total hack/bare minimum which follows inet4.

Otherwise 2 threads removing the same address can easily crash.

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39317
2023-03-30 08:46:38 +00:00
Fernando Apesteguía
52f5764598 committers-doc.dot: bring file up to date
Long due task. Many developers should be in alumni by now.

Approved by:	docs (bcr, carlavilla)
Differential Revision:	D39309
2023-03-30 09:46:56 +02:00
Mark Johnston
0ec03c0b10 cross-build: Add secure_getenv() for MacOS cross builds
Reviewed by:	arichardson
Fixes:		68ca8363c7 ("libc: Use secure_getenv(3) where appropriate")
Differential Revision:	https://reviews.freebsd.org/D39295
2023-03-30 00:54:13 -04:00
Kirk McKusick
fe5e6e2cc5 Improvement in UFS/FFS directory placement when doing mkdir(2).
The algorithm for laying out new directories was devised in the 1980s
and markedly improved the performance of the filesystem. In those days
large disks had at most 100 cylinder groups and often as few as 10-20.
Modern multi-terrabyte disks have thousands of cylinder groups. The
original algorithm does not handle these large sizes well. This change
attempts to expand the scope of the original algorithm to work well
with these much larger disks while still retaining the properties
of the original algorithm for small disks.

The filesystem implementation is divided into policy routines and
implementation routines. The policy routines can be changed in any
way desired without risk of corrupting the filesystem. The policy
requests are handled by the implementation layer. If the policy
asks for an available resource, it is granted. But if it asks for
an already in-use resource, then the implementation will provide
an available one nearby the request. Thus it is impossible for a
policy to double allocate. This change is limited to the policy
implementation.

This change updates the ffs_dirpref() routine which is responsible
for selecting the cylinder group into which a new directory should
be placed. If we are near the root of the filesystem we aim to
spread them out as much as possible. As we descend deeper from the
root we cluster them closer together around their parent as we
expect them to be more closely interactive. Higher-level directories
like usr/src/sys and usr/src/bin should be separated while the
directories in these areas are more likely to be accessed together
so should be closer. And directories within commands or kernel
subsystems should be closer still.

We pick a range of cylinder groups around the cylinder group of the
directory in which we are being created. The size of the range for
our search is based on our depth from the root of our filesystem.
We then probe that range based on how many directories are already
present. The first new directory is at 1/2 (middle) of the range;
the second is in the first 1/4 of the range, then at 3/4, 1/8, 3/8,
5/8, 7/8, 1/16, 3/16, 5/16, etc.

It is desirable to store the depth of a directory in its on-disk
inode so that it is available when we need it. We add a new field
di_dirdepth to track the depth of each directory. Because there are
few spare fields left in the inode, we choose to share an existing
field in the inode rather than having one of our own. Specifically
we create a union with the di_freelink field. The di_freelink field
is used to track inodes that have been unlinked but remain referenced.
It is not needed until a rmdir(2) operation has been done on a
directory. At that point, the directory has no contents and even
if it is kept active as a current directory is no longer able to
have any new directories or files created in it. Thus the use of
di_dirdepth and di_freelink will never coincide.

Reported by:  Timo Voelker
Reviewed by:  kib
Tested by:    Peter Holm
MFC after:    2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39246
2023-03-29 21:13:27 -07:00
Ed Maste
1fb7d2cf99 makefs: spelling
Obtained from:	OpenBSD msdosfs_fat.c 1.7
2023-03-29 21:48:14 -04:00
Ed Maste
9faa27f263 ssh: update FREEBSD-upgrade for upstream CheckHostIP default change
We changed the CheckHostIP default to "no" years ago.  Upstream has now
made the same change, so do not list it as a local change any longer.

I did not just remove the "Modified client-side defaults" section to
avoid having to renumber everything, and we may add a new local change
in the future.

Sponsored by:	The FreeBSD Foundation
2023-03-29 19:32:44 -04:00