1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00
Commit Graph

24897 Commits

Author SHA1 Message Date
Robert Clausecker
7ed159c6cc contrib/mandoc: add -isoC-2024 and -svid1 to mdoc(7)
C23 (ISO/IEC 9899:2024) is not out yet, but will be shortly.
SVID1 is needed for the history section of memccpy(3).

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47284
2024-10-26 20:11:02 +02:00
Robert Clausecker
87c2aab0a0 lib/libcrypt: reinstate CFLAGS+=-I${SRCTOP}/sys/crypto/sha2
This is apparently needed for the cross-build from Linux to succeed.

Fixes:		cb5e41b160
2024-10-26 20:11:02 +02:00
Mark Johnston
f44029e322 linker: Make linker.h more self-contained
struct kld_file_stat embeds a reference to MAXPATHLEN, defined in
param.h.

PR:		280432
MFC after:	2 weeks
2024-10-26 14:05:56 +00:00
Ka Ho Ng
72e15f76a1 libkldelf: add see_local parameter to elf_lookup_symbol
This gives the function the ability to return only global symbols.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D47206
2024-10-25 16:20:16 +00:00
Dimitry Andric
bc9e19dce0 Fix buildworld with gcc 12 after llvm-19 import
Unfortunately gcc 12's is not yet capable of compiling all of libc++
19's C++23 code, which results in errors similar to:

  /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/ranges_contains.h:41:3: error: 'static constexpr bool std::__1::ranges::__contains::__fn::operator()(_Iter, _Sent, const _Type&, _Proj)' must be a non-static member function
     41 |   operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) {
        |   ^~~~~~~~
  /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/ranges_contains.h:48:3: error: 'static constexpr bool std::__1::ranges::__contains::__fn::operator()(_Range&&, const _Type&, _Proj)' must be a non-static member function
     48 |   operator()(_Range&& __range, const _Type& __value, _Proj __proj = {}) {
        |   ^~~~~~~~

Until we can get rid of gcc 12, work around this by making it compile
libc++ in C++20 mode instead.

NOTE: The resulting libc++ library will not be C++23 compatible! Please
try to avoid shipping it, and use gcc 13 instead, if you must use gcc.

PR:		280562
MFC after:	3 days
2024-10-25 18:08:32 +02:00
Robert Clausecker
cb5e41b160 lib/libcrypt: unbundle hash functions
libcrypt bundles the various hash functions it needs,
duplicating code that is also found in libmd.
Unbundle the hash functions and apply the same hack used
for libncursesw so static consumers link -lmd in addition
to -lcrypt.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D47062
2024-10-25 16:02:38 +02:00
Robert Clausecker
a2c0d2026f lib/libcrypt: use explicit_bzero() to clear sensitive buffers
Prevent a potentially sufficiently smart compiler from optimising
away our attempts to clear sensitive buffers.

A related change was discussed and rejected in D16059, but I don't
believe the reasoning there applies: the code clearly documents its
intent that the `memset` calls clear sensitive buffers so they don't
hang around.  `explicit_bzero` is the appropriate function for this
purpose.  A potential performance disadvantage seems less important:
the functions in crypt are specifically designed to be slow, so a
few extra calls to guarantee that sensitive buffers are cleared does
not significantly affect runtime.

See also:	D16059
Reviewed by:	delphij, kevans
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47037
2024-10-25 16:02:38 +02:00
Xin LI
3df1abdfd9 Revise qsort(3 reflect POSIX.1-2024 update.
Reviewed by:	emaste, trasz
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D47262
2024-10-25 00:31:50 -07:00
Dimitry Andric
1c83996bed Adjust LLVM_ENABLE_ABI_BREAKING_CHECKS depending on NDEBUG
When assertions are disabled, the upstream build system disables
LLVM_ENABLE_ABI_BREAKING_CHECKS by default. Though the upstream build
system allows it to be force-enabled, it looks like that is not a
well-tested build-time configuration.

Therefore, always disable LLVM_ENABLE_ABI_BREAKING_CHECKS when
assertions are disabled, which will also save some more runtime cost
when people use WITHOUT_LLVM_ASSERTIONS.

PR:		280562
MFC after:	1 month
2024-10-24 11:53:19 +02:00
Li-Wen Hsu
dab59af3bc
Canonicalize the name of the FreeBSD Foundation
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2024-10-24 05:03:07 +08:00
SHENG-YI HONG
514f4e89ac
ncurses: Fix codegen for key names and codes
Adding back arguments, which were missed during the import of ncurses version
6.5, to the code gen awk script.

This is modified from lib_keyname.c and keys.list targets in
contrib/ncurses/ncurses/Makefile.in of
21817992b3

PR:		280697
Reported by:	np
Reviewed by:	bapt
Tested by:	scf
Fixes:		21817992b3 ncurses: vendor import version 6.5
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D47153
2024-10-24 04:39:36 +08:00
Dimitry Andric
5deeebd8c6 Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6,
a.k.a. 19.1.2 release.

PR:		280562
MFC after:	1 month
2024-10-23 20:27:38 +02:00
Dimitry Andric
6e516c87b6 Merge llvm-project release/19.x llvmorg-19.1.1-0-gd401987fe349
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.1-0-gd401987fe349,
a.k.a. 19.1.1 release.

PR:		280562
MFC after:	1 month
2024-10-23 20:27:28 +02:00
Dimitry Andric
c80e69b00d Merge llvm-project release/19.x llvmorg-19.1.0-0-ga4bf6cd7cfb1
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.0-0-ga4bf6cd7cfb1,
a.k.a. 19.1.0 release.

PR:		280562
MFC after:	1 month
2024-10-23 20:27:22 +02:00
Dimitry Andric
6c4b055cfb Merge llvm-project release/19.x llvmorg-19.1.0-rc4-0-g0c641568515a
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.0-rc4-0-g0c641568515a.

PR:		280562
MFC after:	1 month
2024-10-23 20:27:14 +02:00
Dimitry Andric
6298728806 Merge llvm-project release/19.x llvmorg-19.1.0-rc3-0-g437434df21d8
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.0-rc3-0-g437434df21d8.

PR:		280562
MFC after:	1 month
2024-10-23 20:27:07 +02:00
Dimitry Andric
52418fc2be Merge llvm-project release/19.x llvmorg-19.1.0-rc2-0-gd033ae172d1c
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.0-rc2-0-gd033ae172d1c.

PR:		280562
MFC after:	1 month
2024-10-23 20:26:53 +02:00
Dimitry Andric
ff6c844784 libcxx-compat: update libcxx.imp for headers that were reintroduced by reverts
PR:		280562
MFC after:	1 month
2024-10-23 20:26:50 +02:00
Dimitry Andric
2e861daab9 libcxx-compat: install headers that were reintroduced by reverts
PR:		280562
MFC after:	1 month
2024-10-23 20:26:49 +02:00
Dimitry Andric
36b606ae6a Merge llvm-project release/19.x llvmorg-19.1.0-rc1-0-ga4902a36d5c2
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/19.x llvmorg-19.1.0-rc1-0-ga4902a36d5c2.

PR:		280562
MFC after:	1 month
2024-10-23 20:26:26 +02:00
Dimitry Andric
0fca6ea1d4 Merge llvm-project main llvmorg-19-init-18630-gf2ccf80136a0
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-19-init-18630-gf2ccf80136a0, the
last commit before the upstream release/19.x branch was created.

PR:		280562
MFC after:	1 month
2024-10-23 20:26:01 +02:00
Ed Maste
6b9f7133ab libc: Add one more check in new fmemopen test
Reported by:	jrtc27
Fixes: 0953460ce1 ("libc: fix access mode tests in fmemopen(3)")
2024-10-23 13:29:34 -04:00
Ed Maste
0953460ce1 libc: fix access mode tests in fmemopen(3)
Previously a stream opened as read-only could be written to.  Add a test
case for the fix.

Also correct another incorrect access mode check that worked by
accident, and improve the tests for that.

PR:		281953
Reported by:	Erkki Moorits, fuz
Reviewed by:	fuz, khng (earlier)
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47265
2024-10-23 13:11:14 -04:00
Martin Matuska
bd66c1b43e libarchive: merge from vendor branch
Libarchive 3.7.7

Security fixes:
 #2158 rpm: calculate huge header sizes correctly
 #2160 util: fix out of boundary access in mktemp functions
 #2168 uu: stop processing if lines are too long
 #2174 lzop: prevent integer overflow
 #2172 rar4: protect copy_from_lzss_window_to_unp() (CVE-2024-20696)
 #2175 unzip: unify EOF handling
 #2179 rar4: fix out of boundary access with large files
 #2203 rar4: fix OOB access with unicode filenames
 #2210 rar4: add boundary checks to rgb filter
 #2248 rar4: fix OOB in delta filter
 #2249 rar4: fix OOB in audio filter
 #2256 fix multiple vulnerabilities identified by SAST
 #2258 cpio: ignore out-of-range gid/uid/size/ino and harden AFIO parsing
 #2265 rar5: clear 'data ready' cache on window buffer reallocs
 #2269 rar4: fix CVE-2024-26256 (CVE-2024-26256)
 #2330 iso: be more cautious about parsing ISO-9660 timestamps
 #2343 tar: clean up linkpath between entries
 #2364 tar: don't crash on truncated tar archives
 #2366 gzip: prevent a hang when processing a malformed gzip inside a gzip
 #2377 tar: fix two leaks in tar header parsing

Important bugfixes:
 #2096 rar5: report encrypted entries
 #2150 xar: fix another infinite loop and expat error handling
 #2173 shar: check strdup return value
 #2161 lha: fix integer truncation on 32-bit systems
 #2338 tar: fix memory leaks when processing symlinks or parsing pax headers
 #2245 7zip: fix issue when skipping first file in 7zip archive that
       is a multiple of 65536 bytes
 #2252 7-zip: read/write symlink paths as UTF-8
 #2259 rar5: don't try to read rediculously long names
 #2290 ar: fix archive entries having no type
 #2360 tar: fix truncation of entry pathnames in specific archives

CVE:		CVE-2024-20696, CVE-2024-26256
PR:		282047 (exp-run)
MFC after:	1 week
2024-10-20 10:24:02 +02:00
Ed Maste
92cd5abb64 membarrier: man page improvements
Reported by:	fernape (in D46967)
Fixes: 1fc766e3b4 ("membarrier: Add manual page")
Sponsored by:	The FreeBSD Foundation
2024-10-19 16:18:18 -04:00
Enji Cooper
ba23ab2168 Update the expat version referenced in libbsdxml.3
This change updates the version of expat referenced from 2.6.0 to 2.6.3,
correcting documentation post-ffd294a1f4c23863c3e515d16dce31d5509bcb01.

Bump .Dd for the change.

MFC with:	ffd294a1f4
Differential Revision:	https://reviews.freebsd.org/D46865
2024-10-18 17:44:42 -07:00
Jessica Clarke
9684658e35 libc/csu: Unify INIT_RELOCS across architectures
Some architectures don't need any arguments, whilst others need auxargs,
which they get by passing in env thanks to INIT_RELOCS referencing the
local variable in __libc_start1(_gcrt) by name. This is unnecessarily
confusing, fragile (one has to look at INIT_IRELOCS's definition to see
that it uses env) and duplicates code between architectures.

Instead, implement it more like rtld-elf. Each architecture provides an
ifunc_init that takes the auxargs directly, and those that don't need it
can just ignore it.

Reviewed by:	kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D47188
2024-10-19 00:48:52 +01:00
Ka Ho Ng
599c4399e9 libkldelf: use warnx instead of printf
Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46893
2024-10-18 20:21:44 +00:00
Ka Ho Ng
43628a31e3 libkldelf: add elf_lookup_symbol function
The elf_lookup_symbol function looks up the symbol with a given symbol
name. A pointer to the GElf_Sym of the symbol is returned if the symbol
exists in the opened ELF file.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46764
2024-10-18 20:21:44 +00:00
Ka Ho Ng
968bcca262 libkldelf: add a private library for kernel/kld-related ELF parsing
The libkldelf library was originally a part of kldxref(8). It exposed
ELF parsing helpers specialized in parsing KLDs and the kernel
executable. The library can be used to read metadata such as linker_set,
mod_depend, mod_version and PNP match info, and raw data from the ELF.

To promote the reuse of the facilities the ELF parsing code is separated
from kldxref(8) into a new private library.

For now, libkldelf's source files will be compiled into kldxref(8)
directly if kldxref is built during bootstrapping phase. The reason is
linking kldxref(8) against the libkldelf static library has an unwanted
side effect which renders the linker sets inside the libkldelf
implementation empty if the static library is not build by ld -r all the
.o files into a single .o before producing the static library.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Suggested by:	jrtc27, markj
Differential Revision:	https://reviews.freebsd.org/D46719
2024-10-18 20:20:13 +00:00
Jessica Clarke
1363acbf25 libc/csu: Support IFUNCs on riscv
When adding support to rtld-elf I neglected the fact that static
binaries can have IFUNCs. Add support for this too.

Fixes:		729d2b16b7 ("rtld-elf: Support IFUNCs on riscv")
MFC after:	1 week
2024-10-18 19:14:58 +01:00
Cy Schubert
46d2f61818 unbound: Vendor import 1.22.0
Release notes at
	https://nlnetlabs.nl/news/2024/Oct/17/unbound-1.22.0-released/

MFC after:	1 week

Merge commit '0a6d797cf6eb751d7eb613900cd19803e05d905f' into main
2024-10-18 07:14:21 -07:00
Jessica Clarke
7aa6667623 lib/clang: Commit cleaned-up workaround for building on RISC-V
There is a long-standing issue on RISC-V around --gc-sections when
statically linking, which affects the bootstrap build of LLVM. Since
fixing this properly has remained a TODO for years, commit the
workaround with documentation so that building natively from source
works out of the box.

PR:		258358
MFC after:	1 week
2024-10-18 13:59:48 +01:00
Keith White
167bfde705 ftime.3: fix typo in spelling of libutil
PR:	282171
MFC after:	3 days
2024-10-18 15:50:24 +03:00
Simon J. Gerraty
45fe5580cd Updated and new Makefile.depend files
Reviewd by:	stevek
2024-10-16 09:26:29 -07:00
Mitchell Horne
23cb03d145 thr_kill(2): fix title
Mandoc emits a STYLE warning due to the lowercase letters.
2024-10-15 17:44:52 -03:00
Graham Percival
a51584a2d2 manuals: Fix some "missing section argument"
These were reported by `mandoc -T lint ...` as warnings.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1467
2024-10-15 17:20:55 -03:00
Graham Percival
6e1fc01180 manuals: Fix "unusual .Xr" warnings with a script
These were reported by `mandoc -T lint ...` as warnings:
- unusual Xr order
- unusual Xr punctuation

Fixes made by script in https://github.com/Tarsnap/freebsd-doc-scripts

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1464
2024-10-15 17:18:14 -03:00
Kristof Provost
9c12533672 pf: convert DIOCGETSRCNODES to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-10-15 16:29:11 +02:00
Strahinja Stanišić
7bedae81ad lib/libc/tests/string: add test for strnlen()
Tests for strnlen, checks alignments from up to 16 and buffer sizes up
to 64, also checks that passing SIZE_MAX as maxlen works, because it can
cause a wraparound error if strnlen is incorrect.

Reviewed by:	fuz, emaste (GSoC mentors), kib
Sponsored by:	Google LLC (GSoC 2024)
Differential Revision:	https://reviews.freebsd.org/D46275
2024-10-15 13:34:45 +02:00
Robert Clausecker
18b226ea08 lib/geom: remove redundant libraries and objects
Do not link lib/geom/raid with libmd, it is not required for the module.
Do not include the sha256/sha512 code in lib/geom/eli, it is provided by
libmd.  Remove ${.CURDIR:H:H}/misc from .PATH for all modules.  This
path has stopped being valid when the GEOM modules were moved from
sbin/geom to lib/geom.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D47061
2024-10-15 13:34:45 +02:00
Simon J. Gerraty
a64729f507 Update Makefile.depend files
After building packages we have a number of new
and updated Makefile.depend files

Reviewed by:	stevek
2024-10-14 10:26:17 -07:00
Kristof Provost
48f5bf8be6 pf: convert DIOCGETRULESET to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46938
2024-10-10 14:10:41 +02:00
Kristof Provost
25e0f8f99f pf: convert DIOCGETRULESETS to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46930
2024-10-10 14:10:40 +02:00
Ka Ho Ng
50c64df2a1 Revert "libkldelf: add a private library for kernel/kld-related ELF parsing"
Some checks are pending
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-12, /usr/lib/llvm-12/bin, ubuntu-20.04, bmake libarchive-dev clang-12 lld-12, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-12, /usr/lib/llvm-12/bin, ubuntu-20.04, bmake libarchive-dev clang-12 lld-12, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-13, /opt/homebrew/opt/llvm@13/bin, macos-latest, bmake libarchive llvm@13, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-13, /opt/homebrew/opt/llvm@13/bin, macos-latest, bmake libarchive llvm@13, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, arm64, aarch64) (push) Waiting to run
This reverts commit 0a2cfd653e.
2024-10-08 19:40:20 +00:00
Ka Ho Ng
7007de7d10 Revert "libkldelf: add elf_lookup_symbol function"
This reverts commit 2c7d847956.
2024-10-08 19:40:13 +00:00
Ka Ho Ng
6df3a2d1bf Revert "libkldelf: use warnx instead of printf"
This reverts commit 550ee2d03c.
2024-10-08 19:39:36 +00:00
Graham Percival
8b92fa1ceb manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1453
2024-10-08 16:13:39 -03:00
Gleb Popov
e3ebc5f534 procctl(2): Clarify the ESRCH error code case
Approved by: kib
Differential Revision: https://reviews.freebsd.org/D47010
2024-10-08 19:58:17 +03:00
Ka Ho Ng
550ee2d03c libkldelf: use warnx instead of printf
Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46893
2024-10-08 04:29:10 +00:00