Commit graph

22357 commits

Author SHA1 Message Date
Martin Matuska 3a77c21a25 libarchive: merge from vendor branch
Libarchive 3.7.4 + three fixes from master

Security fixes:
 #2135 rar: Fix OOB in rar e8 filter (CVE-2024-26256)
 #2145 zip: Fix out of boundary access
 #2148 rar: Fix OOB in rar delta filter
 #2149 rar: Fix OOB in rar audio filter

Important bugfixes:
 #2131 7zip: Limit amount of properties
 #2110 bsdtar: Fix error handling around strtol() usages
 #2116 passphrase: Never allow empty passwords
 #2124 rar: Fix "File CRC Error" when extracting specific rar4 archives
 #2123 xar: Avoid infinite link loop
 #2150 xar: Fix another infinite loop and expat error handling
 #2108 zip: Update AppleDouble support for directories
 #2071 zstd: Implement core detectiongit

PR:	278662 (exp-run)

(cherry picked from commit 13d826ff94)
2024-05-04 13:54:42 +02:00
Martin Matuska 43a6a8b077 libarchive: add two missing package files to libarchive tests
(cherry picked from commit 7d03ec3306)
2024-05-04 13:53:07 +02:00
Martin Matuska aa2aad0492 libarchive: merge from vendor branch
Libarchive 3.7.3

New features:
  #1941 uudecode filter: support file name and file mode in raw mode
  #1943 7-zip reader: translate Windows permissions into UNIX
        permissions
  #1962 zstd filter now supports the "long" write option
  #2012 add trailing letter b to bsdtar(1) substitute pattern
  #2031 PCRE2 support
  #2054 add support for long options "--group" and "--owner" to tar(1)

Security fixes:
  #2101 Fix possible vulnerability in tar error reporting introduced
        in f27c173

Important bugfixes:
  #1974 ISO9660: preserve the natural order of links
  #2105 rar5: fix infinite loop if during rar5 decompression the last
        block produced no data
  #2027 xz filter: fix incorrect eof at the end of an lzip member
  #2043 zip: fix end-of-data marker processing when decompressing zip
        archives

(cherry picked from commit b9128a37fa)
2024-05-04 13:53:07 +02:00
Martin Matuska 2772835855 unzip: swtich to bsdunzip from libarchive
Unzip from FreeBSD has been ported to libarchive.
Change usr.bin/unzip to use bsdunzip from libarchive.

Differential Revision:	https://reviews.freebsd.org/D41239
PR:			272845 (exp-run)

(cherry picked from commit b5a3a89c50)
2024-05-04 13:53:07 +02:00
Martin Matuska cd09ca5e71 libarchive: merge from vendor branch
Libarchive 3.7.0

Important changes (relevant to FreeBSD):
  #1814 Do not account for NULL terminator when comparing with "TRAILER!!!"
  #1818 Add ability to produce multi-frame zstd archives
  #1840 year 2038 fix for pax archives on platforms with 64-bit time_t
  #1860 Make single bit bitfields unsigned to avoid clang 16 warning
  #1869 Fix FreeBSD builds with WARNS=6
  #1873 bsdunzip ported to libarchive from FreeBSD
  #1894 read support for zstd compression in 7zip archives
  #1918 ARM64 filter support in 7zip archives

(cherry picked from commit e64fe029e9)
2024-05-04 13:53:07 +02:00
Pierre Pronchery d2291dbb3c libarchive: Avoid a build failure with OpenSSL 3.0
This is a minimal workaround; a proper fix will come via a future update
from upstream.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e23d45187b)
2024-05-04 13:53:07 +02:00
Pierre Pronchery 9377240725 libarchive: Request the OpenSSL 1.1 API
OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in
use for the purpose of hiding deprecated interfaces and enabling
the appropriate deprecation notices.

This change is a NFC while we're still using OpenSSL 1.1.1 but will
avoid deprecation warnings upon the switch to OpenSSL 3.0.

A future update should migrate to use the OpenSSL 3.0 APIs.

PR:		271615
Reviewed by:	emaste
Event:		Kitchener-Waterloo Hackathon 202305
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 5a7500dab9)
2024-05-04 13:53:07 +02:00
John Baldwin ffd190f223 libarchive: Remove MIPS build glue.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39329

(cherry picked from commit f40b617e15)
2024-05-04 13:53:07 +02:00
Jessica Clarke 89342dba7d jevents: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15
macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after:	1 week

(cherry picked from commit d8c84215d7)
2024-05-02 21:11:52 +01:00
Alex Richardson f16e205c6f jevents: fix bootstrapping on Linux with Clang 16
The glibc fts_open() callback type does not have the second const
qualifier and it appears that Clang 16 errors by default for mismatched
function pointer types. Add an ifdef to handle this case.

Reviewed By:	imp, emaste
Differential Revision: https://reviews.freebsd.org/D43000

(cherry picked from commit 60e845ceef)
2024-05-02 21:11:52 +01:00
Dag-Erling Smørgrav 3f59eb3141 libulog: Make sure ut_line, ut_user, ut_host are terminated.
MFC after:	3 days
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D45004

(cherry picked from commit c28253ecde)
2024-05-02 11:08:36 +02:00
Konstantin Belousov 509819691c libc_private.h: use private namespace name for size_t
This is direct commit to stable/13.

(cherry picked from commit a951992d1e)
2024-04-30 04:15:47 +03:00
Konstantin Belousov f0e8600d71 libc printf_render_errno(): do not use strerror()
(cherry picked from commit aa66995b4c)
2024-04-30 03:49:53 +03:00
Konstantin Belousov fcac864ee1 libc: minor style, wrap long lines
(cherry picked from commit bac9d7e8f2)
2024-04-30 03:49:53 +03:00
Konstantin Belousov 27e54c9f16 __vprintf(): switch from strerror() to strerror_rl()
PR:	278556

(cherry picked from commit f887667694)
2024-04-30 03:49:53 +03:00
Konstantin Belousov a8ae94b9e2 libc: make strerror_rl() usable for libc
(cherry picked from commit 92771bc00a)
2024-04-30 03:49:52 +03:00
Alexander Motin a36b9f2442 libpmc: Import AMD Zen 4 PMU events
MFC after:	1 week

(cherry picked from commit 278d695094)
2024-04-26 23:02:51 -04:00
Dimitry Andric 7929070fb7 Merge llvm-project release/18.x llvmorg-18.1.4-0-ge6c3289804a6
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.4-0-ge6c3289804a6.

PR:		276104
MFC after:	3 days

(cherry picked from commit dfa39133b3)
2024-04-23 19:33:14 +02:00
Brooks Davis 82d22a88c3 libgcc_{eh,s}: restore __*_frame_info symbols post llvm18
The upstream llvm commit 5eb44df1b64d made the addition of these GCC
compatability symbols dependent on build configuration rather than
hardcoded for amd64, i386, and powerpc.  Reenable them.

Reviewed by:	dim
Differential Revision:	https://reviews.freebsd.org/D44877

(cherry picked from commit 0b9e358580)
2024-04-20 12:29:10 +02:00
Dimitry Andric 50fd2fbec9 libcompiler_rt Makefile.inc: update _Float16/__bf16 checks
Clang supports __bf16 for riscv from version 18.0 onwards, so update the
checks for it. While here, rewrite the checks so they are hopefully more
readable, and also handle gcc a little better.

In addition, define COMPILER_RT_HAS_FLOAT16 and COMPILER_RT_HAS_BFLOAT16
when these features should be available, since there are some parts in
compiler-rt that check for these defines.

PR:		276104
MFC after:	1 month

(cherry picked from commit f276adc148)
2024-04-20 12:29:10 +02:00
Dimitry Andric 3f0f6c9806 libllvm: add missed tlbgen headers and sources for BPF target
Noticed by:	vishwin
PR:		276104
MFC after:	1 month

(cherry picked from commit 442d351bd2)
2024-04-20 12:29:09 +02:00
Dimitry Andric 7334d08a3a libcompiler_rt Makefile.inc: include bsd.compiler.mk to fix build
Apparently libgcc_s has always included libcompiler_rt's Makefile.inc
without first including bsd.compiler.mk, even though Makefile.inc used
COMPILER_TYPE already. It looks like we were just lucky that the
expression was not malformed.

PR:		276104
Reported by:	Herbert J. Skuhra <herbert@gojira.at>
MFC after:	1 month

(cherry picked from commit 4c983a2886)
2024-04-20 12:29:09 +02:00
Dimitry Andric e2e4022725 libcompiler_rt Makefile.inc: don't build bfloat16 support for gcc < 13
Older versions of gcc produce "error: unknown type name '__bf16'".

PR:		276104
MFC after:	1 month

(cherry picked from commit 2e226748a9)
2024-04-20 12:29:09 +02:00
Dimitry Andric 5018444b28 libcompiler_rt Makefile.inc: remove debugging messages
PR:		276104
MFC after:	1 month

(cherry picked from commit d00b9344bb)
2024-04-20 12:29:09 +02:00
Dimitry Andric 3a287a03cf Merge llvm-project release/18.x llvmorg-18.1.3-0-gc13b7485b879
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.3-0-gc13b7485b879.

PR:		276104
MFC after:	1 month

(cherry picked from commit 439352ac82)
2024-04-19 23:24:48 +02:00
Dimitry Andric b09953d54d Merge llvm-project release/18.x llvmorg-18.1.1-0-gdba2a75e9c7e
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.1-0-gdba2a75e9c7e.

PR:		276104
MFC after:	1 month

(cherry picked from commit 4c2d3b022a)
2024-04-19 23:24:47 +02:00
Dimitry Andric 7032a43521 Merge llvm-project release/18.x llvmorg-18.1.0-rc3-0-g6c90f8dd5463
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.0-rc3-0-g6c90f8dd5463.

PR:		276104
MFC after:	1 month

(cherry picked from commit 56727255ad)
2024-04-19 23:24:47 +02:00
Dimitry Andric c80674ff65 Merge llvm-project release/18.x llvmorg-18.1.0-rc2-53-gc7b0a6ecd442
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.0-rc2-53-gc7b0a6ecd442.

PR:		276104
MFC after:	1 month

(cherry picked from commit 74626c16ff)
2024-04-19 23:24:47 +02:00
Dimitry Andric 83e37ae556 Merge llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967.

PR:		276104
MFC after:	1 month

(cherry picked from commit b3edf44679)
2024-04-19 23:24:46 +02:00
Dimitry Andric a1f98ae0a8 Merge llvm-project release/18.x llvmorg-18-init-18361-g22683463740e
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18-init-18361-g22683463740e.

PR:		276104
MFC after:	1 month

(cherry picked from commit 878ed4957e)
2024-04-19 23:24:45 +02:00
Dimitry Andric ab50317e96 Merge llvm-project main llvmorg-18-init-18359-g93248729cfae
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-18359-g93248729cfae, the
last commit before the upstream release/18.x branch was created.

PR:		276104
MFC after:	1 month

(cherry picked from commit 7a6dacaca1)
2024-04-19 23:24:44 +02:00
Dimitry Andric 52e4ee64c2 Merge llvm-project main llvmorg-18-init-16864-g3b3ee1f53424
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-16864-g3b3ee1f53424.

PR:		276104
MFC after:	1 month

(cherry picked from commit 297eecfb02)
2024-04-19 23:24:43 +02:00
Dimitry Andric ed89c59104 Merge llvm-project main llvmorg-18-init-16595-g7c00a5be5cde
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-16595-g7c00a5be5cde.

PR:		276104
MFC after:	1 month

(cherry picked from commit 1db9f3b21e)
2024-04-19 23:24:41 +02:00
Dimitry Andric 0c85e2760f Merge llvm-project main llvmorg-18-init-16003-gfc5f51cf5af4
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-16003-gfc5f51cf5af4.

PR:		276104
MFC after:	1 month

(cherry picked from commit 647cbc5de8)
2024-04-19 23:24:24 +02:00
Dimitry Andric a205596100 Merge llvm-project main llvmorg-18-init-15692-g007ed0dccd6a
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-15692-g007ed0dccd6a.

PR:		276104
MFC after:	1 month

(cherry picked from commit cb14a3fe51)
2024-04-19 23:23:58 +02:00
Dimitry Andric bdbe302c33 Merge llvm-project main llvmorg-18-init-15088-gd14ee76181fb
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-15088-gd14ee76181fb.

PR:		276104
MFC after:	1 month

(cherry picked from commit 5f757f3ff9)
2024-04-19 23:23:40 +02:00
Xin LI 728293e74c Backport export of lzma_mt_block_size symbol.
This restores binary compatibility against liblzma 5.6.0 library.

PR:		278127

(cherry picked from commit 5ffb19ac36)
2024-04-07 21:06:13 -07:00
Xin LI 6b55e41b3f Revert "MFV: xz 5.6.0"
This commit reverts 8db56defa7,
rolling back the vendor import of xz 5.6.0 and restoring the
package to version 5.4.5.

The revert was not directly due to the attack (CVE-2024-3094):
our import process have removed the test cases and build scripts
that would have enabled the attack. However, reverting would
help to reduce potential confusion and false positives from
security scanners that assess risk based solely on version
numbers.

Another commit will follow to restore binary compatibility with
the liblzma 5.6.0 library by making the previously private
symbol (lzma_mt_block_size) public.

PR:		278127

(cherry picked from commit 2f9cd13d6c)
2024-04-07 21:06:12 -07:00
Dag-Erling Smørgrav 662dc74155 tzcode: Clean up the ctime(3) manual page.
MFC after:	3 weeks
Sponsored by:	Klara, Inc.
Reviewed by:	pauamma_gundo.com
Differential Revision:	https://reviews.freebsd.org/D39714

(cherry picked from commit 6f3c2f41b1)

libc: Improve description of mktime() / timegm().

* Mention that mktime() and timegm() set errno on failure.
* Correctly determining whether mktime() / timegm() succeeded with
  arbitrary input (where -1 can be a valid result) is non-trivial.
  Document the recommended procedure.

PR:		277863
MFC after:	1 week
Reviewed by:	pauamma_gundo.com, gbe
Differential Revision:	https://reviews.freebsd.org/D44503

(cherry picked from commit 7534109d13)
2024-04-04 11:51:02 +02:00
Dag-Erling Smørgrav 16349f296b Update tzcode to 2024a.
MFC after:	3 weeks
Sponsored by:	Klara, Inc.

(cherry picked from commit 46c599340f)
2024-04-04 11:47:10 +02:00
Ka Ho Ng c89889b9c3 libfetch: parse scheme://domain:/ correctly
This improves URL-parsing compability with cURL, and unbreaks parsing of
similar kinds of URLs after commit 8d9de5b10a.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	des
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44493

(cherry picked from commit fb860ed0c5)
2024-04-03 15:12:38 -04:00
Gordon Bergling 285f941478 xdr(3): Fix a few typos in source code comments
- s/reoutines/routines/
- s/paraemters/parameters/

Obtained from:	NetBSD

(cherry picked from commit 577a721d05)
2024-03-26 06:56:48 +01:00
Konstantin Belousov ed995c67e0 wmemchr(3): fix prototypes for wcpcpy() and wcpncpy()
PR:	277855

(cherry picked from commit 69d5783ae8)
2024-03-24 07:13:20 +02:00
Dimitry Andric 5c588a23c9 Slightly reorganize libclang_rt Makefile again
Make a separate .elif section for MACHINE_ARCH==powerpc, and subdivide
the MACHINE_CPUARCH values under it. If at some point more sanitizer
libraries become available for powerpc CPU architectures, they can be
added before the "nothing for other powerpc yet" case. Similar for the
MACHINE_ARCH==arm case.

PR:		262706
Fixes:		e77a1bb275
MFC after:	3 days

(cherry picked from commit 897a485c34)
2024-03-24 01:37:29 +01:00
Dimitry Andric 72d9e1e0ca Fix building of several libclang_rt libraries for powerpc64 and powerp64le
I reorganized the libclang_rt Makefile in e77a1bb275 to make it more
readable and maintainable, but the check for 32-bit powerpc was wrong.
This caused almost no libclang_rt libraries to be built for powerpc64
and powerpc64le.

PR:		262706
Reported by:	tuexen
Fixes:		e77a1bb275
MFC after:	3 days

(cherry picked from commit f0620ceecc)
2024-03-24 01:37:23 +01:00
Ed Maste ec44cc4e28 libcasper: fix cap_rights_init usage
Capability rights passed to cap_rights_* are not simple bitmaks and
cannot be ORed together in general (although it will work for certain
subsets of rights).

PR:		277057
Fixes:		faaf43b2a7 ("fileargs: add tests")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 3733d82c4d)
(cherry picked from commit be83aa2a01)
2024-03-22 09:35:44 -04:00
Dag-Erling Smørgrav fb12765e70 libbe: Fix some markup issues.
MFC after:	3 days
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44407

(cherry picked from commit ad99fea904)
2024-03-22 09:07:35 +01:00
Konstantin Belousov 32651946de libthr: remove explicit sys/cdefs.h includes
(cherry picked from commit f8bbbce458)
2024-03-13 02:31:20 +02:00
Brooks Davis 6b7800eea4 liblzma: don't export lzma_lz_decoder_uncompressed
It was removed in the 5.4.0 import.

Reviewed by:	delphij
Differential Revision:	https://reviews.freebsd.org/D44247

(cherry picked from commit 023fa553bf)
2024-03-10 21:54:30 -07:00
Konstantin Belousov c4e18a7ba3 libc posix_spawn(): explain why rtld can be used after fork
(cherry picked from commit 2ce23b1f76)
2024-03-11 02:29:51 +02:00