]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 months agoqlnx: Fix typo (triple M)
Jose Luis Duran [Sat, 3 Feb 2024 00:35:54 +0000 (17:35 -0700)]
qlnx: Fix typo (triple M)

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/963

5 months agoath: Fix typo (triple M)
Jose Luis Duran [Sat, 3 Feb 2024 00:35:54 +0000 (17:35 -0700)]
ath: Fix typo (triple M)

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/963

5 months agolibc: Fix typo (triple M)
Jose Luis Duran [Sat, 3 Feb 2024 00:35:54 +0000 (17:35 -0700)]
libc: Fix typo (triple M)

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/963

5 months agoamd64 & i386: enable VIMAGE in MINIMAL
Mina Galić [Sat, 3 Feb 2024 00:35:18 +0000 (17:35 -0700)]
amd64 & i386: enable VIMAGE in MINIMAL

VNET(9) is very useful, and is not loadable.
Enable it in MINIMAL.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/962

5 months agoumount: Add -d option to detach md devices
Ricardo Branco [Sat, 3 Feb 2024 00:29:48 +0000 (17:29 -0700)]
umount: Add -d option to detach md devices

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/972

5 months agosctp: update manpages
Lexi Winter [Sat, 3 Feb 2024 00:20:57 +0000 (17:20 -0700)]
sctp: update manpages

Add missing documentation for sctp_sendv(3) and sctp_recvv(3).

Add a note that sctp_send(3), sctp_sendx(3) and sctp_recvmsg(3) are
deprecated by RFC 6458.

Add a STANDARDS section to all functions specified in RFC 6458 to
indicate their standards conformance.

MFC after: 2 weeks
Reviewed by: imp, bcr, kp, tuexen
Pull Request: https://github.com/freebsd/freebsd-src/pull/965

5 months agoprocfs: Add self & exe symlinks like NetBSD does
Ricardo Branco [Sat, 3 Feb 2024 00:17:52 +0000 (17:17 -0700)]
procfs: Add self & exe symlinks like NetBSD does

NetBSD calls "curproc" "self" and "exe" "file" for proc. Reduce
gratuitous differnces by including them as well.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/976

5 months agoquot: Use getopt(3) and show usage() if no arguments
Ricardo Branco [Sat, 3 Feb 2024 00:12:22 +0000 (17:12 -0700)]
quot: Use getopt(3) and show usage() if no arguments

Also update the man page and usage to be a little more accurate with the
-a flag.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/983

5 months agowc: Do not use st_size if it equals zero
Ricardo Branco [Sat, 3 Feb 2024 00:05:05 +0000 (17:05 -0700)]
wc: Do not use st_size if it equals zero

Pseudo-filesystems often cannot compute the size of the file correctly
and report 0 for the size. Ignore the size when it's zero and fallback
to the size unknown code.

PR: 276093
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/985

5 months agopkg-stage.sh: add x11/sddm
Graham Perrin [Fri, 2 Feb 2024 23:35:42 +0000 (16:35 -0700)]
pkg-stage.sh: add x11/sddm

MFC After: 2 days
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/996

5 months agoman: fix redirect for locales and file arguments
Mohamed Akram [Fri, 2 Feb 2024 23:26:20 +0000 (16:26 -0700)]
man: fix redirect for locales and file arguments

Use the locale-specific path for localized pages and the appropriate parent
directory for file arguments when handling redirects.

Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1019

5 months agoRevert "bsdinstall: separate out dist selection in prep for pkgbase support"
Jessica Clarke [Sat, 3 Feb 2024 01:31:11 +0000 (01:31 +0000)]
Revert "bsdinstall: separate out dist selection in prep for pkgbase support"

Firstly, my review comments were not addressed and instead totally
ignored. Secondly, and a more valid justification for the revert, this
completely breaks the installer, since selectdists isn't installed.
Given the blatant lack of testing, back out this commit until it has
actually been tested and review comments taken on board so that the
installer actually works.

This reverts commit 009d3f66cb5f0cf3f1d353f311d3a6878b2a534e.

5 months agoOpenSSL: Update version strings
Cy Schubert [Sat, 3 Feb 2024 00:34:36 +0000 (16:34 -0800)]
OpenSSL: Update version strings

Reported by: "Herbert J. Skuhra" <herbert@gojira.at>
Fixes: 9eb4e0b42d7c
MFC after: 3 days

5 months agox86 mem: Pass standard bool value to pmap_demote_DMAP
John Baldwin [Fri, 2 Feb 2024 23:32:07 +0000 (15:32 -0800)]
x86 mem: Pass standard bool value to pmap_demote_DMAP

5 months agoddb: Use bool for boolean variables in MD code
John Baldwin [Fri, 2 Feb 2024 23:08:53 +0000 (15:08 -0800)]
ddb: Use bool for boolean variables in MD code

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43695

5 months agoarm: pmap_extract() returns a PA not a boolean value
John Baldwin [Fri, 2 Feb 2024 22:59:03 +0000 (14:59 -0800)]
arm: pmap_extract() returns a PA not a boolean value

Assume a PA of 0 indicates an invalid virtual address.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43694

5 months agoamd64: Use bool for booleans in getmemsize
John Baldwin [Fri, 2 Feb 2024 22:58:46 +0000 (14:58 -0800)]
amd64: Use bool for booleans in getmemsize

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43693

5 months agox86: Consistently pass true/false to is_pde parameter of pmap_cache_bits
John Baldwin [Fri, 2 Feb 2024 22:58:30 +0000 (14:58 -0800)]
x86: Consistently pass true/false to is_pde parameter of pmap_cache_bits

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43692

5 months agotraceroute6: remove -l flag
Lexi Winter [Fri, 2 Feb 2024 21:46:14 +0000 (14:46 -0700)]
traceroute6: remove -l flag

The -l flag was used to tell traceroute6(8) to show both hostname and
address for each hop.  However, traceroute(8) already does this by
default, and there's no reason for traceroute6 to behave differently.

Make this the default behaviour, and accept -l for backward
compatibility as a no-op flag.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1023

5 months agoOpenSSL: Vendor import of OpenSSL 3.0.13
Cy Schubert [Fri, 2 Feb 2024 21:10:22 +0000 (13:10 -0800)]
OpenSSL: Vendor import of OpenSSL 3.0.13

 * Fixed PKCS12 Decoding crashes ([CVE-2024-0727])
 * Fixed Excessive time spent checking invalid RSA public keys
   ([CVE-2023-6237])
 * Fixed POLY1305 MAC implementation corrupting vector registers on
   PowerPC CPUs which support PowerISA 2.07 ([CVE-2023-6129])
 * Fix excessive time spent in DH check / generation with large Q
   parameter value ([CVE-2023-5678])

Release notes can be found at
            https://www.openssl.org/news/openssl-3.0-notes.html.

Approved by: emaste
MFC after: 3 days

Merge commit '9dd13e84fa8eca8f3462bd55485aa3da8c37f54a'

5 months agobsd.subdir.mk: Drop broken optimisation for realinstall parallelisation
Jessica Clarke [Fri, 2 Feb 2024 21:17:23 +0000 (21:17 +0000)]
bsd.subdir.mk: Drop broken optimisation for realinstall parallelisation

Not all of the tree is happy for realinstall to be done in parallel. In
particular, Makefile.inc1 uses .WAIT to force etc to be installed after
earlier subdirectories, since etc calls into share/man's makedb to run
makewhatis on the tree and needs all manpages to have been installed.
Also, libexec/Makefile doesn't set SUBDIR_PARALLEL, and the link from
ld-elf32.1 to ld-elf.1 relies on rtld-elf having been installed before
rtld-elf32, otherwise creating the link will fail.

In general, core behavioural differences like this between NO_ROOT and
"normal" builds are also dangerous and confusing.

If this optimisation is deemed important, it should be reintroduced in a
more limited and robust manner that doesn't break the above situations.
Until then value correctness over slight efficiency gains on high core
count machines, the same machines where you're more likely to encounter
issues from this optimisation.

This reverts commits cd19ecdbdc87 ("Similar to r296013 for NO_ROOT,
force SUBDIR_PARALLEL for buildworld WORLDTMP staging.") and
b9c6f3168112 ("Add more STANDALONE_SUBDIR_TARGETS.").

Found by: CheriBSD Jenkins
Reviewed by: bdrewery, brooks
Fixes: cd19ecdbdc87 ("Similar to r296013 for NO_ROOT, force SUBDIR_PARALLEL for buildworld WORLDTMP staging.")
Fixes: b9c6f3168112 ("Add more STANDALONE_SUBDIR_TARGETS.")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43705

5 months agoloader: Move build_font_module to gfx_fb.c
Warner Losh [Fri, 2 Feb 2024 01:38:18 +0000 (18:38 -0700)]
loader: Move build_font_module to gfx_fb.c

The font module is part and parsel of the gfx_fb support. Move it to
gfx_fb.c where it can access the data it needs.

Sponsored by: Netflix

5 months agoloader: Font module is EFI dependent
Warner Losh [Fri, 2 Feb 2024 01:37:12 +0000 (18:37 -0700)]
loader: Font module is EFI dependent

The font module is part of the gfx_fb support. Since we share this file
between EFI and kboot, we only want to pass the font data to the kernel
when we're booting from EFI, not kboot.

Sponsored by: Netflix

5 months agolibsa: Move hash functions up a level
Warner Losh [Wed, 31 Jan 2024 23:54:19 +0000 (16:54 -0700)]
libsa: Move hash functions up a level

This should have no functional change. Move compiling the sha256, sha512
and md5 hash functions up into libsa to allow them to be used elsewhere
in the boot loader when geli isn't configured. Since libsa is a .a, these
won't wind up in any boot loader that doesn't reference them, so should
be a nop.

Sponsored by: Netflix

5 months agolibsa: Move include file creation to the end of the Makefile
Warner Losh [Wed, 31 Jan 2024 23:42:49 +0000 (16:42 -0700)]
libsa: Move include file creation to the end of the Makefile

The include file symblic links, etc are out of place where they
are. Move them to the end of the file. No functional change intended.

Sponsored by: Netflix

5 months agofreebsd-update(8): Update date
Graham Perrin [Sun, 20 Aug 2023 10:05:19 +0000 (11:05 +0100)]
freebsd-update(8): Update date

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/826

5 months agofreebsd-update(8): wrap to 80 columns
Graham Perrin [Sun, 20 Aug 2023 10:01:05 +0000 (11:01 +0100)]
freebsd-update(8): wrap to 80 columns

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/826

5 months agofreebsd-update(8): Explain conflicts in /etc
Graham Perrin [Sat, 19 Aug 2023 14:52:18 +0000 (15:52 +0100)]
freebsd-update(8): Explain conflicts in /etc

Unlike etcupdate(8), freebsd-update only prints the files with
conflicts. It doesn't merge.

PR: 204549
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/826

5 months agols: versort incompatible w/ timesort and sizesort
Alexander Ziaee [Fri, 2 Feb 2024 20:19:07 +0000 (13:19 -0700)]
ls: versort incompatible w/ timesort and sizesort

ls.1: versort incompatible w/ timesort and sizesort

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/825

5 months agox86 & arm: remove CAM_DEBUG_FLAGS= from MMCCAM kernels
Mina Galić [Fri, 2 Feb 2024 19:46:01 +0000 (12:46 -0700)]
x86 & arm: remove CAM_DEBUG_FLAGS= from MMCCAM kernels

we leave `options CAMDEBUG` enabled, so that when needed, CAM debugging
can be enabled *as needed*, rather than setting a default of everything.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/798

5 months agoamd64: switch GENERIC-MMCCAM to GENERIC
Mina Galić [Fri, 2 Feb 2024 19:46:01 +0000 (12:46 -0700)]
amd64: switch GENERIC-MMCCAM to GENERIC

arm's and arm64's GENERIC-MMCCAM is based on GENERIC. amd64's is based
on MINIMAL. For consistency, switch it to GENERIC.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/798

5 months agoarm: fix typo in GENERIC-MMCCAM
Mina Galić [Fri, 2 Feb 2024 19:46:01 +0000 (12:46 -0700)]
arm: fix typo in GENERIC-MMCCAM

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/798

5 months agoaxgbe: Various link stability and module compatibilty improvements
Stephan de Wit [Fri, 2 Feb 2024 19:17:14 +0000 (12:17 -0700)]
axgbe: Various link stability and module compatibilty improvements

Move the phy_stop() routine to if_detach() to prevent link interruptions
when configuring the interface. Accompanying this is a sanity check
using phy_started, which was already there but remained unused. We do
not move phy_start(), as the logic there is needed for any init routine,
be it attach or start.

Also bring in the linux PMA_PLL change which addresses the flapping of
back-to-back fiber connections.

Use miibus for SFP PHYs up to 1G copper. We retry in cases where the PHY
is not directly reachable.  Set the correct IFM_100_SGMII flag when the
phy speed has been set to 100. We remove xgbe_phy_start_aneg() since
it's handled by miibus.

Add support for 100 and 1000 BASE-BX fiber modules

Add support for 25G multirate DACs which are capable of 10G.

While here, also fixup the LINK_ERR state. It was impossible to recover
from this previously.

[[ Note: light style fixes by imp, slight commit message adjustment,
   and a warning that I don't have the hardware to validate, but
   the changes do track the commit message and seem otherwise OK ]]

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/768

5 months agostdlib.h: Partially revert c27a89971805
Warner Losh [Fri, 2 Feb 2024 19:06:25 +0000 (12:06 -0700)]
stdlib.h: Partially revert c27a89971805

quick_exit() can call other functions, and we don't guarantee it calls
std::terminate should those other functions throw exceptions. And to
make it do so has ABI complications for libc. Until that's sorted out,
revert this noexcept (but leave a comment behind so people will find
this commit message)

Requested by: kib

Sponsored by: Netflix

5 months agostand/lua: always allow overriding with local config files
Stéphane Rochoy [Thu, 21 Dec 2023 14:05:58 +0000 (15:05 +0100)]
stand/lua: always allow overriding with local config files

Loader now also read configuration files listed in local_loader_conf_files.
Files listed here are the last ones read. And /boot/loader.conf.local was
moved from loader_conf_files to local_loader_conf_files leaving only
loader.conf and device.hints in loader_conf_files by default.

The idea is to ensure local_loader_conf_files, i.e., /boot/loader.conf.local,
can always be used to override other user defined settings.

So the sequencing is now as follow:

 1. Bootstrap:
     /boot/defaults/loader.conf

 2. Read loader_conf_files files:
     /boot/device.hints
     /boot/loader.conf

 3. Read loader_conf_dirs files:
     /boot/loader.conf.d/*.conf

 4. And finally, rread local_loader_conf_files files:
     /boot/loader.conf.local

Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/759

5 months agostand/lua: per-product conf if requested via product_vars
Stéphane Rochoy [Thu, 4 May 2023 07:23:47 +0000 (09:23 +0200)]
stand/lua: per-product conf if requested via product_vars

If product_vars is set, it must be a space separated list of environment
variable names to walk through to guess the product. Each time a product can be
guessed (i.e., the corresponding variable is defined), prepend
/boot/loader.conf.d/PRODUCT/ to loader_conf_dirs.

It can be typically used as follow:

    smbios.system.planar.maker="PLANAR_MAKER"
    smbios.system.planar.product="PLANAR_PRODUCT"
    smbios.system.product="PRODUCT"
    uboot.m_product="M_PRODUCT"
    product_vars="smbios.system.planar.maker smbios.system.planar.product smbios.system.product uboot.m_product"

to read files found in the following directories, in that order:

    /boot/loader.conf.d/PLANAR_MAKER
    /boot/loader.conf.d/PLANAR_PRODUCT
    /boot/loader.conf.d/PRODUCT
    /boot/loader.conf.d/M_PRODUCT

Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/759

5 months agoRevert "stand/lua: per-product conf if requested via product_vars"
Warner Losh [Fri, 2 Feb 2024 19:02:23 +0000 (12:02 -0700)]
Revert "stand/lua: per-product conf if requested via product_vars"

This reverts commit 754cac4b283eb024a3a6a194130199c860e32ebf. No mail
went out and commit message was wrong.

Sponsored by: Netflix

5 months agoRevert "stand/lua: always allow overriding with local config files"
Warner Losh [Fri, 2 Feb 2024 19:01:56 +0000 (12:01 -0700)]
Revert "stand/lua: always allow overriding with local config files"

This reverts commit d3d0b735571d9562812ce5b343a6e91f7a795dbe. no mail
sent out, and the commit message was wrong.

Sponsored by: Netflix

5 months agosocket: Don't assume m0 != NULL in sbappendcontrol_locked()
Mark Johnston [Fri, 2 Feb 2024 18:58:37 +0000 (13:58 -0500)]
socket: Don't assume m0 != NULL in sbappendcontrol_locked()

Some callers (e.g., ktls_decrypt()) violate this assumption and thus
could trigger a NULL pointer dereference in KMSAN kernels.

Reported by: glebius
Fixes: ec45f952a232 ("sockbuf: Add KMSAN checks to sbappend*()")
MFC after: 1 week

5 months agostand/lua: always allow overriding with local config files
Stéphane Rochoy [Thu, 21 Dec 2023 14:05:58 +0000 (15:05 +0100)]
stand/lua: always allow overriding with local config files

Loader now also read configuration files listed in local_loader_conf_files.
Files listed here are the last ones read. And /boot/loader.conf.local was
moved from loader_conf_files to local_loader_conf_files leaving only
loader.conf and device.hints in loader_conf_files by default.

The idea is to ensure local_loader_conf_files, i.e., /boot/loader.conf.local,
can always be used to override other user defined settings.

So the sequencing is now as follow:

 1. Bootstrap:
     /boot/defaults/loader.conf

 2. Read loader_conf_files files:
     /boot/device.hints
     /boot/loader.conf

 3. Read loader_conf_dirs files:
     /boot/loader.conf.d/*.conf

 4. And finally, rread local_loader_conf_files files:
     /boot/loader.conf.local

5 months agostand/lua: per-product conf if requested via product_vars
Stéphane Rochoy [Thu, 4 May 2023 07:23:47 +0000 (09:23 +0200)]
stand/lua: per-product conf if requested via product_vars

If product_vars is set, it must be a space separated list of environment
variable names to walk through to guess the product. Each time a product can be
guessed (i.e., the corresponding variable is defined), prepend
/boot/loader.conf.d/PRODUCT/ to loader_conf_dirs.

It can be typically used as follow:

    smbios.system.planar.maker="PLANAR_MAKER"
    smbios.system.planar.product="PLANAR_PRODUCT"
    smbios.system.product="PRODUCT"
    uboot.m_product="M_PRODUCT"
    product_vars="smbios.system.planar.maker smbios.system.planar.product smbios.system.product uboot.m_product"

to read files found in the following directories, in that order:

    /boot/loader.conf.d/PLANAR_MAKER
    /boot/loader.conf.d/PLANAR_PRODUCT
    /boot/loader.conf.d/PRODUCT
    /boot/loader.conf.d/M_PRODUCT

5 months agoregex: fix freeing g->charjump in low memory condition
Corinna Vinschen [Fri, 2 Feb 2024 18:30:39 +0000 (11:30 -0700)]
regex: fix freeing g->charjump in low memory condition

computejumps() moves g->charjump to a position relativ to the value of
CHAR_MIN.  As such, g->charjump doesn't necessarily point to the address
actually allocated.  While regfree() takes that into account, the low
memory handling in regcomp_internal() doesn't.  Fix that by free'ing
the actually allocated address, as in regfree().

MFC After: 2 weeks
Reviewed by: imp,jrtc27
Pull Request: https://github.com/freebsd/freebsd-src/pull/692

5 months agodaily/223.backup-zfs: improve daily_backup_zfs_verbose behaviour
Lexi Winter [Fri, 2 Feb 2024 18:18:54 +0000 (11:18 -0700)]
daily/223.backup-zfs: improve daily_backup_zfs_verbose behaviour

- 223.backup-zfs would previously honour the daily_backup_zfs_verbose
  flag for zfs/zpool list, but not for the properties list.  fix it to
  show a diff for both of these if requested.

- if daily_backup_zfs_verbose was disabled, 223.backup-zfs would still
  set rc=1 if the backup files changed, which caused periodic(8) to send
  a useless email even if daily_show_success=NO was set.

  change this so that it only sets rc=1 if diff output is enabled, i.e.
  the output is actually useful to the admin.

MFC after: 2 weeks
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1091

5 months agostdlib.h: add __noexcept to prototypes
Lexi Winter [Fri, 2 Feb 2024 16:41:40 +0000 (09:41 -0700)]
stdlib.h: add __noexcept to prototypes

The noexcept specifier is required on these functions in C++:
_Exit(), atexit(), quick_exit(), at_quick_exit(), abort().

MFC after: 2 weeks

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1085

5 months agosys/cdefs.h: add __noexcept and __noexcept_if
Lexi Winter [Fri, 2 Feb 2024 16:41:40 +0000 (09:41 -0700)]
sys/cdefs.h: add __noexcept and __noexcept_if

These macros provide the C++11 noexcept and noexcept(...) keywords if
we're compiling in a C++11 environment.  Otherwise, they expand to an
empty string.

This will be used to add the required noexcept specifier to several libc
functions as required in C++11.

MFC after: 2 weeks

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1085

5 months agoaarch/SYS.h: implement _SYSCALL_BODY() macro
Brooks Davis [Fri, 2 Feb 2024 17:08:55 +0000 (17:08 +0000)]
aarch/SYS.h: implement _SYSCALL_BODY() macro

Add _SYSCALL_BODY() macro which invokes the syscall via _SYCALL() and
calls cerror as required.  Use to implement PSEUDO() and RSYSCALL().

Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D43058

5 months agolibpfct: fix incorrect array check
Kristof Provost [Thu, 1 Feb 2024 21:32:32 +0000 (22:32 +0100)]
libpfct: fix incorrect array check

Reported by: Coverity Scan
CID: 1523771
Sponsored by: Rubicon Communications, LLC ("Netgate")

5 months agopf: implement addrule via netlink
Kristof Provost [Fri, 12 Jan 2024 10:54:18 +0000 (11:54 +0100)]
pf: implement addrule via netlink

Sponsored by: Rubicon Communications, LLC ("Netgate")

5 months agopf: ensure dummynet gets the correct direction after route-to
Kristof Provost [Thu, 1 Feb 2024 17:59:36 +0000 (18:59 +0100)]
pf: ensure dummynet gets the correct direction after route-to

If we apply a route-to to an inbound packet pf_route() may hand that
packet over to dummynet. Dummynet may then delay the packet, and later
re-inject it. This re-injection (in dummynet_send()) needs to know
if the packet was inbound or outbound, to call the correct path for
continued processing.

That's done based on the pf_pdesc we pass along (through
pf_dummynet_route() and pf_pdesc_to_dnflow()). In the case of pf_route()
on inbound packets that may be wrong, because we're called in the input
path, and didn't update pf_pdesc->dir.

This can manifest in issues with fragmented packets. For example, a
fragmented packet will be re-fragmented in pf_route(), and if dummynet
makes different decisions for some of the fragments (that is, it delays
some and allows others to pass through directly) this will break.

The packets that pass through dummynet without delay will be transmitted
correctly (through the ifp->if_output() call in pf_route()), but
the delayed packets will be re-injected in the input path (and not
the output path, as they should be). These packets will pass through
pf_test(PF_IN) as they're tagged PF_MTAG_FLAG_DUMMYNET. However,
this tag is then removed and the packet will be routed and enter
pf_test(PF_OUT) where pf_reassemble() will hold them indefinitely
(as some fragments have been transmitted directly, and will never hit
pf_test(PF_OUT)).

The fix is simple: we must update pf_pfdesc->dir to PF_OUT before we
pass the packet to dummynet.

See also: https://redmine.pfsense.org/issues/15156
Reviewed by: rcm
Sponsored by: Rubicon Communications, LLC ("Netgate")

5 months ago.gitignore: add sys/*/compile
Lexi Winter [Fri, 2 Feb 2024 16:17:19 +0000 (09:17 -0700)]
.gitignore: add sys/*/compile

Files in sys/*/compile are created when compiling the kernel with
config(8).  They are never source files and should never be committed to
source control, so list this entire directory in .gitignore. While not
the official way to build the kernel, it's often useful to debug
sys/conf/files* changes when adding new drivers, etc.

Reviewed by: imp, meena <me igalic co>
Pull Request: https://github.com/freebsd/freebsd-src/pull/1082

5 months agokldxref: Fix maketempfile function's way of finding the root dir
Mina Galić [Fri, 2 Feb 2024 15:35:46 +0000 (08:35 -0700)]
kldxref: Fix maketempfile function's way of finding the root dir

Rather than assuming that the "root" is passed as directory and will be
marked by a trailing slash, we just assume that the directory, which has
been checked previously to be a directory, is a directory.

This fixes an inconsistency between `kldxref /boot/modules`, which tries
to create the temp file in `/boot/`, and `kldxref /boot/modules/`, which
tries to create it in `/boot/modules/` itself.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1093

5 months agolibthr: Force the thr_wake() symbol to be resolved during initialization
Mark Johnston [Fri, 2 Feb 2024 14:23:53 +0000 (09:23 -0500)]
libthr: Force the thr_wake() symbol to be resolved during initialization

Otherwise the lock upgrade performed by rtld's load_filtees() can result
in infinite recursion, wherein:
1. _rtld_bind() acquires the bind read lock,
2. the source DSO's filtees haven't been loaded yet, so the lock upgrade
   in load_filtees() cause rtld to jump to _rtld_bind() and release the
   bind lock,
3. _thr_rtld_lock_release() calls _thr_ast(), which calls thr_wake(),
   which hasn't been resolved yet,
4. _rtld_bind() acquires the bind read lock in order to resolve
   thr_wake(),
5. ...

See the linked pull request for an instance of this problem arising with
libsys.  That particular instance is also worked around by commit
e7951d0b04e6.

Reported by: brooks
Reviewed by: kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/908
MFC after: 1 week
Sponsored by: Innovate UK

5 months agoshare/examples/IPv6/USAGE: remove
Lexi Winter [Fri, 2 Feb 2024 15:29:01 +0000 (08:29 -0700)]
share/examples/IPv6/USAGE: remove

This document dates from the KAME days and, among other things,
references the 'prefix' command which has not existed for a long time.
Since IPv6 configuration is now documented in the Handbook, remove this
obsolete file.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1094

5 months agofreebsd-tips: freebsd-update fetch, then install
Graham Perrin [Fri, 2 Feb 2024 15:25:41 +0000 (08:25 -0700)]
freebsd-tips: freebsd-update fetch, then install

In end of life (EOL) warning cases: freebsd-update fetch install (the
two commands, combined) may fetch and patch, but not install.

Instead: run the two consecutively. Consistent with installation
information in /releases/ areas and with accepted
https://reviews.freebsd.org/D42722

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1096

5 months agortld-elf: Avoid unnecessary lock_restart_for_upgrade() calls
Mark Johnston [Thu, 1 Feb 2024 22:43:05 +0000 (17:43 -0500)]
rtld-elf: Avoid unnecessary lock_restart_for_upgrade() calls

In order to atomically upgrade the rtld bind lock, load_filtees() may
trigger a longjmp back to _rtld_bind() so that the binding can be done
with the write lock held.  However, the write lock is only needed when
filtee objects haven't already been loaded, so move the
lock_restart_for_upgrade() call to avoid unnecessary lock upgrades when
a filtee is defined.

Reviewed by: kib
Tested by: brooks
MFC after: 1 week
Sponsored by: Innovate UK

5 months agoRevert "pkgbase: Create a FreeBSD-dtb package"
Emmanuel Vadot [Fri, 2 Feb 2024 10:39:51 +0000 (11:39 +0100)]
Revert "pkgbase: Create a FreeBSD-dtb package"

Somehow this doesn't work iwth make packages due to some kind of a race.
The package is first created correctly but later in the process it is
overwritten by a badly created empty package.
Revert in the mean time so we can have working pkgbase on arm/arm64

This reverts commit a5afd7920d50ff23f91bdbabb1f0fd7ba028ba9e.

5 months agoOpenSSL: Vendor import of OpenSSL 3.0.13
Cy Schubert [Fri, 2 Feb 2024 04:39:16 +0000 (20:39 -0800)]
OpenSSL: Vendor import of OpenSSL 3.0.13

* Fixed PKCS12 Decoding crashes ([CVE-2024-0727])
* Fixed Excessive time spent checking invalid RSA public keys
  ([CVE-2023-6237])
* Fixed POLY1305 MAC implementation corrupting vector registers on
  PowerPC CPUs which support PowerISA 2.07 ([CVE-2023-6129])
* Fix excessive time spent in DH check / generation with large Q
  parameter value ([CVE-2023-5678])

Release notes can be found at
https://www.openssl.org/news/openssl-3.0-notes.html.

5 months agocheckstyle9.pl: Differentiate errors and warnings
Warner Losh [Fri, 2 Feb 2024 07:23:43 +0000 (00:23 -0700)]
checkstyle9.pl: Differentiate errors and warnings

Use ::error and ::warning as appropriate to give better meaning to the
messages.

Sponsored by: Netflix

5 months agocheckstyle9.pl: Another correction to github workflow
Warner Losh [Fri, 2 Feb 2024 06:26:38 +0000 (23:26 -0700)]
checkstyle9.pl: Another correction to github workflow

Remove extra space...

Sponsored by: Netflix

5 months agocheckstyle9.pl: Correct github output
Warner Losh [Fri, 2 Feb 2024 06:15:13 +0000 (23:15 -0700)]
checkstyle9.pl: Correct github output

Change the : between file and line to a ,. This should fix this...

Sponsored by: Netflix

5 months agogithub: Enable github workflow output from checkstyle9.pl
Warner Losh [Fri, 2 Feb 2024 05:53:58 +0000 (22:53 -0700)]
github: Enable github workflow output from checkstyle9.pl

Let's see if we can get the style issues flagged inline.

Sponsored by: Netflix

5 months agocheckstyle9.pl: Add --github to output for github workflows
Warner Losh [Fri, 2 Feb 2024 05:50:19 +0000 (22:50 -0700)]
checkstyle9.pl: Add --github to output for github workflows

If you add "::error file=foo/bar.c:line=123:" before the error message,
it will appear inline.

Sponsored by: Netflix

5 months agocontrib/tzdata: import tzdata 2024a
Philip Paeps [Fri, 2 Feb 2024 02:01:39 +0000 (10:01 +0800)]
contrib/tzdata: import tzdata 2024a

Changes: https://github.com/eggert/tz/blob/2024a/NEWS

MFC after: 3 days

5 months agoImport tzdata 2024a
Philip Paeps [Fri, 2 Feb 2024 01:53:59 +0000 (09:53 +0800)]
Import tzdata 2024a

5 months agopflowctl: add missing break to case 's'
Ed Maste [Thu, 1 Feb 2024 21:22:11 +0000 (16:22 -0500)]
pflowctl: add missing break to case 's'

CID: 1534009
Reported by: Coverity Scan
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D43704

5 months agotests/netinet: add a demo of TCP implied connect
Gleb Smirnoff [Thu, 1 Feb 2024 21:37:26 +0000 (13:37 -0800)]
tests/netinet: add a demo of TCP implied connect

The TCP implied connect is an artifact left after T/TCP.  To my surprise
it still works, hence the existence of this test.  Please read this email
first:

https://lists.freebsd.org/pipermail/freebsd-net/2010-August/026311.html

An interesting fact that this test takes 220 - 240 milliseconds to
execute on my Threadripper PRO.  Flipping the '#if 0' to '#if 1' in the
test, thus bringing it back to normal connect(2), would speed the test up
a hundred times and I guess all this time is fork+exec of the test.

5 months agosocket tests: improve error message
Gleb Smirnoff [Thu, 1 Feb 2024 21:37:26 +0000 (13:37 -0800)]
socket tests: improve error message

5 months agounix/dgram: don't clear so_error in case of MSG_PEEK
Gleb Smirnoff [Thu, 1 Feb 2024 21:37:26 +0000 (13:37 -0800)]
unix/dgram: don't clear so_error in case of MSG_PEEK

5 months agosyscalls.master: Remove stray blank lines
Brooks Davis [Thu, 1 Feb 2024 17:13:19 +0000 (17:13 +0000)]
syscalls.master: Remove stray blank lines

No functional change.

5 months agobintrans: Remove unused variable.
Dag-Erling Smørgrav [Thu, 1 Feb 2024 13:10:45 +0000 (14:10 +0100)]
bintrans: Remove unused variable.

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

5 months agobintrans: Add base64 to name list in manual page.
Dag-Erling Smørgrav [Thu, 1 Feb 2024 13:10:41 +0000 (14:10 +0100)]
bintrans: Add base64 to name list in manual page.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: 0mp, pstef
Differential Revision: https://reviews.freebsd.org/D43558

5 months agobintrans: Fix uninitialized variable.
Dag-Erling Smørgrav [Thu, 1 Feb 2024 13:10:37 +0000 (14:10 +0100)]
bintrans: Fix uninitialized variable.

`prev` may be used uninitialized if `body` starts with a newline.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: bapt, emaste
Differential Revision: https://reviews.freebsd.org/D43534

5 months agobintrans: Error out if writing to the output failed.
Dag-Erling Smørgrav [Thu, 1 Feb 2024 13:10:31 +0000 (14:10 +0100)]
bintrans: Error out if writing to the output failed.

- Cover all code paths.
- When decoding, check all output files, not just the last one.
- A simple `ferror()` check is not enough as an error may later occur
  while flushing whatever remains in the output buffer.

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

5 months agokbdmap: fix typo preventing kbdmap to work under vt
Baptiste Daroussin [Thu, 1 Feb 2024 07:44:04 +0000 (08:44 +0100)]
kbdmap: fix typo preventing kbdmap to work under vt

5 months agokbdmap: remove debug
Baptiste Daroussin [Thu, 1 Feb 2024 07:40:00 +0000 (08:40 +0100)]
kbdmap: remove debug

5 months agompr: endianess fix for set/get dpm page0
Robert Wing [Thu, 1 Feb 2024 02:33:05 +0000 (17:33 -0900)]
mpr: endianess fix for set/get dpm page0

Reviewed by: oshogbo, imp
Sponsored by:   Klara, Inc.
Sponsored by:   Datazap
Differential Revision: https://reviews.freebsd.org/D43505

5 months agoMinor change to update these files so new freebsd*.cf files are
Gregory Neil Shapiro [Thu, 1 Feb 2024 00:27:37 +0000 (00:27 +0000)]
Minor change to update these files so new freebsd*.cf files are
generated

5 months agoAdd a note about sendmail 8.18.1's stricter SMTP protocol enforcement
Gregory Neil Shapiro [Thu, 1 Feb 2024 00:21:15 +0000 (00:21 +0000)]
Add a note about sendmail 8.18.1's stricter SMTP protocol enforcement

5 months agoNew sendmail 8.18.1 cf file
Gregory Neil Shapiro [Thu, 1 Feb 2024 00:13:58 +0000 (00:13 +0000)]
New sendmail 8.18.1 cf file

5 months agoAdd new source file for sendmail 8.18.1
Gregory Neil Shapiro [Thu, 1 Feb 2024 00:04:53 +0000 (00:04 +0000)]
Add new source file for sendmail 8.18.1

5 months agoMerge commit '850ef5ae11d69ea3381bd310f564f025fc8caea3'
Gregory Neil Shapiro [Wed, 31 Jan 2024 23:53:48 +0000 (23:53 +0000)]
Merge commit '850ef5ae11d69ea3381bd310f564f025fc8caea3'

Merge vendor sendmail 8.18.1 into HEAD

5 months agoImport sendmail 8.18.1
Gregory Neil Shapiro [Wed, 31 Jan 2024 23:37:30 +0000 (23:37 +0000)]
Import sendmail 8.18.1

5 months agopmap: Convert boolean_t to bool.
John Baldwin [Wed, 31 Jan 2024 22:48:26 +0000 (14:48 -0800)]
pmap: Convert boolean_t to bool.

Reviewed by: kib (older version)
Differential Revision: https://reviews.freebsd.org/D39921

5 months agobsdinstall: separate out dist selection in prep for pkgbase support
Brad Davis [Fri, 26 Jan 2024 17:46:46 +0000 (10:46 -0700)]
bsdinstall: separate out dist selection in prep for pkgbase support

No functional change intended.

Approved by: asiciliano
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D43621

5 months agoperiodic: fix a typo in a comment
Enji Cooper [Wed, 31 Jan 2024 20:45:32 +0000 (12:45 -0800)]
periodic: fix a typo in a comment

No functional change.

5 months agocsu: add crtbrand.o dependency on sys/param.h
Ed Maste [Fri, 12 Jan 2024 15:01:49 +0000 (10:01 -0500)]
csu: add crtbrand.o dependency on sys/param.h

__FreeBSD_version is recorded in *crt1.o and crti.o via crtbrand.o.  Add
an explicit dependency to pick up __FreeBSD_version bumps.

Additional changes are required to fully plumb *crt1.o dependencies
through the build.

Reported by: bapt
Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43417

5 months agotools/build/make.py: Avoid Python 3.7+ subprocess.run capture_output
Jessica Clarke [Wed, 31 Jan 2024 19:45:59 +0000 (19:45 +0000)]
tools/build/make.py: Avoid Python 3.7+ subprocess.run capture_output

This is just a convenient alias for setting stdout and stderr to PIPE,
so substitute it for that to be compatible with Python 3.6.

Fixes: 69cfdc81ea7b ("tools/build/make.py: Keep bootstrapped bmake binary up-to-date")

5 months agoacpica: Fix build with ACPICA 20230331 and later
Jung-uk Kim [Wed, 31 Jan 2024 18:41:29 +0000 (13:41 -0500)]
acpica: Fix build with ACPICA 20230331 and later

ACPICA is using flexible arrays since 20230331 and it broke aarch64
build.

--- acpi_iort.o ---
/usr/src/sys/arm64/acpica/acpi_iort.c:103:4: error: field 'data' with
variable sized type 'union (unnamed union at
/usr/src/sys/arm64/acpica/acpi_iort.c:98:2)' not at the end of a struct
or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
  103 |         } data;
      |           ^

Reported by: bapt
Tested by: bapt

5 months agointro.9: minor changes
Graham Perrin [Sun, 6 Aug 2023 17:34:03 +0000 (18:34 +0100)]
intro.9: minor changes

A correction: 'and' -> 'an'. Plus, several tweaks for brevity or
clarity.

Reviewed by: mhorne
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/813

5 months agotimerfd: Move kern_timerfd_* prototypes to <sys/syscallsubr.h>
John Baldwin [Wed, 31 Jan 2024 17:15:58 +0000 (09:15 -0800)]
timerfd: Move kern_timerfd_* prototypes to <sys/syscallsubr.h>

5 months agovirtio: Add more device IDs from the specification
Bryan Venteicher [Wed, 31 Jan 2024 05:02:59 +0000 (23:02 -0600)]
virtio: Add more device IDs from the specification

5 months agoacpica: Import ACPICA 20230628
Jung-uk Kim [Tue, 30 Jan 2024 21:49:20 +0000 (16:49 -0500)]
acpica: Import ACPICA 20230628

(cherry picked from commit ef3ba9d625927fd4592a8c071698a562821485bd)

5 months agoacpica: Import ACPICA 20230331
Jung-uk Kim [Tue, 30 Jan 2024 21:43:45 +0000 (16:43 -0500)]
acpica: Import ACPICA 20230331

(cherry picked from commit 8e013e1e3b81740266738226667431cf5c28b17a)

5 months agocxgbe tom: Enable ULP_MODE_TCPDDP on demand
John Baldwin [Wed, 31 Jan 2024 00:41:43 +0000 (16:41 -0800)]
cxgbe tom: Enable ULP_MODE_TCPDDP on demand

Most ULP modes in cxgbe's TOE are enabled on the fly when a protocol
is needed (e.g. ULP_MODE_ISCSI is enabled by cxgbei when offloading a
connection using iSCSI, and ULP_MODE_TLS is enabled when RX TLS keys
are programmed for a TOE connection).  The one exception to this is
ULP_MODE_TCPDDP.

Currently the cxgbe driver enables ULP_MODE_TCPDDP when a TOE
connection is first created.  However, since DDP connections cannot be
converted to other connection types, this requires some special
handling in the driver.  For example, iSCSI daemons use the SO_NO_DDP
socket option to ensure TOE connections use ULP_MODE_NONE so they can
be converted to ULP_MODE_ISCSI.  Similarly, using TLS receive offload
(ULP_MODE_TLS) requires disabling TCP DDP for new connections by
default.

This commit changes cxgbe to instead switch a connection from
ULP_MODE_NONE to ULP_MODE_TCPDDP when a connection first attempts to
use TCP DDP via aio_read(2).  This permits connections to always start
as ULP_MODE_NONE and switch to a protocol-specific mode as needed.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43670

5 months agocxgbe tom: Limit TOE connections to 2 reassembly islands always
John Baldwin [Wed, 31 Jan 2024 00:41:23 +0000 (16:41 -0800)]
cxgbe tom: Limit TOE connections to 2 reassembly islands always

Previously this was only limited on T6 cards to support switching from
ULP_MODE_NONE to ULP_MODE_TLS.  To support switching to
ULP_MODE_TCPDDP, enable this for all adapters.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43669

5 months agocxgbe: Add counters for POSIX async I/O requests handled by the driver
John Baldwin [Wed, 31 Jan 2024 00:40:31 +0000 (16:40 -0800)]
cxgbe: Add counters for POSIX async I/O requests handled by the driver

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43668

5 months agosyscallsubr.h: Sort kern_membarrier prototype alphabetically
John Baldwin [Wed, 31 Jan 2024 00:38:29 +0000 (16:38 -0800)]
syscallsubr.h: Sort kern_membarrier prototype alphabetically

5 months agozfs: merge openzfs/zfs@2e6b3c4d9
Martin Matuska [Tue, 30 Jan 2024 22:52:29 +0000 (23:52 +0100)]
zfs: merge openzfs/zfs@2e6b3c4d9

Notable upstream pull request merges:
 #15793 401c3563d libzfs: use zfs_strerror() in place of strerror()
 #15793 692f0daba libzfs: make userquota_propname_decode threadsafe
 #15798 0cbf13529 libnvpair.c: replace strstr() with strchr() for a single
                  character
 #15812 78e8c1f84 Remove list_size struct member from list implementation
 #15816 aeb33776f Update vdev devid and physpath if changed between imports
 #15818 8161b7327 Don't assert mg_initialized due to device addition race
 #15823 c3fd7a521 Update man pages to time(1) from time(2)
 #15825 884a48d99 zpool wait: print timestamp before the header

Obtained from: OpenZFS
OpenZFS commit: 2e6b3c4d9453360a351af6148386360a3a7209b3

5 months agosys/mount.h: use __inline
Konstantin Belousov [Tue, 30 Jan 2024 22:14:25 +0000 (00:14 +0200)]
sys/mount.h: use __inline

instead of plain inline, for C89

Reported by: antoine
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 months agoshare/man: Add mandoc.db files to METALOG
Jessica Clarke [Tue, 30 Jan 2024 22:17:34 +0000 (22:17 +0000)]
share/man: Add mandoc.db files to METALOG

Otherwise these are omitted for -DNO_ROOT builds, whether for disk
images or dist tarballs.

Reviewed by: brooks, emaste
Differential Revision: https://reviews.freebsd.org/D43676