]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 months agopw: Add regression tests for useradd bug fixes
Naman Sood [Wed, 19 Jul 2023 13:27:14 +0000 (10:27 -0300)]
pw: Add regression tests for useradd bug fixes

PR: 238995
Reviewed by: jrm
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41080

12 months agopw: Use existing group entry, even if it already has members
Naman Sood [Wed, 19 Jul 2023 13:06:06 +0000 (10:06 -0300)]
pw: Use existing group entry, even if it already has members

Fix the following problem:

1. A nonexistent user, someuser, is added to /etc/group as
   someuser:*:12345:someuser.
2. someuser is then created with the default login group.

A second group entry for someuser will be created.

   someuser:*:12345:someuser
   someuser:*:12346:

With this fix, the existing group entry will be used.

PR: 238995
Reviewed by: bapt, jrm
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41057

12 months agopw: Ensure group membership is not duplicated
Naman Sood [Wed, 19 Jul 2023 12:44:21 +0000 (09:44 -0300)]
pw: Ensure group membership is not duplicated

Fix the following problem:

1. A nonexistent user, someuser, is added to somegroup in /etc/group.
2. someuser is then created with membership in somegroup.

The entry for somegroup in /etc/group will then contain

    somegroup:*:12345:someuser,someuser

With this fix, the entry will be

    somegroup:*:12345:someuser

PR: 238995
Reviewed by: bapt, jrm
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41076

12 months agotcp: improve layout of struct tcpcb
Michael Tuexen [Wed, 19 Jul 2023 12:47:36 +0000 (14:47 +0200)]
tcp: improve layout of struct tcpcb

Put optional fields at the end to minimize run time problems in
case CC modules are build from within its directory.

Reviewed by: cc, gallatin, glebius, imp
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D41059

12 months agocam: Move bus_dmamap_load_ccb into cam.c.
John Baldwin [Wed, 19 Jul 2023 01:19:27 +0000 (18:19 -0700)]
cam: Move bus_dmamap_load_ccb into cam.c.

This routine is specific to CAM and no longer assumes any internal
bus_dma knowledge as it is simple wrapper around bus_dmamap_load_mem.

Fixes: 60381fd1ee86 memdesc: Retire MEMDESC_CCB.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D41058

12 months agolinux(4): Use M_LINUX for malloc type of proc emuldata
Dmitry Chagin [Tue, 18 Jul 2023 21:44:17 +0000 (00:44 +0300)]
linux(4): Use M_LINUX for malloc type of proc emuldata

MFC after: 2 weeks

12 months agolinux(4): Use M_LINUX for malloc type in getdents
Dmitry Chagin [Tue, 18 Jul 2023 21:44:16 +0000 (00:44 +0300)]
linux(4): Use M_LINUX for malloc type in getdents

MFC after: 2 weeks

12 months agolinux(4): Use M_LINUX for malloc type in getdents64
Dmitry Chagin [Tue, 18 Jul 2023 21:44:16 +0000 (00:44 +0300)]
linux(4): Use M_LINUX for malloc type in getdents64

MFC after: 2 weeks

12 months agolinux(4): Delete a useless variable in getdents64
Dmitry Chagin [Tue, 18 Jul 2023 21:44:16 +0000 (00:44 +0300)]
linux(4): Delete a useless variable in getdents64

MFC after: 2 weeks

12 months agolinux(4): Use M_LINUX for malloc type in readdir
Dmitry Chagin [Tue, 18 Jul 2023 21:44:15 +0000 (00:44 +0300)]
linux(4): Use M_LINUX for malloc type in readdir

MFC after: 2 weeks

12 months agolinux(4): Delete a useless variable in readdir
Dmitry Chagin [Tue, 18 Jul 2023 21:44:15 +0000 (00:44 +0300)]
linux(4): Delete a useless variable in readdir

MFC after: 2 weeks

12 months agolinux(4): Properly allocate buffer for kern_getdirentries in readdir
Dmitry Chagin [Tue, 18 Jul 2023 21:44:15 +0000 (00:44 +0300)]
linux(4): Properly allocate buffer for kern_getdirentries in readdir

Looks like prior to ino64 project the size of the struct linux_dirent
was greater (or equal) to the size of the native struct dirent so the
native dirent fit into the buffer. After ino64 project the size of the
native struct dirent has increased.

Spotted by gcc12.
MFC after: 2 weeks

12 months agoadd defaults for adduser.sh (OK? [yes] & additional user [no])
Sven Ruediger [Tue, 18 Jul 2023 17:37:48 +0000 (10:37 -0700)]
add defaults for adduser.sh (OK? [yes] & additional user [no])

Event: Kitchener-Waterloo Hackathon 202305
Differential Revision: https://reviews.freebsd.org/D40157

12 months agols: Improve POSIX compatibility for -g and -n.
Minsoo Choo [Tue, 18 Jul 2023 16:49:59 +0000 (09:49 -0700)]
ls: Improve POSIX compatibility for -g and -n.

- Change -g (ignored for BSD 4.3 compatibility since BSD 4.4)
  to use POSIX semantics of implying -l but omitting the owner's
  name.

- Change -n to imply -l.

The -o option remains unchanged (POSIX defines -o as a complement to
-g that implies -l but omits group names whereas BSD defines -o to add
file flags to -l).  This compromise is the same used by both NetBSD
and OpenBSD.

PR: 70813
Reviewed by: jhb, Pau Amma <pauamma@gundo.com>
Co-authored-by: John Baldwin <jhb@FreeBSD.org>
Differential Revision: https://reviews.freebsd.org/D34747

12 months agoopenssh: document a locally-applied workaround
Ed Maste [Tue, 18 Jul 2023 16:23:31 +0000 (12:23 -0400)]
openssh: document a locally-applied workaround

We have a local hacky workaround for an issue caused by a hacky
upstream autoconf test.  Reported upstream on the OpenSSH mailing list:
https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-May/040242.html

PR: 209441
Sponsored by: The FreeBSD Foundation

12 months agozfs: set autotrim default to 'off'
Yuri Pankov [Mon, 17 Jul 2023 09:12:53 +0000 (11:12 +0200)]
zfs: set autotrim default to 'off'

As it turns out having autotrim default to 'on' on FreeBSD never really
worked due to mess with defines where userland and kernel module were
getting different default values (userland was defaulting to 'off',
module was thinking it's 'on').

PR: 264234
Reviewed by: mav (zfs)
Differential Revision: https://reviews.freebsd.org/D41056

12 months agoText format cleanups. No functional changes intended.
Kirk McKusick [Tue, 18 Jul 2023 00:28:07 +0000 (17:28 -0700)]
Text format cleanups. No functional changes intended.

MFC-after:    1 week
Sponsored-by: The FreeBSD Foundation
12 months agorelease: adjust lang/python* dependencies for GCE
Glen Barber [Mon, 17 Jul 2023 20:16:46 +0000 (16:16 -0400)]
release: adjust lang/python* dependencies for GCE

The lang/python3 port had failed to properly install because
it did in fact already exist and FORCE_PKG_REGISTER was not
set.  So, behaviorally everything here was correct.  However,
installing lang/python3 is in fact not correct and not needed,
so only install the lang/python port to provide symbolic links.

PR: 272354
MFC after: 3 days
MFC with: 510fd83138001b0a6e45b3fa6a7249377f806171
MFC with: cd8cad0ef5cd534dc7ae1dd9a470cac2057ed957
MFC with: 0ed426276fd52e917506ab87c05a61c6641ae298
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd

12 months agolibbe: recursively promote deep BE datasets
R. Christian McDonald [Mon, 17 Jul 2023 19:06:28 +0000 (14:06 -0500)]
libbe: recursively promote deep BE datasets

beadm will recursively promote deep BE datasets. In order to match the
beadm behavior, we need to recursively iterate over child filesystems
and promote them along the way.

This patch further refines the work from D40903, completing the fix for
promotion.

Reviewed by: kevans, rew
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D40972

12 months agokern.post.mk allow NEWVERS_{ENV,ARGS}
Simon J. Gerraty [Mon, 17 Jul 2023 19:03:35 +0000 (12:03 -0700)]
kern.post.mk allow NEWVERS_{ENV,ARGS}

Allow makefiles better control of newvers.sh env and args.
Also allow variable overrides on command line.

Reviewed by: imp, stevek
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D41012

12 months agotcbpcb: Always define t_osd
Warner Losh [Mon, 17 Jul 2023 17:22:45 +0000 (11:22 -0600)]
tcbpcb: Always define t_osd

Always define t_osd. congestion control modules access it
unconditionally. This fixes the build.

However, this is, at best, a temporary band-aide until the
larger issues are sorted.

Sponsored by: Netflix

12 months agobhyve: Remove an unneeded vm_get_register() call in main()
Mark Johnston [Wed, 5 Jul 2023 20:59:20 +0000 (16:59 -0400)]
bhyve: Remove an unneeded vm_get_register() call in main()

At one point the RIP value was passed to fbsdrun_addcpu(), but this is
no longer the case.  No functional change intended.

Reviewed by: jhb, corvink
Sponsored by: Innovate UK
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40988

12 months agobhyve: Fix whitespace in bhyverun.c
Mark Johnston [Mon, 17 Jul 2023 15:11:20 +0000 (11:11 -0400)]
bhyve: Fix whitespace in bhyverun.c

No functional change intended.

MFC after: 1 week

12 months agostyle.Makefile.5: Wordsmith .PATH description
Mateusz Piotrowski [Mon, 17 Jul 2023 13:06:02 +0000 (15:06 +0200)]
style.Makefile.5: Wordsmith .PATH description

MFC after: 3 days
Fixes: 1ac5586c6d86 style.Makefile.5: Do not require $FreeBSD$ SCM IDs

12 months agostyle.Makefile.5: Remove $FreeBSD$ from examples
Mateusz Piotrowski [Mon, 17 Jul 2023 13:01:52 +0000 (15:01 +0200)]
style.Makefile.5: Remove $FreeBSD$ from examples

MFC after: 3 days

12 months agostyle.Makefile.5: Stop documenting NO_MAN
Mateusz Piotrowski [Mon, 17 Jul 2023 12:50:33 +0000 (14:50 +0200)]
style.Makefile.5: Stop documenting NO_MAN

NO_MAN has been an error since 2020 according to UPDATING.

PR: 231357
MFC after: 3 days

12 months agolibm: correctly test for for NaN and Infinity in sinpi(), cospi(), and tanpi()
Steve Kargl [Mon, 17 Jul 2023 05:19:28 +0000 (08:19 +0300)]
libm: correctly test for for NaN and Infinity in sinpi(), cospi(), and tanpi()

The current versions of lib/msun/src/s_cospi.c, s_sinpi.c and s_tanpi.c
all exhibit the same defect. After checking for various numeric ranges,
they check to see whether the input argument is a NaN or an Infinity.
However, the code uses a value of 0x7f80000 instead of the correct value
of 0x7ff00000.

If you review s_cospif.c, s_sinpif.c, and s_tanpif.c, you will see that
the equivalent statements in these functions are accurate and have
appropriate source comments.

The impact of these defects is to flag some valid input values as
invalid and raise a pole error (divide by zero).

Reported by: Paul Green <Paul.Green@stratus.com>
PR: 272539
MFC after: 1 week

12 months agoriscv pmap: another vm_radix_init
Doug Moore [Sun, 16 Jul 2023 20:48:43 +0000 (15:48 -0500)]
riscv pmap: another vm_radix_init

pmap_pinit0 also needs to initialize a vm_radix, in case vm_radix_init
does anything but zeroing fields.

Reported by: alc
Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D41055

12 months agoMerge commit 8757ce490130 from llvm-project (by Simon Pilgrim):
Dimitry Andric [Sun, 16 Jul 2023 18:45:29 +0000 (20:45 +0200)]
Merge commit 8757ce490130 from llvm-project (by Simon Pilgrim):

    [PowerPC] Replace PPCISD::VABSD cases with generic ISD::ABDU(X,Y) node

    A move towards using the generic ISD::ABDU nodes on more backends

    Also support ISD::ABDS for v4i32 types using the existing signbit flip trick

    PowerPC has a select(icmp_ugt(x,y),sub(x,y),sub(y,x)) -> abdu(x,y) combine that I intend to move to DAGCombiner in a future patch.

    The ABS(SUB(X,Y)) -> PPCISD::VABSD(X,Y,1) v4i32 combine wasn't legal (https://alive2.llvm.org/ce/z/jc2hLU) - so I've removed it, having already added the legal sub nsw tests equivalent.

    Differential Revision: https://reviews.llvm.org/D142313

This fixes a "Wasn't expecting to be able to lower this!" fatal error
when compiling graphics/opencv for PowerPC.

Requested by: pkubaj
PR: 271047
MFC after: 1 month

12 months agolib/libc/string/bcmp.c: fix integer overflow bug
Robert Clausecker [Wed, 12 Jul 2023 18:23:21 +0000 (20:23 +0200)]
lib/libc/string/bcmp.c: fix integer overflow bug

bcmp() returned the number of remaining bytes when the main loop exits.
In case of a match, this is zero, else a positive integer.  On systems
where SIZE_MAX > INT_MAX, the implicit conversion from size_t to int in
the return value may cause the number of remaining bytes to overflow,
becoming zero and falsely indicating a successful comparison.

Fix the bug by always returning 0 on equality, 1 otherwise.

PR: 272474
Approved by: emaste
Reviewed by: imp
MFC After: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41011

12 months agolibexec/rtld-elf/rtld-libc/Makefile.inc: do not use machdep string functions
Robert Clausecker [Wed, 28 Jun 2023 17:18:15 +0000 (17:18 +0000)]
libexec/rtld-elf/rtld-libc/Makefile.inc: do not use machdep string functions

With ifunc based SIMD dispatch, we cannot use the amd64 assembly
implementations of string functions.  Modify rtld to instead use
the generic functions.  To avoid an architecture-specific special
case, this change is applied to all architectures.

This change is a prerequisite to and formerly part of D40693.

Sponsored by: FreeBSD Foundation
Approved by: kib
See also: D40693
Differential Revision: https://reviews.freebsd.org/D41050

12 months agortld: fix dlopen() for an object that is already mapped but not yet initialized
Konstantin Belousov [Fri, 14 Jul 2023 13:38:03 +0000 (16:38 +0300)]
rtld: fix dlopen() for an object that is already mapped but not yet initialized

For instance, dso might be mapped as needed but not yet initialized from
the other subtree of needed objects, while current object' constructor
does dlopen() for the dso.  Right now rtld does relocations and other
processing based on the arrival of new objects in the global list, which
is not happens there.  Directly check for the initialization state of
the object, for which we would return the handle.

One practical use case of this support is e.g. dlopen("libthr.so",
RTLD_NOLOAD) by libraries that are threading-aware but happy to live
with libc pthread shims if the program is not multithreaded.

Reviewed by: tijl
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

12 months agolibthr: trigger library initialization on rwlock calls
Konstantin Belousov [Thu, 13 Jul 2023 15:56:11 +0000 (18:56 +0300)]
libthr: trigger library initialization on rwlock calls

Reviewed by: tijl
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

12 months agolibthr: some style in thr_rwlock.c
Konstantin Belousov [Thu, 13 Jul 2023 15:55:50 +0000 (18:55 +0300)]
libthr: some style in thr_rwlock.c

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

12 months agoMerge LUA 5.4.6
Warner Losh [Sat, 15 Jul 2023 17:31:04 +0000 (11:31 -0600)]
Merge LUA 5.4.6

This is a bug fix to Lua 5.4.4 (5.4.5 was withdrawn due to ABI issues
and 5.4.6 is 5.4.5 with those fixed).

12 months agolua: Update to 5.4.6
Warner Losh [Sat, 15 Jul 2023 17:25:52 +0000 (11:25 -0600)]
lua: Update to 5.4.6

Sponsored by: Netflix

12 months ago/etc/rc.subr: rename sysctl.conf.d to sysctl.kld.d
Doug Rabson [Sat, 15 Jul 2023 07:40:50 +0000 (08:40 +0100)]
/etc/rc.subr: rename sysctl.conf.d to sysctl.kld.d

This better reflects the intent that this directory is indexed by kld
name and removes a conflict with D32128 which aims to split sysctl.conf.

Reviewed by: kevans imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D41043

12 months agoFix zfsd unittests after 92642bba4db
Alan Somers [Fri, 14 Jul 2023 21:57:40 +0000 (15:57 -0600)]
Fix zfsd unittests after 92642bba4db

At the time we ensured that the more important functional tests were
working, but neglected to update the unit tests.

MFC after: 2 weeks
MFC with: 92642bba4db4bf1719758ac7233468bc09a0bd59
Sponsored by: Axcient

12 months agolib/libc/string/ffs*.c: work around gcc warning
Robert Clausecker [Mon, 10 Jul 2023 22:10:52 +0000 (22:10 +0000)]
lib/libc/string/ffs*.c: work around gcc warning

Gcc warns of infinite recursion if we use __builtin_ffs*() to
implement ffs*().  This is because gcc uses ffs() to implement
these on some platforms.  Sidestep the warning by using
__builtin_ctz*() for these.

Sponsored by: FreeBSD Foundation
Reported by: jlduran@gmail.com, jhb
Fixes: ee8b0c43 (D40730)
Reviewed by: jhb, mhorne
Approved by: jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40966

12 months agolib/libc/string/ffs*.c: fix problems introduced with D40730
Kyle Evans [Fri, 7 Jul 2023 18:59:26 +0000 (13:59 -0500)]
lib/libc/string/ffs*.c: fix problems introduced with D40730

Remove stale dependencies on the remaining old assembly
ffs*/fls* implementations.

Sponsored by: FreeBSD Foundation
Reported by: jlduran@gmail.com, jhb
Fixes: ee8b0c43 (D40730)
Approved by: jhb
Differential Revision: https://reviews.freebsd.org/D40966

12 months agomemdesc: Retire MEMDESC_BIO.
John Baldwin [Fri, 14 Jul 2023 18:32:40 +0000 (11:32 -0700)]
memdesc: Retire MEMDESC_BIO.

Instead, change memdesc_bio to examine the bio and return a memdesc of
a more generic type describing the data buffer.

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41029

12 months agomemdesc: Add a MEMDESC_VMPAGES descriptor type.
John Baldwin [Fri, 14 Jul 2023 18:31:42 +0000 (11:31 -0700)]
memdesc: Add a MEMDESC_VMPAGES descriptor type.

This memory descriptor is backed by an array of VM pages.  This type
requires adding a new field to 'struct memdesc' to hold the offset
within the first page.  For LP64 systems, this new field is added in
an existing padding hole so does not increase the size.  For ILP32
systems, this grows 'struct memdesc' from 12 to 16 bytes.

Reviewed by: imp, markj
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41028

12 months agomemdesc: Replace md_opaque with a union of type-specific fields.
John Baldwin [Fri, 14 Jul 2023 18:30:57 +0000 (11:30 -0700)]
memdesc: Replace md_opaque with a union of type-specific fields.

Reviewed by: imp, markj
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41027

12 months agomemdesc: Retire MEMDESC_CCB.
John Baldwin [Fri, 14 Jul 2023 18:30:31 +0000 (11:30 -0700)]
memdesc: Retire MEMDESC_CCB.

Instead, change memdesc_ccb to examine the CCB and return a memdesc of
a more generic type describing the data buffer.

Reviewed by: imp, markj
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D40880

12 months agoPCI DEN0115: Reliably check for a memory resource during probe.
John Baldwin [Fri, 14 Jul 2023 17:27:40 +0000 (10:27 -0700)]
PCI DEN0115: Reliably check for a memory resource during probe.

rid was stack garbage, so the bus_alloc_resource_any() call could fail
and fall through to the SMCCC version check even if a bridge had a
memory resource.

Debugging help: jrtc27
Reviewed by: jrtc27
Fixes: c9a05c072270 Add a PCI driver that follows the Arm DEN0115 spec
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D41025

12 months agoObsoletefiles.inc: A few OpenSSL 3 cleanups.
John Baldwin [Fri, 14 Jul 2023 17:25:54 +0000 (10:25 -0700)]
Obsoletefiles.inc: A few OpenSSL 3 cleanups.

- Treat old engine DSOs from OpenSSL 1.1.1 as OLD_LIBS, not OLD_FILES.
  These should only be deleted by make delete-old-libs similar to how
  PAM modules are treated.

- Add /usr/lib32/engines to OLD_DIRS.  lib32 automation does not apply
  to OLD_DIRS.

Reviewed by: Pierre Pronchery <pierre@freebsdfoundation.org>
Differential Revision: https://reviews.freebsd.org/D41034

12 months agovn_lock_pair(): Support passing LK_NODDLKTREAT
Olivier Certner [Sun, 9 Jul 2023 17:12:52 +0000 (19:12 +0200)]
vn_lock_pair(): Support passing LK_NODDLKTREAT

Since this function ultimately calls vn_lock() or VOP_LOCK1(), allows it to
receive and pass this flag which is used in the lookup code and doesn't
interfere with the function's operation.

Reviewed by:    kib, markj
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D40954

12 months ago/etc/rc.subr: add support for kld sysctl variables
Doug Rabson [Wed, 21 Jun 2023 12:26:17 +0000 (13:26 +0100)]
/etc/rc.subr: add support for kld sysctl variables

For kernel modules loaded by scripts in /etc/rc.d and
/usr/local/etc/rc.d, if there is a file in /etc/sysctl.conf.d named <kld
name>.conf, then this will be loaded using the sysctl(8) utility. For
instance, sysctl variable changes for the pf kernel module would be
placed in the file /etc/sysctl.conf.d/pf.conf.

PR: 272129
Reviewed by: imp freebsd_igalic.co
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40886

12 months agoFix i386 MINIMAL build
Kristof Provost [Thu, 13 Jul 2023 18:31:06 +0000 (20:31 +0200)]
Fix i386 MINIMAL build

Include systm.h in i386's counter.h, so it can use critical_*().

In file included from /usr/src/sys/netinet6/ip6_var.h:250:
In file included from /usr/src/sys/sys/counter.h:37:
./machine/counter.h:191:3: error: call to undeclared function 'critical_enter'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
                critical_enter();
                ^
./machine/counter.h:193:3: error: call to undeclared function 'critical_exit'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
                critical_exit();
                ^

12 months agoFix MINIMAL build
Kristof Provost [Thu, 13 Jul 2023 18:30:01 +0000 (20:30 +0200)]
Fix MINIMAL build

Pre-declare struct ucred, to fix build issues on the MINIMAL config:

In file included from /usr/src/sys/netpfil/pf/pfsync_nv.c:40:
/usr/src/sys/netinet6/ip6_var.h:384:31: error: declaration of 'struct ucred' will not be visible outside of this function [-Werror,-Wvisibility]
        struct ip6_pktopts *, struct ucred *, int);
                                     ^
/usr/src/sys/netinet6/ip6_var.h:408:28: error: declaration of 'struct ucred' will not be visible outside of this function [-Werror,-Wvisibility]
    struct inpcb *, struct ucred *, int, struct in6_addr *, int *);
                           ^
2 errors generated.

12 months agoFix MINIMAL build on amd64
Kristof Provost [Thu, 13 Jul 2023 12:44:26 +0000 (14:44 +0200)]
Fix MINIMAL build on amd64

amd64/include/counter.h uses KASSERT, but failed to include the
kassert.h header.

12 months agopfsync: fix NOINET6 build
Kristof Provost [Thu, 13 Jul 2023 12:39:25 +0000 (14:39 +0200)]
pfsync: fix NOINET6 build

While here also fix a few minor style(9) issues.

12 months agovm_radix_init: use initializer
Doug Moore [Fri, 14 Jul 2023 06:49:55 +0000 (01:49 -0500)]
vm_radix_init: use initializer

Several vm_radix tries are not initialized with vm_radix_init. That
works, for now, since static initialization zeroes the root field
anyway, but if initialization changes, these tries will fail. Add
missing initializer calls.

Reviewed by: alc, kib, markj
Differential Revision: https://reviews.freebsd.org/D40971

12 months agoMakefile.libcompat: Make quoting for CC/CXX/CPP more future-proof
Jessica Clarke [Fri, 14 Jul 2023 04:34:03 +0000 (05:34 +0100)]
Makefile.libcompat: Make quoting for CC/CXX/CPP more future-proof

bmake's :Q is for quoting outside of double quotes, but here is inside
double quotes, and as a result it ends up quoting characters that don't
have a special meaning inside double quotes. On the surface this would
seem harmless, but POSIX sh has a strange behaviour (differing from
outside double quotes) that, inside double quotes, a backslash before a
character that never has a special meaning inside double quotes is
passed through. As a result, should LIB${_LIBCOMPAT}CFLAGS contain
something like -DFOO\(x\)=x, we would form "... -DFOO\\\(x\\\)=x ...",
which would be parsed as -DFOO\\(x\\)=x, since the parentheses are never
special inside double quotes (but the backslash itself is), not the
original -DFOO\(x\)=x as intended.

Instead, construct the whole string as a bmake expression and use :Q on
that, without the manual double quotes around everything. Note that the
:L modifier lets you treat an expression like a variable expansion and
apply modifiers to it, i.e. ${expr:L:...} is the same as tmp=expr
${tmp:...} (in essence, ignoring possible differences due to deferred
substitution).

Improves: 537f945fc89f ("Makefile.libcompat: Quote CFLAGS and CXXFLAGS for sub-make")

12 months agoMakefile.libcompat: Be consistent about not installing includes
Jessica Clarke [Fri, 14 Jul 2023 01:36:04 +0000 (02:36 +0100)]
Makefile.libcompat: Be consistent about not installing includes

Currently we only pass MK_INCLUDES=no for distribute and install, since
it's only in LIB${_LIBCOMPAT}IMAKE, which means that we enable includes
during libraries and thus install includes into worldtmp, despite it
being shared these days across native and libcompats. This also means
we're at risk of having headers needed for building against a libcompat
that don't get installed to the system, but do end up being installed to
worldtmp. In particular, lib/msun has different fenv.h for aarch64 and
arm, so aarch64 will need arm's copy when it grows lib32 support, and
this would be installed to worldtmp, but not to the system, meaning any
programs that use fenv.h wouldn't be able to be built.

Instead, be consistent, and don't install includes at all during any of
the libcompat phases, so that we can detect these issues and ensure any
needed headers are installed for both worldtmp and the system.

Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D41030

12 months agorpcgen: Perform shell-style word expansion on RPCGEN_CPP
Jessica Clarke [Fri, 14 Jul 2023 01:35:25 +0000 (02:35 +0100)]
rpcgen: Perform shell-style word expansion on RPCGEN_CPP

Up until recently, CPP has been a list of space-separated words, with no
quotes, backslashes or other characters with special meaning to a shell.
However, as of 8fad2cda93c7, (escaped) quotes appear in CPP, and the
rudimentary parser in rpcgen is insufficient, since it will leave the
escaped quotes as escaped rather than performing one level of expansion
as would be done by a shell (whether in a script or a Makefile).

Rather than hack around this in all the places RPCGEN_CPP gets set,
implement proper expansion inside rpcgen. Note that this only deals with
a subset of shell syntax, since we don't handle any of:

  | & ; < > ( ) $ ` * ? [ # Ëœ = %

having special meaning (with the exception of how a backslash behaves
inside double quotes, where \$ means a literal $ inside double quotes
but \a means a literal \a), instead using their literal value, but those
are all reasonable restrictions, and can be worked around by avoiding
their use; what's important is that we get the quoting and splitting
right.

This fixes -Winvalid-pp-token spew during build${libcompat}.

Reviewed by: brooks
Fixes: 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make variables")
Differential Revision: https://reviews.freebsd.org/D41013

12 months agonvmecontrol.8: Fix a few formatting nits.
John Baldwin [Fri, 14 Jul 2023 00:08:36 +0000 (17:08 -0700)]
nvmecontrol.8: Fix a few formatting nits.

12 months agoxargs: Install missing test output.
Jose Luis Duran [Thu, 13 Jul 2023 23:39:06 +0000 (23:39 +0000)]
xargs: Install missing test output.

Fixes: eab91d008165e7bbf8ca7b87eabe4dc8bf3da191
MFC after: 1 week
Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D41033

12 months agoxargs: Fix test case count.
Dag-Erling Smørgrav [Thu, 13 Jul 2023 21:40:36 +0000 (21:40 +0000)]
xargs: Fix test case count.

MFC after: 1 week
Sponsored by: Klara, Inc.

12 months agoxargs: Prevent overflow in linelen calculation if nargs is large.
Dag-Erling Smørgrav [Thu, 13 Jul 2023 20:06:40 +0000 (20:06 +0000)]
xargs: Prevent overflow in linelen calculation if nargs is large.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D41023

12 months agoxargs: disallow -R0 and -L0
Daniel Tameling [Thu, 13 Jul 2023 20:06:31 +0000 (20:06 +0000)]
xargs: disallow -R0 and -L0

Both cases were interpreted as these flags are unset. This meant that
-R0 got converted to -R5 and that -L0 didn't have any effect at all.
Since make at most 0 replacements isn't useful and since call utility
for every 0 lines read doesn't make sense, throw an error for these
two cases.

MFC after: 1 week
Reviewed by: des, kevans
Differential Revision: https://reviews.freebsd.org/D41022

12 months agoxargs: fix -R so that it accepts negative numbers again
Daniel Tameling [Thu, 13 Jul 2023 20:06:14 +0000 (20:06 +0000)]
xargs: fix -R so that it accepts negative numbers again

fbc445addf9 converted the parsing of arguments to strtonum but made
the accepted range for -R too restrictive. As documented in the man
page, it should accept negative numbers.

Added a test for this, which was provided by Jose Luis Duran.

Fixes: fbc445addf9
MFC after: 1 week
Reviewed by: des, kevans
Differential Revision: https://reviews.freebsd.org/D41021

12 months agosignal: Remove gsignal references from manuals
Dmitry Chagin [Thu, 13 Jul 2023 21:15:47 +0000 (00:15 +0300)]
signal: Remove gsignal references from manuals

Reported by: Mina Galić, mhorne
Reviewed by: Mina Galić, mhorne
Differential Revision: https://reviews.freebsd.org/D41020
MFC after: 1 week

12 months agotcp: fix build issue for some cc modules
Michael Tuexen [Thu, 13 Jul 2023 16:56:25 +0000 (18:56 +0200)]
tcp: fix build issue for some cc modules

The TCP_HHOOK option was moved from opt_inet.h to opt_global.h in
https://cgit.FreeBSD.org/src/commit/?id=e68b3792440cac248347afe08ba5881a00ba6523
The corresponding changes in two Makefiles were missed, which resulted
in not building cc_cdg, cc_chd, cc_hd, and cc_vegas anymore.

Reported by: void@f-m.fm
Reviewed by: rrs, rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D41010

12 months agoMerge commit fde5924dcc69 from llvm-project (by Serge Pavlov):
Dimitry Andric [Thu, 13 Jul 2023 18:57:22 +0000 (20:57 +0200)]
Merge commit fde5924dcc69 from llvm-project (by Serge Pavlov):

  [clang] Reset FP options before template instantiation

  AST nodes that may depend on FP options keep them as a difference
  relative to the options outside the AST node. At the moment of
  instantiation the FP options may be different from the default values,
  defined by command-line option. In such case FP attributes would have
  unexpected values. For example, the code:

      template <class C> void func_01(int last, C) {
        func_01(last, int());
      }
      void func_02() { func_01(0, 1); }
      #pragma STDC FENV_ACCESS ON

  caused compiler crash, because template instantiation takes place at the
  end of translation unit, where pragma STDC FENV_ACCESS is in effect. As
  a result, code in the template instantiation would use constrained
  intrinsics while the function does not have StrictFP attribute.

  To solve this problem, FP attributes in Sema must be set to default
  values, defined by command line options.

  This change resolves https://github.com/llvm/llvm-project/issues/63542.

  Differential Revision: https://reviews.llvm.org/D154359

Requested by: pkubaj
PR: 265755, 265758
MFC after: 1 month

12 months agovfs_bio: initialize pctries
Doug Moore [Thu, 13 Jul 2023 18:28:21 +0000 (13:28 -0500)]
vfs_bio: initialize pctries

bufobj_init depends on fields bo_dirty.bv_root and bo_clean.bv_root
being zeroed on entry and pctrie_init zeroing whatever is passed to
them, and so does not call pctrie_init for either of them. That fails
if pctrie_init ever changes to do something other that zeroing data,
so add explicit calls to them.

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D40978

12 months agopfsync: transport over IPv6
Luiz Amaral [Thu, 13 Jul 2023 06:06:24 +0000 (08:06 +0200)]
pfsync: transport over IPv6

Implement pfsync over IPv6.

Submitted by: Luiz Amaral <email@luiz.eng.br>
Submitted by: Naman Sood <naman@freebsdfoundation.org>
Reviewed by: kp
Sponsored by: InnoGames GmbH
Differential Revision: https://reviews.freebsd.org/D40102

12 months agosignal: Get rid of gsignal() as it not used anywhere
Dmitry Chagin [Thu, 13 Jul 2023 07:41:51 +0000 (10:41 +0300)]
signal: Get rid of gsignal() as it not used anywhere

Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D41007
MFC after: 1 week

12 months agopf: Simplify rule actions logic
Kajetan Staszkiewicz [Thu, 13 Jul 2023 05:08:24 +0000 (07:08 +0200)]
pf: Simplify rule actions logic

Actions applied to a processed packet come in case of stateless
firewalling from a rule or in case of statefull firewalling from a
state. The state obtains the actions from a rule when it is created by a
rule or by pfsync. The logic for deciding if actions come from a rule or
a state is spread across many places in pf.

There already is struct pf_rule_actions in struct pf_pdesc and thus it
can be used as a central place for storing actions and their parameters.
OpenBSD does something similar: they also store the actions in struct
pf_pdesc and have no variables in pf_test() but they use separate
variables instead of a structure. By using struct pf_rule_actions we can
simplify the code even further. Applying of actions is done *only* in
pf_rule_to_actions() no matter if for the legacy scrub rules or for the
normal match / pass rules. The logic of choosing if rule or state
actions are used is applied only once in pf_test() by copying the whole
struct.

Reviewed by: kp
Sponsored by: InnoGames GmbH
Differential Revision: https://reviews.freebsd.org/D41009

12 months agorpcgen: Clarify behaviour for idx
Jessica Clarke [Thu, 13 Jul 2023 05:22:52 +0000 (06:22 +0100)]
rpcgen: Clarify behaviour for idx

The re-initialisation of idx in the later else branch is a bit hidden,
and results in deviation from the earlier two paths. Use more consistent
code instead to make it abundantly clear what's going on.

12 months agoDocument fdescfs mount option "rdlnk"
Konstantin Belousov [Tue, 11 Jul 2023 05:09:11 +0000 (08:09 +0300)]
Document fdescfs mount option "rdlnk"

Reviewed by: dchagin
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40969

12 months agofdescfs: add a mount option rdlnk
Konstantin Belousov [Tue, 11 Jul 2023 05:03:49 +0000 (08:03 +0300)]
fdescfs: add a mount option rdlnk

which changes /dev/fd/N files types to symbolic link with the behavior
of symbolic links.

PR: 272127
Reported by: Peter Eriksson <pen@lysator.liu.se>
Reviewed by: dchagin
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40969

12 months agoRevert "VFS: Remove VV_READLINK flag" and "fdescfs: improve linrdlnk mount option"
Konstantin Belousov [Tue, 11 Jul 2023 04:58:06 +0000 (07:58 +0300)]
Revert "VFS: Remove VV_READLINK flag" and "fdescfs: improve linrdlnk mount option"

This reverts commits 4a402dfe0bc44770c9eac6e58a501e4805e29413 and
3bffa2262328e4ff1737516f176107f607e7bc76.

The fix will be implemented in somewhat different manner.  The semantic
adjustment is incompatible with linuxolator expectations.

Reported and reviewed by: dchagin
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40969

12 months agorelease: remove a stray backslash
Glen Barber [Wed, 12 Jul 2023 20:57:57 +0000 (16:57 -0400)]
release: remove a stray backslash

PR: 272354 (related)
MFC after: 3 days
MFC with: 0ed426276fd52e917506ab87c05a61c6641ae298
MFC with: cd8cad0ef5cd534dc7ae1dd9a470cac2057ed957
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd

12 months agorelease: follow-up to previous commit to install lang/python{,3}
Glen Barber [Wed, 12 Jul 2023 20:49:53 +0000 (16:49 -0400)]
release: follow-up to previous commit to install lang/python{,3}

PR: 272354
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd

12 months agorelease: ensure gce-check-depends installs lang/python{,3}
Glen Barber [Wed, 12 Jul 2023 20:08:40 +0000 (16:08 -0400)]
release: ensure gce-check-depends installs lang/python{,3}

PR: 272354
Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd

12 months agopf: Fix duplicate storage of direction
Kajetan Staszkiewicz [Wed, 12 Jul 2023 16:04:56 +0000 (18:04 +0200)]
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

12 months agoamd64 pmap: Fix compilation when superpage reservations are disabled
Yufeng Zhou [Wed, 12 Jul 2023 07:52:02 +0000 (02:52 -0500)]
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

12 months agovmm: don't leak locks exiting vmmdev_ioctl()
Gleb Smirnoff [Wed, 12 Jul 2023 16:16:40 +0000 (09:16 -0700)]
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

12 months agovmm: don't return random error from vcpu_lock_all() if vcpu is empty
Gleb Smirnoff [Wed, 12 Jul 2023 16:16:40 +0000 (09:16 -0700)]
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

12 months agodtrace: prevent forked child from running after an error condition
Eric van Gyzen [Tue, 11 Jul 2023 17:58:29 +0000 (12:58 -0500)]
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

12 months agopf: fix error descriptions in the man page
Kristof Provost [Wed, 12 Jul 2023 11:17:14 +0000 (13:17 +0200)]
pf: fix error descriptions in the man page

PR: 272459
Submitted by: alex@inferiorhumanorgans.com
MFC after: 1 week

12 months agopf: fix pfi_kif definition in the man page
Kristof Provost [Wed, 12 Jul 2023 09:43:43 +0000 (11:43 +0200)]
pf: fix pfi_kif definition in the man page

PR: 272455
Submitted by: alex@inferiorhumanorgans.com
MFC after: 1 week

12 months agogetlocalbase: Make default path actually configurable
Jessica Clarke [Tue, 11 Jul 2023 20:49:22 +0000 (21:49 +0100)]
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

12 months agokmod.mk: Use portable printf '%s' over non-portable echo -n
Jessica Clarke [Tue, 11 Jul 2023 20:30:06 +0000 (21:30 +0100)]
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

12 months agobhyve: Deduplicate some code in modify_bar_registration()
Mark Johnston [Tue, 11 Jul 2023 19:22:37 +0000 (15:22 -0400)]
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

12 months agogetlocalbase.3: Fix AUTHORS formatting
Jessica Clarke [Tue, 11 Jul 2023 17:50:32 +0000 (18:50 +0100)]
getlocalbase.3: Fix AUTHORS formatting

MFC after: 1 week

12 months agolibutil: Delete trailing whitespace
Jessica Clarke [Tue, 11 Jul 2023 17:45:23 +0000 (18:45 +0100)]
libutil: Delete trailing whitespace

12 months agoix, ixv: fix kernel build
Piotr Kubaj [Tue, 11 Jul 2023 17:41:26 +0000 (19:41 +0200)]
ix, ixv: fix kernel build

struct adapter was renamed to struct sc.

Reported by: FreeBSD User <freebsd@walstatt-de.de>

12 months agoix: remove stale comment
Piotr Kubaj [Tue, 11 Jul 2023 16:45:04 +0000 (18:45 +0200)]
ix: remove stale comment

Reported by: Navdeep Parhar

12 months agoix, ixv: Update link status with autonegotiated baudrate value
Piotr Pietruszewski [Tue, 11 Jul 2023 16:14:26 +0000 (18:14 +0200)]
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

12 months agoipfw: teach ipfw that pfsync is an upper layer protocol
Kristof Provost [Tue, 11 Jul 2023 10:37:17 +0000 (12:37 +0200)]
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

12 months agocsu: Implement _start using as to satisfy unwinders on i386
Dmitry Chagin [Tue, 11 Jul 2023 12:12:01 +0000 (15:12 +0300)]
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

12 months agocsu: Add the prologue and epilogue to the _init and _fini on i386
Dmitry Chagin [Tue, 11 Jul 2023 12:11:22 +0000 (15:11 +0300)]
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

12 months agortld: Annotate .rtld_start on i386
Dmitry Chagin [Tue, 11 Jul 2023 12:10:32 +0000 (15:10 +0300)]
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

12 months agortld: Microoptimize rtld_start on i386
Dmitry Chagin [Tue, 11 Jul 2023 12:10:08 +0000 (15:10 +0300)]
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

12 months agostress2: Added two syzkaller reproducers
Peter Holm [Tue, 11 Jul 2023 08:24:19 +0000 (10:24 +0200)]
stress2: Added two syzkaller reproducers

12 months agolibbe: promote activated BEs all the way
Kyle Evans [Tue, 11 Jul 2023 05:43:51 +0000 (00:43 -0500)]
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

12 months agoigc: Increase default per-queue interrupt rate to 20000.
Peter Grehan [Fri, 7 Jul 2023 08:23:42 +0000 (18:23 +1000)]
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

12 months agodepend-cleanup: Add verbose (-v) and pretend/dry-run (-n) flags
Jessica Clarke [Tue, 11 Jul 2023 00:53:04 +0000 (01:53 +0100)]
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