FreeBSD/src f7717bbcrypto/openssl BSDmakefile, crypto/openssl/freebsd dump_version_from_configdata.pl

OpenSSL: install .pc files from the exporters subdir

The .pc files generated in the root directory are used as part of the
build; they should never be installed. Use the versions from the
exporters subdirectory--which should be installed--as the .pc files
which are distributed with FreeBSD. This avoids the need for "fixing up"
these files after the fact (see `crypto/openssl/BSDmakefile` for more
details as part of this change).

Garbage collect `secure/lib/libcrypto/Makefile.version`, et al,
as they're orphaned files. They were technically unused prior to this
change as the vendor process properly embeds the version numbers in
various files, but this commit formalizes the removal.

This correction/clarification on the .pc files will be made in an
upcoming release of OpenSSL [1].

References:
1. https://github.com/openssl/openssl/issues/28803

    [8 lines not shown]
DeltaFile
+0-21crypto/openssl/freebsd/dump_version_from_configdata.pl
+0-20crypto/openssl/BSDmakefile
+3-9secure/lib/libcrypto/Makefile.inc
+0-2secure/lib/libcrypto/Makefile.version
+3-524 files

FreeBSD/src 1b0202bcrypto .gitignore, crypto/openssl configdata.pm libcrypto.pc

crypto/openssl: remove autogenerated files

These files contain build host paths and other configuration details
that can be regenerated via the standard vendor import process. Don't
clutter up the FreeBSD tree with these files.

Add the paths to .gitignore to prevent them from accidentally being
added in a future update.

Approved by:    re (cperciva)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D53044

(cherry picked from commit d271d2ce152435b14e309bd8b25f47a0f4a2040f)
(cherry picked from commit 0d5ef734e91e6b03312b54ab3463ed5608ed27fa)
DeltaFile
+0-36,871crypto/openssl/configdata.pm
+0-133crypto/openssl/util/wrap.pl
+78-0crypto/.gitignore
+0-13crypto/openssl/libcrypto.pc
+0-11crypto/openssl/libssl.pc
+0-9crypto/openssl/openssl.pc
+78-37,0376 files

FreeBSD/src a7c692eetc/mtree BSD.tests.dist, secure/lib/libcrypto Makefile

openssl: add a simple smoke test for the legacy provider

This change adds a simple smoke test for the legacy provider to ensure
that the provider doesn't break in the future when performing updates.

This is not a functional or system test; the OpenSSL test suite does a
much better job at doing this than we can.

Approved by:    re (cperciva)
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D53045

(cherry picked from commit 3b6442370a17c57c4c290b9a8e1e8328da820705)
(cherry picked from commit 9b3c89ce8b2b6455d50e364708988c832672a042)
DeltaFile
+40-0secure/lib/libcrypto/tests/libcrypto_test.sh
+5-0secure/lib/libcrypto/tests/Makefile
+3-0secure/lib/libcrypto/Makefile
+2-0etc/mtree/BSD.tests.dist
+50-04 files

FreeBSD/src af0eda4crypto/openssl configdata.pm, crypto/openssl/include/openssl opensslv.h

crypto/openssl: update generated files to match 3.5.4 artifacts

Approved by:    re (cperciva)
MFC with:       046c625e9382
Fixes:          046c625e9382 ("crypto/openssl: update to 3.5.4")
Reported by:    Herbert J. Skuhra <herbert at gojira.at>

(cherry picked from commit d4033e6d37747f5213bb245c8e605406703a8766)
(cherry picked from commit 505aec2bf3b1576fd9b6dad5d6c9a6522e20ad92)
DeltaFile
+560-9crypto/openssl/configdata.pm
+10-11secure/lib/libcrypto/man/man3/DEFINE_STACK_OF.3
+7-7crypto/openssl/include/openssl/opensslv.h
+6-6secure/lib/libcrypto/man/man3/SSL_SESSION_get0_hostname.3
+8-2secure/lib/libcrypto/man/man3/OpenSSL_version.3
+3-3secure/lib/libcrypto/man/man3/SSL_CIPHER_get_name.3
+594-38897 files not shown
+1,494-938903 files

FreeBSD/src c0366f9crypto/openssl/providers/fips self_test_kats.c, crypto/openssl/test quicapitest.c sslapitest.c

crypto/openssl: update to 3.5.4

This change includes all necessary changes required to update to OpenSSL
3.5.4.

More information about the 3.5.4 release can be found in the relevant
release notes (see 8e12a5c4eb3507846b5 for more details).

Merge commit '8e12a5c4eb3507846b507d0afe87d115af41df40'

Approved by:    re (cperciva)

(cherry picked from commit 046c625e9382e17da953767b881aaa782fa73af8)
(cherry picked from commit 57d1d2c49707d1d74cdae2946d89bbd427661dca)
DeltaFile
+255-0crypto/openssl/test/recipes/90-test_sslapi_data/ssltraceref-zlib.txt
+253-0crypto/openssl/test/recipes/90-test_sslapi_data/ssltraceref.txt
+100-0crypto/openssl/providers/fips/self_test_kats.c
+9-86crypto/openssl/test/quicapitest.c
+88-0crypto/openssl/test/testutil/compare.c
+87-0crypto/openssl/test/sslapitest.c
+792-8649 files not shown
+1,240-21955 files

FreeBSD/src 27ae9dacrypto/openssl/include/openssl opensslv.h, secure/lib/libcrypto/man/man3 SSL_poll.3 EVP_PKEY_new.3

crypto/openssl: update build artifacts for the 3.5.3 release

This change updates the build artifacts to match the 3.5.3 release. Much
of the change involves updating version numbers and release dates to
match the release version's metadata.

Approved by:    re (cperciva)
MFC after:      1 week
MFC with:       88b8b7f0c4e9948667a2279e78e975a784049cba

(cherry picked from commit d9cc3d558d00ee7f62dbef2032f099033c91d2a1)
(cherry picked from commit 41955f207f506035169451a6d9e8351df9984a97)
DeltaFile
+40-47secure/lib/libcrypto/man/man7/OSSL_PROVIDER-FIPS.7
+28-1secure/lib/libcrypto/man/man7/provider-base.7
+15-11secure/lib/libcrypto/man/man3/SSL_poll.3
+7-12crypto/openssl/include/openssl/opensslv.h
+6-12secure/lib/libcrypto/man/man5/fips_config.5
+14-2secure/lib/libcrypto/man/man3/EVP_PKEY_new.3
+110-85897 files not shown
+1,078-1,036903 files

FreeBSD/src 136987fcrypto/openssl/doc/man7 OSSL_PROVIDER-FIPS.pod, crypto/openssl/providers/fips self_test_data.inc

crypto/openssl: update component to 3.5.3

This change updates the sources for crypto/openssl. The subsequent
commit will update the build artifacts to match the 3.5.3 release.

More details about the update can be found in the related vendor branch
commits.

Approved by:    re (cperciva)
MFC after:      1 week
Merge commit 'aed904c48f330dc76da942a8ee2d6eef9d11f572'

(cherry picked from commit 779e075df98da07468ec5dd13b44241110a2abf2)
DeltaFile
+540-8crypto/openssl/test/fake_rsaprov.c
+288-1crypto/openssl/test/provider_pkey_test.c
+117-104crypto/openssl/providers/fips/self_test_data.inc
+116-11crypto/openssl/test/crltest.c
+110-1crypto/openssl/test/x509_test.c
+42-56crypto/openssl/doc/man7/OSSL_PROVIDER-FIPS.pod
+1,213-181152 files not shown
+2,699-647158 files

FreeBSD/src 2e31b96crypto/openssl BSDmakefile

crypto/openssl: apply polish to new vendor import process

This change does the following 2 things:
- Makes the build more repeatable by isolating the environment. This
  prevents bmake from leaking variables into gmake and makes the overall
  process a bit more robust.
- Add debug printouts to make the process more straightforward to the
  reader and whoever is executing doing the current vendor import.

Approved by:    re (cperciva)
MFC after: 1 month
Differential Revision:  https://reviews.freebsd.org/D52420

(cherry picked from commit d18058b7b850c78f2ca1be746ab411c0bed5acc9)
(cherry picked from commit 22382d9e706baddac193f66c3a48b086fc53e98c)
DeltaFile
+44-27crypto/openssl/BSDmakefile
+44-271 files

FreeBSD/src 8b1dd80secure/lib/libcrypto/man/man3 Makefile, secure/lib/libcrypto/man/man7 Makefile

Update the installed manpages to match OpenSSL 3.5.1

Approved by:    re (cperciva)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D52008

(cherry picked from commit fdb3b695a4d19f098367be4fe2df51bec991170d)
(cherry picked from commit 3e979746ab99a2f5c99813cc2083c69fcbadbbb2)
DeltaFile
+2,901-2,082secure/lib/libcrypto/man/man3/Makefile
+2-36secure/lib/libcrypto/man/man7/Makefile
+2,903-2,1182 files

FreeBSD/src 508f9b6sys/netpfil/ipfw/pmod tcpmod.c

ipfw: pmod: avoid further rule processing after tcp-mod failures

m_pullup() here will have freed the mbuf chain, but we pass back an
IP_FW_DENY without any signal that the outer loop should finish.  Thus,
rule processing continues without an mbuf and there's a chance that we
conclude that the packet may pass (but there's no mbuf remaining)
depending on the rules that follow it.

Approved by:    re (cperciva)
PR:             284606
Reviewed by:    ae

(cherry picked from commit c0382512bfce872102d213b9bc2550de0bc30b67)
(cherry picked from commit 21d55ae111aada3c5426632253ad8df9103d3423)
DeltaFile
+16-9sys/netpfil/ipfw/pmod/tcpmod.c
+16-91 files

FreeBSD/src 290b9b6usr.bin/id id.c

id: Fix WITHOUT_AUDIT build

Rather than add more ifdefs, trust the compiler to optimize Aflag away.

Approved by:    re (cperciva)
Fixes:          70b72ede982f ("id: Clean up")
PR:             290740
MFC after:      3 days

(cherry picked from commit 92a533ed1d3c81a772815f90cc9aff9237a4429c)
(cherry picked from commit 05a3f80efe91b2cb9856ffd6c4a68d06117da824)
DeltaFile
+2-8usr.bin/id/id.c
+2-81 files

FreeBSD/src 4e80f9fsys/cddl/dev/fbt/aarch64 fbt_isa.c

dtrace/arm64: properly traverse the symbol table

LINKER_EACH_FUNCTION_NAMEVAL() stops processing the symbol table if a
callback function returns a non-zero value.

The fbt_provide_module_function() callback should not return 1 when
ignoring symbols. Instead, always return 0, as in dtrace/x86.

Approved by:    re (cperciva)
Fixes:          30b68ecda84e ("Changes that improve DTrace FBT reliability on freebsd/arm64:")
Reviewed by:    markj, oshogbo
Approved by:    oshogbo (mentor)
Obtained from:  CheriBSD
Differential Revision: https://reviews.freebsd.org/D53399

(cherry picked from commit 2acdec9e4d915ec61d0ca45b408f9beb7aa4b772)
(cherry picked from commit 76a0a5f91d2c8f30760cb223d732863761e268a9)
DeltaFile
+1-1sys/cddl/dev/fbt/aarch64/fbt_isa.c
+1-11 files

FreeBSD/src 72777e9sys/netinet6 mld6.c

mld6: Properly initialize MLD packet options

After commit 530c2c30b0c7 we need to set flags to ensure that hop-by-hop
and hop limit options are included.

Approved by:    re (cperciva)
PR:             290407
Reviewed by:    zlei, markj
MFC after:      3 days
Fixes:          530c2c30b0c7 ("ip6_output: Reduce cache misses on pktopts")

(cherry picked from commit 5568fba657c260286b9f1f1e837ab83ef6ce572d)
(cherry picked from commit 5c4144fe1f41b16368a3785b7edd6d2d70c24d1b)
DeltaFile
+1-0sys/netinet6/mld6.c
+1-01 files

FreeBSD/src 6e1d440etc/mtree BSD.include.dist

mtree: Remove stray atm directory

ATM support for netgraph was removed in af0cc0b22362 ("NgATM: Remove
netgraph ATM support")

Remove the directory from the mtree specification.

Approved by:    re (cperciva)
Reviewed by:    emaste
Fixes:  21735dfaebdf ("include: Remove no longer existing netgraph/atm")
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D53260

(cherry picked from commit 8e8ee8bbe2a112f7d1cc1b005dbdb8868522b640)
(cherry picked from commit 002ce2c9d081cad959606fd4793e4287d7d299e0)
DeltaFile
+0-2etc/mtree/BSD.include.dist
+0-21 files

FreeBSD/src eef41b0etc/mtree BSD.include.dist

mtree: Remove stray wi directory

Approved by:    re (cperciva)
Reviewed by:    imp, emaste
Fixes:  a21def4d568f ("pccard: Remove wi(4) driver")
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D53264

(cherry picked from commit f942a7465469008f7538436a70f15a44cabecbb0)
(cherry picked from commit 0b45751456aa3411deef96b9f245359005d5ebd2)
DeltaFile
+0-2etc/mtree/BSD.include.dist
+0-21 files

FreeBSD/src 433730cetc/mtree BSD.include.dist

mtree: Remove stray an (Aironet) directory

Approved by:    re (cperciva)
Reviewed by:    imp
Fixes:  663b174b5b53 ("an: Remove driver")
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D53265

(cherry picked from commit f7ccf051016fe3989ef6fbf10adea3ce4131f91b)
(cherry picked from commit 3281756a24e24da3cb0f6a41cecfdf6c74a74532)
DeltaFile
+0-2etc/mtree/BSD.include.dist
+0-21 files

FreeBSD/src 593f5b2lib/libpam/static_libpam Makefile

static_libpam: Don't install pam.d.5 twice

static_libpam's Makefile includes libpam's Makefile after setting some
variables (like MAN) to empty to avoid installing the manpages twice.
After commit 031e711647c3, it neglected to do this for MANNODEVLINKS,
causing pam.d.5.gz to be installed twice.  This is harmless for
installworld, but breaks some things that rely on METALOG (NO_ROOT
installs) since it causes two METALOG entries to be generated for
the same file.

Approved by:    re (cperciva)
Fixes:  031e711647c3 ("packages: Install development manpages in the -dev package")
MFC after:      3 days
PR:             290708
Reported by:    emaste
Reviewed by:    emaste
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D53512


    [2 lines not shown]
DeltaFile
+1-0lib/libpam/static_libpam/Makefile
+1-01 files

FreeBSD/src 88c5a49sbin/ifconfig ifbridge.c

ifconfig: Fix invalid free() in ifbridge

parse_vlans() does 's = strdup(str)', then calls strsep(&s, ...), then
attempts to free(s) at the end of the function.  For the success case,
this is fine (s is NULL, so it's a trivial memory leak), but in the
error case, we will attempt to free an invalid pointer.

Fix this by storing the original return value from strdup() and freeing
that instead.

Approved by:    re (cperciva)
MFC after:      3 seconds
Reported by:    David Gwynne <dlg at openbsd.org>
Reviewed by:    zlei, kevans
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D53545

(cherry picked from commit 0899f7a3b791ed4878e7cb3859636ec980c76832)
(cherry picked from commit fe2e534433778c038138510ff6a8f07066e72703)
DeltaFile
+5-3sbin/ifconfig/ifbridge.c
+5-31 files

FreeBSD/src 4fbf901crypto/openssh misc.c

openssh: Handle localtime_r() failure by return "UNKNOWN-TIME"

Apply openssh-portable commit 8b6c1f402feb by deraadt at openbsd.org

Obtained from:  openssh-portable
PR:             288773
Reported by:    wosch
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit ce03706ab26c5770150f1ef96aca36b69baa535f)
(cherry picked from commit 0a45aa9e954acc75484d59ad42ee440aa7f034c7)
DeltaFile
+4-2crypto/openssh/misc.c
+4-21 files

FreeBSD/src 0a45aa9crypto/openssh misc.c

openssh: Handle localtime_r() failure by return "UNKNOWN-TIME"

Apply openssh-portable commit 8b6c1f402feb by deraadt at openbsd.org

Obtained from:  openssh-portable
PR:             288773
Reported by:    wosch
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit ce03706ab26c5770150f1ef96aca36b69baa535f)
DeltaFile
+4-2crypto/openssh/misc.c
+4-21 files

FreeBSD/src 58f534eusr.bin/truss syscalls.c

truss: Properly display first argument to nmount

The first argument to nmount(2) is an nvlist in the form of an iovec,
which truss already knows how to decode.  Set the correct flag so
this happens automatically.

MFC after:      1 week
PR:             290667

(cherry picked from commit b9f848ecbafce4e56ba9c8b7993b85347e83484a)
DeltaFile
+1-1usr.bin/truss/syscalls.c
+1-11 files

FreeBSD/src df381besbin/ipf/libipf interror.c, sys/netpfil/ipfilter/netinet ip_htable.c

ipfilter: Don't trust userland supplied iph_size

ipf_htable_create() trusts a user-supplied iph_size from iphtable_t
and computes the allocation size as iph->iph_size * sizeof(*iph->iph_table)
without checking for integer overflow. A sufficiently large iph_size
causes the multiplication to wrap, resulting in an under-sized allocation
for the table pointer array. Subsequent code (e.g., in ipf_htent_insert())
can then write past the end of the allocated buffer, corrupting kernel
memory and causing DoS or potential privilege escalation.

This is not typically a problem when using the ipfilter provided
userland tools as calculate the correct lengths. This mitigates a
rogue actor calling ipfilter ioctls directly.

Reported by:            Ilja Van Sprundel <ivansprundel at ioactive.com>
Reviewed by:            markj
MFC after:              1 week
Differential revision:  https://reviews.freebsd.org/D53286
DeltaFile
+9-0sys/netpfil/ipfilter/netinet/ip_htable.c
+2-0sbin/ipf/libipf/interror.c
+11-02 files

FreeBSD/src f3b94f4sys/netpfil/ipfilter/netinet ip_htable.c ip_htable.h

ipfilter: Add an htable max size tuneable.

Add an ipfilter runtime option (ipf -T) to adjust the default
maximum hash table size. Default it to 1024 entries. It will be
used by a subsequent commit to limit any damage due to excessively
large hash table input by the user.

Reviewed by:            markj
MFC after:              1 week
Differential revision:  https://reviews.freebsd.org/D53284
DeltaFile
+7-0sys/netpfil/ipfilter/netinet/ip_htable.c
+2-0sys/netpfil/ipfilter/netinet/ip_htable.h
+9-02 files

FreeBSD/src c572627sys/netpfil/ipfilter/netinet ip_htable.c

ipfilter: Add htable (hash table) tunable

This is in preparation for addition of a hash table max size.

Reviewed by:            markj
MFC after:              1 week
Differential revision:  https://reviews.freebsd.org/D53283
DeltaFile
+27-0sys/netpfil/ipfilter/netinet/ip_htable.c
+27-01 files

FreeBSD/src ab3c985sbin/ipf/libipf interror.c

ipfilter: Calculate the number of elements in ipf_errors

It serves no purpose to manually manage the IPF_NUM_ERRORS count.
Calculate it instead.

Reviewed by:            emaste, markj
MFC after:              1 week
Differential revision:  https://reviews.freebsd.org/D53308
DeltaFile
+2-2sbin/ipf/libipf/interror.c
+2-21 files

FreeBSD/src b775b19usr.bin/truss syscalls.c

truss: Properly display first argument to nmount

The first argument to nmount(2) is an nvlist in the form of an iovec,
which truss already knows how to decode.  Set the correct flag so
this happens automatically.

MFC after:      1 week
PR:             290667

(cherry picked from commit b9f848ecbafce4e56ba9c8b7993b85347e83484a)
DeltaFile
+1-1usr.bin/truss/syscalls.c
+1-11 files

FreeBSD/src 6985b90contrib/blocklist/libexec blacklistd-helper

blocklist: Update the blacklistd-helper script

Update the blacklistd-helper script, it provides a better mechanism for
detecting the active packet filter.

This is a direct commit to stable/14, as blacklist has been renamed to
blocklist.

PR:             290645
DeltaFile
+155-17contrib/blocklist/libexec/blacklistd-helper
+155-171 files

FreeBSD/src b781ee1contrib/blacklist/libexec blacklistd-helper

blacklist: Update the blacklistd-helper script

Update the blacklistd-helper script, it provides a better mechanism for
detecting the active packet filter.

This is a direct commit to stable/13, as blacklist has been renamed to
blocklist.

PR:             290645
DeltaFile
+156-19contrib/blacklist/libexec/blacklistd-helper
+156-191 files

FreeBSD/src 768ee6dsys/dev/mmc mmc_fdt_helpers.c

mmc_fdt: handle broken-cd property

The documented properties [1] for card-detection are one of:
 - cd-gpios
 - non-removable
 - broken-cd

In cd_setup() we handle the first two, but not the latter, resulting in
a silently undetected card on an affected system.

To work around this, force cd_disabled when broken-cd is specified, so
that the card detect helper function gets to run. A more complete
solution would implement some kind of polling mechanism to detect the
card's presence or removal.

Some variants of the Allwinner D1, such as the Lichee Rv, specify this
property in the mmc0 device node.

[1] sys/contrib/device-tree/Bindings/mmc/mmc-controller.yaml

    [7 lines not shown]
DeltaFile
+11-0sys/dev/mmc/mmc_fdt_helpers.c
+11-01 files

FreeBSD/src 9bb1c46lib/libpfctl libpfctl.c

libpfctl: fix error handling

In two cases we returned E2BIG where it should have been a boolean ('false').

MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+2-2lib/libpfctl/libpfctl.c
+2-21 files