Commit Graph

24605 Commits

Author SHA1 Message Date
Gordon Bergling
16c3d7e1fa erf.3: Add a STANDARDS section
Add a STANDARDS section for the erf(3) manual page.

PR:	273413
Reviewed by:	pauamma_gundo.com
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44140
2024-06-23 12:50:47 +02:00
Warner Losh
fa1e8538d1 math.h: Remove support for old gcc versions
Remove support for old gcc versions by unconditionally defining
__MATH_BUILTIN_RELOPS and __MATH_BUILTIN_CONSTANTS. Per kib's request,
don't #undef those so it's easier to understand what the builtins are
doing.

Reviewed by:		brooks
Differential Revision:	https://reviews.freebsd.org/D45655
Sponsored by:		Netflix
2024-06-20 20:41:09 -06:00
Baptiste Daroussin
e402155e1a ncurses: reinstantiate bsd specific code
This fixes ncurses 6.5 badly reading termcap
2024-06-20 20:27:15 +02:00
Baptiste Daroussin
21817992b3 ncurses: vendor import version 6.5 2024-06-20 13:26:22 +02:00
Andrew Turner
6eeedf35c3 libc: Replace armv6 with armv7 in a comment
Armv6 is being removed from the treem and the comment applies to armv7.

Reviewed by:	manu, imp, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45645
2024-06-20 09:26:22 +00:00
Brooks Davis
42c545c5f8 libsys: sort Symbol.map
Fixes:		7448408656 Make __libsys_interposing_slot libsys only
2024-06-19 23:08:05 +01:00
Brooks Davis
d511e97c54 libsysdecode: support rfork(RFSPAWN)
Match the "U" in RFSPAWN's value (1U<<31) (and "u" for completeness).
Reject kernel-only RFPPWAIT to avoid a duplicate entry.

Reviewed by:	imp, markj
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D45597
2024-06-19 21:38:31 +01:00
Pedro F. Giffuni
fc3907ce00 fparseln: Update license
Remove 3rd and 4th clauses in christos' license. OK christos.

Obtained from:	NetBSD
2024-06-15 18:30:27 -05:00
Pedro F. Giffuni
9a39435c0b Revert "fparseln: Update NetBSD version strings"
This reverts commit 1a968da448.

I was mistakenly looking at the version strings in the CVS attic
but the function was moved to libc/stdio where it matches the
current string.
2024-06-15 17:46:56 -05:00
Pedro F. Giffuni
1a968da448 fparseln: Update NetBSD version strings
The correponding changes (mostly ANSIfication) were done long ago locally.
No functional change.

Obtained from:	NetBSD (libutil CVS Attic)
2024-06-15 15:32:06 -05:00
Andrew Turner
b8a496dfb6 lib: Remove __ARM_ARCH checks that are always true
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D45559
2024-06-12 11:49:05 +00:00
Ed Maste
e77ad954bb Revert "libm: fma: correct zero sign with small inputs"
This change introduced a test failure, so revert until that can be
addressed.

This reverts commit 888796ade2.

PR:		277783
Reported by:	rlibby
Sponsored by:	The FreeBSD Foundation
2024-06-11 21:36:12 -04:00
Ed Maste
92927b8bcf msun: update Clang bug reference in fma test
LLVM bugzilla bug 8100 became issue #8472 with the migration to GitHub.

https://github.com/llvm/llvm-project/issues/8472
2024-06-11 20:29:27 -04:00
Ryan Libby
e754909cb0 virstor: remove relation between chunk size and MAXPHYS
There's no reason why the virstor chunk size needs to relate to MAXPHYS.
Remove it.  Instead, just make sure that the chunk size is a multiple of
the sector size.

Reviewed by:	imp
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D45518
2024-06-10 17:38:17 -07:00
Ryan Libby
a2fda816eb virstor: write large maps in chunks during label
During the initial label of a virstor device, write out the allocation
map in chunks if it is large (> 1 MB) in order to avoid large mallocs.

Even though the kernel virstor geom may still do a large malloc to
represent the allocation map, this may still be useful to avoid a
ulimit.

Reviewed by:	markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D45517
2024-06-10 17:36:20 -07:00
Mark Johnston
da925fcebf libc/tests: Further refine the condition for installing h_raw
See 8164d511d6 ("libc/tests: Fix installation without MK_TOOLCHAIN")
for some background.  Here we should really be testing MK_CLANG instead,
since that's what gates compilation of libclang_rt.

Fixes:	8164d511d6 ("libc/tests: Fix installation without MK_TOOLCHAIN")
2024-06-09 10:08:31 -04:00
Ed Maste
888796ade2 libm: fma: correct zero sign with small inputs
PR:		277783
Reported by:	Victor Stinner
Submitted by:	kargl
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D44433
2024-06-08 11:55:36 -04:00
Kristof Provost
ba2a920786 pf: convert DIOCBEGINADDRS to netlink 2024-06-08 04:46:43 +02:00
Kristof Provost
d9ab899931 pf: migrate DIOCGETLIMIT/DIOCSETLIMIT to netlink
Event:		Kitchener-Waterloo Hackathon 202406
2024-06-07 20:59:02 +02:00
Dapeng Gao
7cae020b9c Simplify signal handling code in libthr by removing use of SYS_sigreturn
The use of SYS_sigreturn is unnecessary here.

If handle_signal is called when a signal is delivered, it can just
return normally back to sigcode which will call sigreturn anyway.

In case handle_signal is called by check_deferred_signal, using
setcontext is better than SYS_sigreturn because that is the correct
system call to pair with the earlier getcontext.

Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D44893
2024-06-06 15:48:39 -06:00
Kristof Provost
30bad751e8 pf: convert DIOCGETTIMEOUT/DIOCSETTIMEOUT to netlink 2024-06-06 20:46:18 +02:00
Andreas Kempe
230efeda08 libusbhid: add missing include guards
PR:		265136
2024-06-06 10:09:05 -04:00
Enji Cooper
77c04f3eb1 radlib: fix a memory leak in is_valid_request
Call `HMAC_CTX_free` if returning early from `is_valid_request` when
processing `Message-Authenticator` tags.

Reported by:	Coverity
MFC after:	1 week
Fixes: 8d5c781306 ("libradius: Fix input validation bugs")
Differential Revision:	https://reviews.freebsd.org/D45488
2024-06-04 19:40:55 -07:00
Warner Losh
623d432b15 typo: Fix side -> size since it matters to the meaning...
batch side doesn't make sense, but batch size does. Fix.

Sponsored by:		Netflix
2024-06-04 10:59:01 -06:00
Kristof Provost
c36c90a2cc pf: convert DIOCSETDEBUG to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:59 +02:00
Kristof Provost
71d3c7041d pf: convert DIOCNATLOOK to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:58 +02:00
Kristof Provost
9dbbe68bc5 pf: convert DIOCCLRSTATUS to netlink
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-06-04 14:59:58 +02:00
Xin LI
3b35e7ee8d MFV: xz 5.6.2.
MFC after:	4 weeks
2024-06-03 18:14:43 -07:00
Mariusz Zaborski
bb421be6c1 libutil: move ftime to libutil
It seems that there are still some applications that use ftime(3)
(for example, science/siconos and sysutils/lcdproc). The issue
is that we don't build libcompat as a shared library anymore.
The easiest solution is to move it to libutil, until we
deprecate it for good.

This solution was proposed by kib@ in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257789.

PR:		257789
MFC after:	1 month
Reviewed by:	kib (ages ago)
Differential Revision:	https://reviews.freebsd.org/D39994
2024-05-29 14:36:09 +02:00
Kristof Provost
cd2054d48b libpfctl: add pfctl_get_rule_h()
Add a handle variant of pfctl_get_rule(). This converts us from using
the nvlist variant to the netlink variant, and also moves us closer to a
world where all libpfctl functions take the handle.

While here have pfctl use the new function.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-05-28 22:27:22 +02:00
Mark Johnston
8164d511d6 libc/tests: Fix installation without MK_TOOLCHAIN
There is some exotic conditional logic here to avoid building a
particular test if a certain UBSAN library isn't present in the
toolchain sysroot.  This causes build failures for me when doing an
"installworld WITHOUT_TOOLCHAIN=", which I do frequently during tests.

I believe the problem is that SYSROOT is unset during installworld, so
the build sees the host's copy of libclang_rt.ubsan_standalone.a and
then tries to install a binary that wasn't built during buildworld.  Try
to make the check a bit less fragile.

Reviewed by:	dim
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45035
2024-05-28 08:24:43 -04:00
Mariusz Zaborski
e24ff5c99b libcapsicum: cache more time zone information
The functions like gmtime(3) expect to cache a GMT time zone. Some
sandboxed programs (like last(1)) use the gmtime(3) function.
In case of last(1), this function fails to load a proper time zone
because it is called after entering the capability mode.

_open () at _open.S:4
0x00000008011bc5a8 in tzloadbody (name=0x8018b9580 "/usr/share/zoneinfo/Etc/UTC", sp=0x801870140,
tzload (name=<optimized out>, sp=0x801870140, doextend=true)
0x00000008011bb8ba in gmtload (sp=0x801870140) at /usr/src/contrib/tzcode/localtime.c:1456
gmtcheck () at /usr/src/contrib/tzcode/localtime.c:1581
0x000000080111f85a in _libc_once (once_control=0x80127c550, init_routine=0x0)
_once (once_control=0x80127c550, init_routine=0x0) at /usr/src/lib/libc/gen/_once_stub.c:63
0x00000008011bb9d0 in gmtime_r (timep=0x7fffffffe3a8, tmp=0x80127c568)
gmtime (timep=timep@entry=0x7fffffffe3a8) at /usr/src/contrib/tzcode/localtime.c:1865
0x0000000001024cd4 in printentry (bp=bp@entry=0x8018b4800, tt=tt@entry=0x80186a0a0)
0x00000000010245ae in doentry (bp=0x8018b4800)
0x00000000010243a7 in main (argc=1, argv=<optimized out>)

This time zone is not loaded by the tzset(3) function. Because of
that, extend the caph_cache_tzdata(3) function to also include the
GMT time zone. There is no other way to cache this data than
calling gmtime(3) once.

MFC after:	5 days
Reviewed by:	emaste, markj
Differential Revision:	https://reviews.freebsd.org/D45297
2024-05-27 13:17:34 +02:00
Andre Albsmeier
cca0ce62f3 pam_xdg: pam_get_item can return NULL
Fix pam_xdg as pam_get_item can return NULL, this happens when pressing
control + C in xdm for example.

MFC after:	1 week
PR:		279268
2024-05-27 08:33:14 +02:00
Warner Losh
364c014d9b cross-tools: fts has different types for cmp routine
fts has different types for its compare rotuine. Other systems, not
4.4BSD based, have a non-const version. Before we tested against
__GLIBC__, but now we test against __linux__ because that's Linux's API
and musl doesn't define __GLIBC__.

In addition, link against libftl on this platform since musl doesn't
include ftl routines in libc, but rather in libftl.

Co-authored-by:		Val Packett <val@packett.cool>
Sponsored by:		Netflix
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45349
2024-05-26 11:38:30 -06:00
Ed Maste
61639bb3fc libc: move NIS xdr_* symbols from rpc's to yp's Symbol.map
To fix WITHOUT_NIS build.  Building yp_xdr.c is gated by MK_NIS.

PR:		279270
Reported by:	peterj
Reported by:	matteo
Reported by:	Michael Dexter's Build Option Survey run
Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45347
2024-05-24 16:47:37 -04:00
Dimitry Andric
3a0793336e Merge llvm-project release/18.x llvmorg-18.1.6-0-g1118c2e05e67
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.6-0-g1118c2e05e67.

PR:		276104
MFC after:	3 days
2024-05-24 17:58:04 +02:00
Ricardo Branco
ddbfb544c6 mqueuefs: Relax restriction that path must begin with a slash
This is needed to support Linux implementation which discards the leading slash when calling mq_open(2)

Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1248
2024-05-23 13:40:46 -06:00
Tom Hukins
2ce32ab21a Fix "version introduced" in two manual pages
Signed-off-by: Tom Hukins <tom@FreeBSD.org>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1252
2024-05-23 10:30:32 -06:00
Brooks Davis
fcc5fa091e libcompiler_rt: gcc13 doesn't support _Float16 on arm
Don't set CRT_COMMON_F16_ARCH for arm as it's not supported by gcc13.

Differential Revision:	https://reviews.freebsd.org/D45234
2024-05-23 17:27:37 +01:00
Brooks Davis
6729e8a40b libpmc: remove tautological assert
gcc13 whines about this assert than an unsigned integer is >= 0.

Reviewed by:	luporl
Fixes:		b48a2770d4 powerpc64: add Power8 and Power9 PMCs
Differential Revision:	https://reviews.freebsd.org/D45232
2024-05-23 17:27:37 +01:00
Christos Margiolis
1ab62c8d06 mixer.3: Fix mandoc -Tlint warnings
Sponsored by:	The FreeBSD Foundation
MFC after:	1 day
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D45290
2024-05-23 02:57:49 +02:00
Christos Margiolis
67c89b21b9 mixer(3): Implement mixer_get_path() function
This is better than hardcoding device paths in mixer applications.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 day
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45275
2024-05-23 02:57:36 +02:00
Christos Margiolis
5d980fadf7 sound: Handle unavailable devices in various OSS IOCTLs
mixer(8)'s -a option is used to print information about all mixer
devices in the system. To do this, it loops from 0 to
mixer_get_nmixers(), and tries to open "/dev/mixer%d". However, this
approach doesn't work when there are disabled/unregistered mixers in the
system, or when an audio device simply doesn't have a mixer.

mixer_get_nmixers() calls SNDCTL_SYSINFO and returns
oss_sysinfo->nummixers, whose value is the number of currently _enabled_
mixers only. Taking the bug report mentioned below (277615) as an
example, suppose a system with 8 mixer devices total, but 3 of them are
either disabled or non-existent, which means they will not show up under
/dev, meaning we have 5 enabled mixer devices, which is also what the
value of oss_sysinfo->nummixers will be. What mixer(8) will do is loop
from 0 to 5 (instead of 8), and start calling mixer_open() on
/dev/mixer0, up to /dev/mixer4, and as is expected, the first call will
fail right away, hence the error shown in the bug report.

To fix this, modify oss_sysinfo->nummixers to hold the value of the
maximum unit in the system, which, although not necessarily "correct",
is more intuitive for applications that will want to use this value to
loop through all mixer devices.

Additionally, notify applications that a device is
unavailable/unregistered instead of skipping it. The current
implementations of SNDCTL_AUDIOINFO, SNDCTL_MIXERINFO and
SNDCTL_CARDINFO break applications that expect to get information about
a device that is skipped. Related discussion can be found here:
https://reviews.freebsd.org/D45135#1029526

It has to be noted, that other applications, apart from mixer(8), suffer
from this.

PR:		277615
Sponsored by:	The FreeBSD Foundation
MFC after:	1 day
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45256
2024-05-23 02:57:17 +02:00
Andrew Turner
82854693ae arm64: Allow userspace to be built with PAC and BTI
Add the WITH/WITHOUT_BRANCH_PROTECTION build flags. This can be used
to enable the use of pointer authentication (FEAT_PAuth) and branch
target identification (FEAT_BTI) in userspace.

The kernel already handles both of these is userspace, we just need
to enable it.

Leave disabled for a short period for this to settle before enabling.

Reviewed by:	emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42596
2024-05-22 17:02:26 +00:00
Andrew Turner
53120fbb68 csu: Find the main pointer through the GOT
Use the Global Offset Table to find the location of main in crt1. With
lld the old code would point to main@plt, however ld.bfd fails to link
when main is in a shared library.

Fix this by using the GOT address to find main as it works with both
lld and bfd.

Reviewed by:	jrtc27
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45259
2024-05-22 08:18:10 +00:00
Pierre Pronchery
408572a24e libnvmf: avoid resource leak
In nvmf_host_fetch_discovery_log_page(), the log variable may have been
allocated on the heap during the first loop cycle, and should be
free()'d before exiting upon errors.

Reported by:	Coverity
CID:		1545034
Sponsored by:	The FreeBSD Foundation

Reviewed by: imp,jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/1239
2024-05-21 17:41:04 -06:00
Dag-Erling Smørgrav
a4be1eb211 access(2): Discourage use of these system calls.
Fixes:		421025a274
PR:		262895
MFC after:	3 days
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D45240
2024-05-22 00:35:22 +02:00
Chris Moerz
c80c104cbd
glabel.8: Describe cases related to permissions / existing mounts
Specially, note some requirements for label changes:

- glabel requires write permission on device
- filesystems first need to be unmounted for new labels to persist
  across reboots
- if the affected device node holds the filesystem root, single-user
  mode with r/o mount will be required.

Also, while here, apply some formatting tweaks.

PR:		276724
Reported by:	Alex Matei <matei35@yahoo.com>
Reviewed by:	gbe, jrm, Alexander Ziaee <concussious@runbox.com>
Differential Revision:	https://reviews.freebsd.org/D44394
2024-05-21 15:49:17 -03:00
Dag-Erling Smørgrav
9c7f83bbb4 diff: Nits in tests.
Sponsored by:	Klara, Inc.
2024-05-20 16:27:50 +02:00
Dag-Erling Smørgrav
02d98d1850 libdiff: Add a test for the truncation issue.
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D45218
2024-05-20 15:26:42 +02:00