Commit Graph

285093 Commits

Author SHA1 Message Date
Glen Barber
cd8cad0ef5 release: follow-up to previous commit to install lang/python{,3}
PR:		272354
Sponsored by:	GoFundMe https://www.gofundme.com/f/gjbbsd
2023-07-12 16:49:53 -04:00
Glen Barber
0ed426276f release: ensure gce-check-depends installs lang/python{,3}
PR:		272354
Sponsored by:	GoFundMe https://www.gofundme.com/f/gjbbsd
2023-07-12 16:08:40 -04:00
Kajetan Staszkiewicz
f2064dd1f1 pf: Fix duplicate storage of direction
The variable storing the direction of a processed packet is passed
around to many functions. Most of those functions already have a pointer
to struct pf_pdesc which also contains the direction. By using the one
in struct pf_pdesc we can reduce the amount of arguments passed around.

Reviewed by:	kp
Sponsored by:	InnGames GmbH
Differential Revision:	https://reviews.freebsd.org/D41008
2023-07-12 18:05:47 +02:00
Yufeng Zhou
294c52d969 amd64 pmap: Fix compilation when superpage reservations are disabled
The function pmap_pde_ept_executable() should not be conditionally
compiled based on VM_NRESERVLEVEL. It is required indirectly by
pmap_enter(..., psind=1) even when reservation-based allocation is
disabled at compile time.

Reviewed by:	alc
MFC after:	1 week
2023-07-12 12:07:42 -05:00
Gleb Smirnoff
0d1ff2b04d vmm: don't leak locks exiting vmmdev_ioctl()
At least an error from vcpu_lock_all() at line 553 would leak
memseg lock.  There might be other cases as well.

Reviewed by:		corvink, markj
Differential Revision:	https://reviews.freebsd.org/D40981
2023-07-12 09:16:40 -07:00
Gleb Smirnoff
30f0328a32 vmm: don't return random error from vcpu_lock_all() if vcpu is empty
When vcpu array is empty, function would return random value from
stack.  What I observed was -1.

Reviewed by:		corvink, markj
Differential Revision:	https://reviews.freebsd.org/D40980
2023-07-12 09:16:40 -07:00
Eric van Gyzen
dad11f990e dtrace: prevent forked child from running after an error condition
The pid/killonerror test uses an invalid probe specifier to verify that
the child process is killed.  It occasionally fails because the "date"
command is allowed to run long enough to print the date.  This is harmless
in this case, but is clearly not ideal.

When the dt_proc_control thread is about to exit, and the dtrace command
forked the child, do not make the child runnable.

Reviewed by:	markj
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D40976
2023-07-12 10:33:28 -05:00
Kristof Provost
df56c8069a pf: fix error descriptions in the man page
PR:		272459
Submitted by:	alex@inferiorhumanorgans.com
MFC after:	1 week
2023-07-12 13:17:14 +02:00
Kristof Provost
64b30b7aeb pf: fix pfi_kif definition in the man page
PR:		272455
Submitted by:	alex@inferiorhumanorgans.com
MFC after:	1 week
2023-07-12 11:43:43 +02:00
Jessica Clarke
3a46fe2261 getlocalbase: Make default path actually configurable
We include paths.h in getlocalbase.c, which defines _PATH_LOCALBASE.
This will override a definition on the command line, meaning it is
impossible to override like how the manpage says you can, and it means
the code to provide a fallback default is dead as the macro is always
defined.

Instead, introduce a new LOCALBASE_PATH macro like LOCALBASE_CTL_LEN
that can be set on the command line and will default to the system's
existing _PATH_LOCALBASE to avoid duplicating the default here.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D40975
2023-07-11 21:49:22 +01:00
Jessica Clarke
d1e44bc944 kmod.mk: Use portable printf '%s' over non-portable echo -n
Whilst /bin/echo on macOS and Linux implement -n, as do the builtin
echos in bash and zsh, the builtin echo in dash does not, causing the
first line of the output to be -n foo rather than just foo, and there to
be an extra newline in the output and thus blank line, both of which
result in "Symbol ... is not present in *.kld" warnings appearing in the
build output (once for -n foo and once for the empty string for each
module where EXPORT_SYMS is a list of symbols).

MFC after:	1 week
2023-07-11 21:30:06 +01:00
Mark Johnston
0dea4f064d bhyve: Deduplicate some code in modify_bar_registration()
No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	1 week
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D40877
2023-07-11 15:22:37 -04:00
Jessica Clarke
bfc47586ac getlocalbase.3: Fix AUTHORS formatting
MFC after:	1 week
2023-07-11 18:50:32 +01:00
Jessica Clarke
f8cabe5550 libutil: Delete trailing whitespace 2023-07-11 18:45:23 +01:00
Piotr Kubaj
5ddb1aa305 ix, ixv: fix kernel build
struct adapter was renamed to struct sc.

Reported by: FreeBSD User <freebsd@walstatt-de.de>
2023-07-11 19:41:26 +02:00
Piotr Kubaj
6ad2a9a64f ix: remove stale comment
Reported by:	Navdeep Parhar
2023-07-11 18:45:04 +02:00
Piotr Pietruszewski
a0302c9231 ix, ixv: Update link status with autonegotiated baudrate value
Use autonegotiated link speed value while updating link status
to iflib.

This patch is part of change made in NetBSD kernel
by Masanobu Saitoh, NetBSD maintainer.

Differential Revision:	https://reviews.freebsd.org/D19176
Approved by:	erj
2023-07-11 18:14:26 +02:00
Kristof Provost
66f2f9ee08 ipfw: teach ipfw that pfsync is an upper layer protocol
Explicitly add pfsync as a know upper layer protocol so we don't
automatically discard pfsync packets (carried over IPv6).

net.inet6.ip6.fw.deny_unknown_exthdrs defaults to 1, so even if
net.inet.ip.fw.default_to_accept is set to 1 we'd discard pfsync (over
IPv6).

Reviewed by:	ae
Differential Revision:	https://reviews.freebsd.org/D40973
2023-07-11 14:59:08 +02:00
Dmitry Chagin
d744a37a3a csu: Implement _start using as to satisfy unwinders on i386
The right unwinding stop indicator should be CFI-undefined PC.
https://dwarfstd.org/doc/Dwarf3.pdf - page 118:
If a Return Address register is defined in the virtual unwind table,
and its rule is undefined (for example, by DW_CFA_undefined), then
there is no return address and no call address, and the virtual
unwind of stack activations is complete.

The hack localizing _start1 symbol removed.

Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D40624
2023-07-11 15:12:01 +03:00
Dmitry Chagin
d7e2580a14 csu: Add the prologue and epilogue to the _init and _fini on i386
Normally, modern unwinders uses Dwarf information to unwind stack,
however in case when the code is not annotated by Dwarf instructions,
unwinders fallbacks to a frame-pointer based algorithm.

That is allows libunwind to unwind stack from global constructors and
destructors. Also it makes gdb happy as it printed nonexistent frame
before.

Reviewed by:		kib, imp
Differential Revision:	https://reviews.freebsd.org/D40948
2023-07-11 15:11:22 +03:00
Dmitry Chagin
e541cf8316 rtld: Annotate .rtld_start on i386
Add a stop indicator to rtld_start to satisfy unwinders:
The right unwinding stop indicator should be CFI-undefined PC.
https://dwarfstd.org/doc/Dwarf3.pdf - page 118:
If a Return Address register is defined in the virtual unwind table,
and its rule is undefined (for example, by DW_CFA_undefined), then
there is no return address and no call address, and the virtual
unwind of stack activations is complete.

That is allows gdb and libunwind successfully stop when unwinding stack
from global constructors and destructors.

Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D40949
2023-07-11 15:10:32 +03:00
Dmitry Chagin
86c63225ea rtld: Microoptimize rtld_start on i386
Initial stack pointer is preserved in calle-saved %esi,
use it bellow to pass initial stack pointer to _rtld().

Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D40950
2023-07-11 15:10:08 +03:00
Peter Holm
972e60da74 stress2: Added two syzkaller reproducers 2023-07-11 10:24:19 +02:00
Kyle Evans
5d0826017f libbe: promote activated BEs all the way
This matches the beadm behavior; generally, we need to keep promoting
until the BE is no longer a clone from a snapshot.  This fixes scenarios
where the dataset associated with a BE's origin is itself a clone,
activating the BE previously would promote it to a clone of the origin's
origin.

We could keep using be_get_dataset_props here, except for two
annoyances:

1.) I couldn't find a clean way to just clear an nvlist rather than
    having to re-alloc it, and I didn't want to just remove the one prop
    we're inspecting out of it.

2.) That's a lot of overhead when all we want to do is fetch the origin
    anyways.

Note that this is not a complete fix, but it does fix the majority of
cases; deep BE subordinates are still notably broken, pending a patch
from Christian.

Reported by:	R. Christian McDonald <rcm@rcm.sh>
Reviewed by:	rew
Differential Revision:	https://reviews.freebsd.org/D40903
2023-07-11 00:44:13 -05:00
Peter Grehan
43ed91e00b igc: Increase default per-queue interrupt rate to 20000.
The default per-queue packet rate of 8000 will cause packet loss when
forwarding at 2.5G with a single stream, as is common when using e.g.
iperf3 to test a platform.

Bump this to 20000 (the "low latency" value in the Linux driver) which
avoids packet loss for this type of test.

Future work will use adaptive interrupt rate in a similar fashion
to the ixgbe driver.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Reviewed by:	erj, kp
MFC after:	3 weeks
Differential Revision: https://reviews.freebsd.org/D40904
2023-07-11 13:29:37 +10:00
Jessica Clarke
1ec7cb1b5d depend-cleanup: Add verbose (-v) and pretend/dry-run (-n) flags
These are useful for testing new additions to the script. Whilst here,
harden the script a little and improve error messages.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D31007
2023-07-11 01:53:04 +01:00
Jessica Clarke
c70dd03a7f Make sure MACHINE(_ARCH) are exported for depend-cleanup.sh
We run depend-cleanup.sh twice during the build. The second time is the
normal run, where we run it under WMAKEENV and thus have CROSSENV's
MACHINE(_ARCH)=${TARGET(_ARCH)} in the environment. However, the first
time is for bootstrap-tools, where it's run under BMAKEENV and we don't
have any assignments to MACHINE(_ARCH) in the environment, meaning the
script sees them as unset. In practice this doesn't matter since the
only use doesn't apply to bootstrap-tools, but it could be a future
issue. Thus, explicitly export them for depend-cleanup.sh and have the
script verify they're set.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D40968
2023-07-11 01:53:04 +01:00
Konstantin Belousov
565a343ae3 sigqueue_delete_set_proc(): initialize sq_proc for worklist
This should fix leaks for the p_killpg_cnt counter, because
sigqueue_flush() drops ksi's.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-07-11 03:52:16 +03:00
Konstantin Belousov
7e4c6b2163 msdosfs: zero partially valid extended cluster
It contains arbitrary garbage, which is not cleared by vfs_bio_clrbuf()
which only zeroes invalid portions of the pages.

Reported by:	Maxim Suhanov <dfirblog@gmail.com>
Discussed with:	so
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-07-11 03:49:09 +03:00
Jessica Clarke
f3674213e3 depend-cleanup.sh: Fix whitespace
Fixes:	45c4ff15e3 ("depend-cleanup.sh: Handle libc bcmp.S moving to bcmp.c on amd64.")
2023-07-11 00:18:15 +01:00
Dimitry Andric
ce4846ae75 depend-cleanup.sh: cleanup stale ffs.S dependencies for arm and i386
Now that depend-cleanup.sh handles 32-bit dependencies a bit better, get
rid of the stale ffs.S ones, otherwise an incremental build on amd64
will fail with:

  cc: error: no such file or directory: '/usr/src/lib/libc/i386/string/ffs.S'

Fixes:		ee8b0c436d
2023-07-11 00:57:33 +02:00
Dimitry Andric
7ba8cc9b7b depend-cleanup.sh: handle 32-bit dependencies having no 64-bit equivalent
For example with the recent removal of ffs.S for 32-bit arm and i386,
the egrep in clean_dep() did not find any files to remove, even if you
added a "clean_dep lib/libc ffs S" line. This is because it will never
find the ffs.S filename in the 64-bit .depend files for libc.

Split the searching and removing of 32-bit dependencies and objects into
a separate part to cope with this. This can be used similarly later on,
for other bitnesses.

MFC after:	3 days
2023-07-11 00:57:33 +02:00
Alan Somers
dba2e89ea7 Multiple fixes to the zfsd test suite
* Wait for gnop devices to disappear after "gnop destroy".

  Apparently that process is asynchronous now, or maybe it's just slower
  than it used to be.  Also, after removing a gnop wait for its pool to
  be degraded.  That isn't instant.

* The zfsd tests no longer require camcontrol.

  This was a harmless oversight from
  11ed0a95bf

* Fix the zfsd_degrade_001_pos test for recent zfs versions.

  ZFS now rate limits checksum errors to about 20 per second.  But
  zfsd's threshold for degrading a disk is 50 per minute.  So we must
  alternately corrupt and scrub the pool to ensure that checksum errors
  are generated in multiple 1-second windows, so that zfsd will see
  enough of them.

* Fix the zfsd_fault_001_pos test in VMs

  And, for that matter, when using NVME or SATA disks.  As originally
  written, the test used the da driver to inject errors.  Rewrite it to
  use gnop vdevs.  gnop can also inject errors.  It works on top of any
  disk device, and it's also faster than using da.

MFC after:	2 weeks
Sponsored by:	Axcient
Differential Revision: https://reviews.freebsd.org/D39437
2023-07-10 16:36:57 -06:00
Alan Somers
92642bba4d zfsd: listen for sysevent.fs.zfs instead of misc.fs.zfs
At some point the names of these devd events changed.  Probably it
happened when importing OpenZFS.  Before that, FreeBSD's sysevent_alloc
method didn't create a "class" nvpair in the event, which led to
log_sysevent using the event's ev_subclass field as its type.

MFC after:	2 weeks
Sponsored by:	Axcient
Differential Revision: https://reviews.freebsd.org/D39437
2023-07-10 16:36:57 -06:00
Colin Percival
7acb53817f release: Add code to make FreeBSD/Firecracker
This just stages the kernel and builds a stripped-down rootfs for use
with the Firecracker VMM.  At some point in the future the release
engineering team might start publishing these, but initially it's
just here to simplify FreeBSD/Firecracker development and testing.

Note that the rootfs generated:
* Uses an IP address of 10.0.0.2 with a gateway of 10.0.0.1,
* Has sshd enabled,
* Has user "freebsd" with password "freebsd" and a root password
  of "root", and
* Is 1 GB in size (but has growfs enabled).

All of those are subject to change without notice; anyone intending to
use FreeBSD/Firecracker in anything remotely resembling a production
environment should talk to cperciva first.

Reviewed by:	gjb
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D40956
2023-07-10 15:19:33 -07:00
Eric van Gyzen
eb8d2e123d dhclient: fix build on i386
Only i386 still uses a 32-bit time_t.  I knew this, and I still failed
to compile-test on i386.  My bad.

Reported by:	cy
Fixes:		c210cac00f ("dhclient: fix time parsing for leases...")
Sponsored by:	Dell EMC Isilon
2023-07-10 15:03:39 -05:00
WuerfelDev
46f59593c5 CONTRIBUTING.md: reinsert double spaces
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/788
2023-07-10 12:24:24 -06:00
Mitchell Horne
f7a2170606 pmc_events.h: update top-level comment
It points to non-existent documentation. The wiki page still contains a
useful overview, so keep this link.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2023-07-10 14:32:27 -03:00
Mitchell Horne
a5b3e56330 pmcstat(8): Drop .Ud
This utility has existed for a long time and should not be advertised as
"currently under development".

While here, fix the one other warning from igor about using a newline
for a new sentence.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2023-07-10 14:30:03 -03:00
Mitchell Horne
398fb4a592 pmclog(3): Drop .Ud
This API is stable and should not be advertised as "currently under
development".

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2023-07-10 14:30:03 -03:00
Alex Bahm
c210cac00f dhclient: fix time parsing for leases expiring after 2038
Convert lease parsing to timegm to calculate timestamp. For reference, when
writing the lease, we use gmtime to convert the timestamp to struct tm.

Reviewed By:	markj, vangyzen
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D40760
2023-07-10 11:00:34 -05:00
Alan Somers
6c049996ec During F_SETFL, don't change file flags on error
Previously, even if the FIONBIO or FIOASYNC ioctl failed, the file's
f_flags variable would still be changed.  Now, kern_fcntl will restore
the original flags if the ioctl fails.

PR:		265736
Reported by:	Yuval Pavel Zholkover <paulzhol@gmail.com>
MFC after:	2 weeks
Reviewed by:	kib
Differential Revision: https://reviews.freebsd.org/D40955
2023-07-10 08:13:58 -06:00
Mitchell Horne
8ab2da6828 Remove GCC 4.2 include dirs
These are present (and empty) on a system installed post-GCC removal.

Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D40878
2023-07-10 10:16:13 -03:00
Doug Moore
16e01c05c0 radix_trie: avoid code duplication in insert
Two cases in the insert routine are written differently, when
they're really doing the same thing. Writing that case only once
saves 208 bytes in the compiled vm_radix_insert code and reduces
instructions executed by about 2%.
Reviewed by:	alc
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D40807
2023-07-09 15:06:02 -05:00
Mitchell Horne
89240e0ab6 hwpmc(4): update DEBUGGING section details
The examples I wrote previously do not work. We parse the flags using
explicit names, not the shortened flag suffix. Fix the list of major
flags, and add a compact list of minor flags. Fix the examples, and
tweak some wording for clarity.

Reviewed by:	jkoshy, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Fixes:		5fc97cc325 ("hwpmc(4): document debugging options")
Differential Revision:	https://reviews.freebsd.org/D40913
2023-07-09 16:03:54 -03:00
Jessica Clarke
076a4dc59b rtld-elf: Remove _PATH_ELF32_HINTS and _COMPAT32_PATH_RTLD
These are no longer referenced, with the one user of each now using the
double-underscore version with "32" as an argument instead.

Reviewed by:	kib, brooks, jhb
Differential Revision:	https://reviews.freebsd.org/D40935
2023-07-09 18:50:30 +01:00
Jessica Clarke
e17dd921a2 ldd: Use __PATH_RTLD("32") over _COMPAT32_PATH_RTLD
This will allow the latter to be removed, reducing the boilerplate
needed for a new libcompat.

Reviewed by:	kib, brooks, jhb
Differential Revision:	https://reviews.freebsd.org/D40934
2023-07-09 18:50:24 +01:00
Jessica Clarke
1e635e87e3 ldconfig: Use __PATH_ELF_HINTS("32") over _PATH_ELF32_HINTS
This will allow the latter to be removed, reducing the boilerplate
needed for a new libcompat.

Reviewed by:	kib, brooks, jhb
Differential Revision:	https://reviews.freebsd.org/D40933
2023-07-09 18:50:15 +01:00
Jessica Clarke
1840dc06e1 bsd.compat.mk: Remove obsolete COMPAT_32BIT now it's unused
See commit 8fad2cda93 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by:	emaste, brooks, jhb
Differential Revision:	https://reviews.freebsd.org/D40932
2023-07-09 18:50:03 +01:00
Jessica Clarke
3864bd4fd2 lib: Migrate from COMPAT_32BIT to generic COMPAT_LIBCOMPAT
In the process, delete a COMPAT_SOFTFP remnant that was missed in
previous sweeps.

See commit 8fad2cda93 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by:	emaste, brooks, jhb
Differential Revision:	https://reviews.freebsd.org/D40931
2023-07-09 18:49:53 +01:00