Commit Graph

24516 Commits

Author SHA1 Message Date
Lexi Winter
1b3c07bed6 package: move OpenBSM auditing into its own package
Move auditing runtime (auditd, etc.) into the new FreeBSD-audit package.
Also move the runtime OpenBSM manual pages from libbsm into auditd so
they get installed with the right package.

Add an UPDATING entry noting the new packages.

Reviewed by: imp, manu
Pull Request: https://github.com/freebsd/freebsd-src/pull/1197
2024-04-28 22:33:06 -06:00
Mateusz Piotrowski
6662c2312e gettimeofday.2: Do mention improbable future removal
As kib@ noted:

> Obviously gettimeofday(2) is not going to be removed
> even in the far future.

Reported by:	kib
Fixes:		4395d3ced5 Document that gettimeofday() is obsolescent
MFC after:	3 days
2024-04-28 20:11:22 +02:00
Dimitry Andric
514773a548 Skip building libclang_rt when WITHOUT_CLANG is used
As noted in bug 277096, when building a pkgbase repository using
WITHOUT_CROSS_COMPILER and WITHOUT_TOOLCHAIN (which sets WITHOUT_CLANG),
the following residual files are left over:

/usr/lib/clang/18/lib/freebsd/libclang_rt.asan-x86_64.so
/usr/lib/clang/18/share/asan_ignore_list.txt
/usr/lib/clang/18/share/cfi_ignore_list.txt
/usr/lib/clang/18/share/msan_ignore_list.txt

This is because the lib/libclang_rt directory is still descended into,
even if WITHOUT_CLANG is used. Fix it by not descending into the
libclang_rt directory in that case.

PR:		277096
Reported by:	Siva Mahadevan <me@svmhdvn.name>
MFC after:	3 days
2024-04-25 17:05:29 +02:00
Mateusz Piotrowski
4395d3ced5 Document that gettimeofday() is obsolescent
Reported by:	kaktus
Reviewed by:	kaktus, pstef
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D23942
2024-04-25 11:42:59 +02:00
Brooks Davis
78101d437a syscalls.master: correct return type of {read,write}v
This was missed when read/write, etc were updated to return ssize_t.

Fixes:		2e83b28161 Fix a few syscall arguments to use size_t instead of u_int.

Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D44930
2024-04-24 20:48:46 +01:00
Alan Somers
4b7949144c geli.8: add some notes regarding performance tuning
MFC after:	1 week
Sponsored by:	Axcient
Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D44908
2024-04-24 07:53:37 -06:00
Karl Tomlinson
e75a1bbc23 pow,powf(3),__ieee754_rem_pio2(f): Avoid negative integer left shift UB
A compiler clever enough to know that z is positive with a non-zero
biased exponent could, for example, optimize away the scalbnf(z,n) in
pow() because behavior for left shift of negative values is undefined.
`n` is negative when y*log2(|x|) < -0.5.  i.e. |x^y| < sqrt(0.5)

The intended behavior for operator<< in this code is to shift the two's
complement representation of the first operand.

In the pow() functions, the result is added to the IEEE 754 exponent of
z = 2^y'.  n may be negative enough to underflow the biased IEEE 754
exponent below zero, which is manifested in the sign bit of j
(which would correspond to the IEEE 754 sign bit).

The conversion from uint32_t to int32_t for out-of-int32_t-range values
is implementation defined.  The assumed behavior of interpreting the
uint32_t value as a two's complement representation of a signed value
is already assumed in many parts of the code, such as uses of
GET_FLOAT_WORD() with signed integers.

This code passes all the current tests, and makes some out of tree
fuzzing tests pass again rather than hit UB (detailed in the commentary
of the pull request).

Signed-off-by: Karl Tomlinson <karlt+@karlt.net>
Reviewed by: imp, steve kargl, dim
Pull Request: https://github.com/freebsd/freebsd-src/pull/1137
2024-04-23 14:04:07 -06:00
Konstantin Belousov
aa66995b4c libc printf_render_errno(): do not use strerror()
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44916
2024-04-23 22:44:07 +03:00
Konstantin Belousov
bac9d7e8f2 libc: minor style, wrap long lines
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44916
2024-04-23 22:44:07 +03:00
Konstantin Belousov
f887667694 __vprintf(): switch from strerror() to strerror_rl()
This eliminates the use of non-thread-safe function in printf*() family,
and make the call locale-aware.  Also, it stops obliterating the
strerror() static buffer, which aligns with the POSIX requirement that
implementations must behave as if no standard-mandated functions call
strerror().

PR:	278556
Reported by:	Jonathan Gruber <jonathan.gruber.jg@gmail.com>
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44916
2024-04-23 22:43:01 +03:00
Konstantin Belousov
92771bc00a libc: make strerror_rl() usable for libc
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44916
2024-04-23 22:40:29 +03:00
Konstantin Belousov
fb2ab7ce52 Add test for pthread_sigqueue(3)
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44867
2024-04-23 19:51:31 +03:00
Konstantin Belousov
220aa0f450 libthr: add pthread_sigqueue(3)
PR:	278459
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44867
2024-04-23 19:51:22 +03:00
Konstantin Belousov
dcc180c51b sigqueue(2): Document __SIGQUEUE_TID
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44867
2024-04-23 19:51:10 +03:00
Christopher Davidson
96a2e036b7 Update manual page references and macros to align to mandoc syntax
xlocale.3: Comment out reference to atof_l(3), atoi_l(3), atol_l(3), atoll_l(3)
  These manual page references do not exist.

lagg.4: Change the reference for /etc/rc.conf from a reference link
  .Xr -> .Pa based on the context within the manual page it is used.

buf.9: Remove .Xr entries from the file
  The buf.9 manual page contains a commented out .Xr reference.
  The <filmmein> 9 entry is a placeholder and has been removed for
  clarity.

Reviewed by:	mhorne
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1114
2024-04-23 12:50:54 -03:00
rilysh
bac2eea13a swab.c(libc): use a simplified version of byte swapping
This version of swab function simplifies the logic of swapping adjacent
bytes. Previous version of swab() used an arbitrary unrolling, which was
relevant back in the day but unnecessary for modern compilers, as if the
input size is known at compile time, they can do it automatically.

This version of swab() is inspired by musl.
A similar version can be found at: https://github.com/openbsd/src/blob/master/lib/libc/string/swab.c

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1086
2024-04-22 23:01:54 -06:00
Lexi Winter
7209444a80 package: move cron into its own package
Reviewed by: imp, manu, Mina Galic
Pull Request: https://github.com/freebsd/freebsd-src/pull/1172
2024-04-22 22:36:35 -06:00
Lexi Winter
50ecbc5142 libipsec: make const-correct
- add const to the appropriate places in the libipsec public API and the
  relevant internal functions needed to support that.

- replace caddr_t with c_caddr_t in ipsec_dump_policy()

- update the ipsec_dump_policy manpage to use c_caddr_t (this manpage
  was already wrong as it had "char *" instead of caddr_t previously).

While here, update pfkeyv2.h to not cast away const in the PFKEY_*()
macros.

This should not cause any ABI changes as the actual types have not
changed.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1099
2024-04-22 22:36:34 -06:00
Alan Somers
c0f02dcd4c geli.8: minor proofreading
MFC after:	3 days
Sponsored by:	Axcient
Reviewed by:	imp, pauamma (manpages)
Differential Revision: https://reviews.freebsd.org/D44907
2024-04-22 15:54:56 -06:00
Brooks Davis
6077246e88 libcxxrt: align more with libc/Makefile
Use src.opts.mk instead of bsd.own.mk and define PACKAGE first.

Fixes:		da77a1b4f0 libcxxrt: don't export nonexistant symbols
2024-04-22 21:28:51 +01:00
Brooks Davis
80ffc7398b libsys/arm: make vfork less of an outlier
Following the pattern of other architectures, make __sys_vfork the main
symbol and _vfork and vfork weak aliases.  This avoids the need to
special case vfork in the generated list of symbols.

Differential Revision:	https://reviews.freebsd.org/D44330
2024-04-22 21:28:51 +01:00
Brooks Davis
7448408656 Make __libsys_interposing_slot libsys only
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44881
2024-04-22 21:28:26 +01:00
Brooks Davis
672464f756 libthr: always use __libc_interposing_slot()
Use __libc_interposing_slot() in favor of __libsys_interposing_slot() so
that the interposing interface is entierly between libc and libthr with
libsys only involved as an implementation detail.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44880
2024-04-22 21:28:26 +01:00
Dimitry Andric
911a6479e1 libcxxrt: define SHLIBDIR before including bsd.own.mk
Otherwise bsd.own.mk overrides it, causing libcxxrt.so.1 to be
erroneously installed into /usr/lib.

Also add an ObsoleteFiles.inc entry, for removing the bad copy.

Reported by:	Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Fixes:		da77a1b4f0
2024-04-22 20:46:45 +02:00
Alexander Motin
278d695094 libpmc: Import AMD Zen 4 PMU events
MFC after:	1 week
2024-04-20 11:54:04 -04:00
Dimitry Andric
dfa39133b3 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
2024-04-20 16:02:57 +02:00
Gordon Bergling
bbef63ec27 timerfd.2: Remove a double word
- s/is is/is/

MFC after:	3 days
2024-04-20 11:31:25 +02:00
Ricardo Branco
a8fd0a5f44 glabel: Remove support for old reiserfs
Reviewed by: imp, emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1101
2024-04-19 16:48:28 -06:00
Alexander Ziaee
de525c502a intro.2: Integrate introduction with state of page
Reviewed by: imp, brooks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1065
2024-04-19 16:30:32 -06:00
Alexander Ziaee
d846f33bb6 intro.2: Section RETURN VALUES is actually ERRORS
Reviewed by: imp, brooks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1065
2024-04-19 16:30:27 -06:00
Alexander Ziaee
4696ca7baf intro.2: Add FILES mentioning table of syscalls
Reviewed by: imp, brooks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1065
2024-04-19 16:30:23 -06:00
Alexander Ziaee
9e8df7900f intro.2: Tweak grammar and syntax for consistency
Reviewed by: imp, brooks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1065
2024-04-19 16:30:19 -06:00
Alexander Ziaee
bcc57e9715 intro.2: Import HISTORY from OpenBSD but our style
Reviewed by: imp, brooks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1065
2024-04-19 16:30:14 -06:00
Brooks Davis
f0bd655a61 libc/quad: further narrow list of i386 symbols
It's unclear to me why lld didn't complain about these are they aren't
present and haven't been.  Instead ld.bfd complained.

Reviewed by:	dim
Fixes:		6e6cd03c91 libc/quad: narrow list of symbols exposed on i386
Differential Revision:	https://reviews.freebsd.org/D44879
2024-04-19 22:56:13 +01:00
Brooks Davis
44e89340fe libgcc_s: expose __divmoddi4 on i386
GCC has used this for some time (since 7.0) and apparently we were
getting away with using the hidden symbol, but when linking with
--no-undefined-version we get an error unless it's properly exported.
(For anyone who wonders at the assymetry, __udivmoddi4 is indeed much
older and was introduced with GCC 3.0.)

MFC after:	3 days
Reviewed by:	dim
Differential Revision:	https://reviews.freebsd.org/D44878
2024-04-19 22:56:13 +01:00
Brooks Davis
0b9e358580 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
2024-04-19 22:56:13 +01:00
Brooks Davis
6e83504c60 Revert "lib{c,sys}: normalize export of openat, setcontext, and swapcontext"
I put the symbols in the wrong file (should have been
lib/libc/sys/Symbol.map), added a duplicate pdfork entry due to a botch
rebase, and there seems to be a issue with gcc13/binutils not exposing
the symbols so revert the whole thing while I debug.

This reverts commit ee632fb9eb.
2024-04-19 22:25:04 +01:00
Brooks Davis
ee632fb9eb lib{c,sys}: normalize export of openat, setcontext, and swapcontext
List them in the symbol map rather than using the __sym_default to
expose them.  This will allow later improvements in the stub
implementations in libc.so.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44113
2024-04-17 23:39:46 +01:00
Brooks Davis
df1a09ba52 libsys: expose a few more symbols for libc's use
These private symbols are used by libc so expose as we do with
auxargs bits rather then relying on duplicate implementations in libc.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44114
2024-04-17 23:39:46 +01:00
Dimitry Andric
f276adc148 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
2024-04-17 22:20:47 +02:00
Martin Matuska
7d03ec3306 libarchive: add two missing package files to libarchive tests
MFC after:	1 week
2024-04-17 09:58:32 +02:00
Martin Matuska
b9128a37fa 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

PR:		278315 (exp-run)
MFC after:	1 week
2024-04-16 23:39:31 +02:00
Brooks Davis
e0919a4bac libc/arm: export __signalcontext not _signalcontext
The former exists and architectures other than aarch64 and riscv provide
it.  The later does not exist.

Differential Revision:	https://reviews.freebsd.org/D44329
2024-04-16 22:14:21 +01:00
Brooks Davis
da77a1b4f0 libcxxrt: don't export nonexistant symbols
Remove version entries that we don't build.

Add an arm specific Version.map and for other targets run the files
through sed to handle int vs long in new and delete.

Ideally we'd use the SYMBOL_MAPS functionality to preprocess with cpp,
but it doesn't currently handle C++ symbols so be annoyingly duplicative
for now.

Differential Revision:	https://reviews.freebsd.org/D44325
2024-04-16 22:14:21 +01:00
Brooks Davis
b457144cea libgcc_s: exclude symbols not present on some arches
arm, aarch64, and riscv lack some/all frame_info interfaces.
arm and powerpc lack some numeric functions.

Differential Revision:	https://reviews.freebsd.org/D44324
2024-04-16 22:14:21 +01:00
Brooks Davis
3f82d8345b libgcc_s: only export 128-bit int APIs when available
These interfaces are only compiled when the platform supports 128-bit
ints.  Use a CRT_HAS_128BIT guard similar to the one used in the
compiler_rt sources.

Reviewed by:	dim
Differential Revision:	https://reviews.freebsd.org/D44323
2024-04-16 22:14:21 +01:00
Brooks Davis
b8df8b0c2e libgcc_s: only export 128-bit long double when available
These functions are only available on aarch64 and riscv so only try to
export them on those architectures.

Differential Revision:	https://reviews.freebsd.org/D44322
2024-04-16 22:14:21 +01:00
Brooks Davis
35b3504ee6 librpcsec_gss: don't export non-existant symbols
rpc_gss_mesh_to_oid was never implemented.

This doesn't seem to be any reason why we would need to export the _stub
functions, but it's also a little unclear to me why the linker thinks
they aren't present.  Perhaps they should be static.

Differential Revision:	https://reviews.freebsd.org/D44248
2024-04-16 22:14:21 +01:00
Brooks Davis
63b179b68d libc: don't try to export __sF
This symbol has been static since 2008 (commit 1e98f88776).

Differential Revision:	https://reviews.freebsd.org/D44188
2024-04-16 22:14:20 +01:00
Brooks Davis
88fcb61799 libc: don't try to export _nsdbtdump
It is only present when compiling nsdispatch.c with -D_NSS_DEBUG and we
provide no mechanism to do so.

Differential Revision:	https://reviews.freebsd.org/D44187
2024-04-16 22:14:20 +01:00