Commit graph

21651 commits

Author SHA1 Message Date
Ed Maste
423fb85f33 libc: correct SPDX tag on strstr.c
It was obtained from musl, and is MIT licensed.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 2e9bc9d144)
2022-01-18 19:32:29 -05:00
Ed Maste
e475c5f6ca libc: fix misleading comment in strstr
Obtained from:	musl c53e9b239418

(cherry picked from commit c6750f07b4)
2022-01-18 19:32:29 -05:00
Xin LI
46aa53e2b8 file: upgrade to 5.41.
(cherry picked from commit 43a5ec4eb4)
2022-01-17 16:43:58 -08:00
Eugene Grosbein
e4dd9ce81b gpart(8): MFC: add minimal reference to glabel(8) to manual page
(cherry picked from commit ba94a95402)
2022-01-17 13:44:00 +07:00
Konstantin Belousov
07d32ede46 libc clnt_com_create: relock rpcsoc_lock earlier when port is obtained from portmapper
PR:	261051

(cherry picked from commit 6d06bc688e)
2022-01-15 02:51:13 +02:00
Konstantin Belousov
8c709f30a1 sched_get/setaffinity(): try to be more compatible with Linux
(cherry picked from commit d9cacbf4b0)
2022-01-14 18:17:31 +02:00
Stefan Eßer
dc4114875e Make CPU_SET macros compliant with other implementations
(cherry picked from commit e2650af157)
2022-01-14 18:17:30 +02:00
Stefan Eßer
379bfb2aa9 sys/bitset.h: reduce visibility of BIT_* macros
(cherry picked from commit 5e04571cf3)
2022-01-14 18:17:30 +02:00
Math Ieu
3f8542d396 sched_get/setaffinity(3): pid 0 should designate current process
PR:	260487

(cherry picked from commit caacda7a3e)
2022-01-14 18:17:30 +02:00
Konstantin Belousov
58865d5f8d sched.h: Hide all Linux compat sched_* functions under _WITH_CPU_SET_T
(cherry picked from commit 90fa9705d5)
2022-01-14 18:17:29 +02:00
Konstantin Belousov
d3e9527a10 x86: provide userspace implementation of sched_getcpu() where possible
(cherry picked from commit f239545591)
2022-01-14 18:17:29 +02:00
Konstantin Belousov
a48d9f1900 Add sched_getcpu()
(cherry picked from commit 77b2c2f814)
2022-01-14 18:17:29 +02:00
Konstantin Belousov
526f94cc0e Add sched_get/setaffinity(3)
(cherry picked from commit 43736b71dd)
2022-01-14 18:17:29 +02:00
Mark Johnston
fcf4b06a5e libsysdecode: Decode sendmsg/recvmsg flags containing an underscore
Otherwise MSG_CMSG_CLOEXEC is not decoded.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e2576591b9)
2022-01-11 09:28:42 -05:00
Ed Maste
8402f6341e Build libclang also if LLDB is enabled
LLDB depends on libclang as it uses Clang as the expression parser.
Previously setting WITHOUT_CLANG but leaving LLDB enabled (as default)
resulted in a build failure.

Users who set WITHOUT_CLANG in order to reduce build time or size
might want to set WITHOUT_LLDB in addition to WITHOUT_CLANG, or use
WITHOUT_TOOLCHAIN instead.

PR:		260993
Reported by:	eugen
Reviewed by:	dim
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit adc88b9c01)
2022-01-09 19:25:11 -05:00
Emmanuel Vadot
ac36d4f03a pkgbase: Create a FreeBSD-fetch package
It's useful for small image to fetch some data but we don't want to
install utilities nor bloat runtime.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33463

(cherry picked from commit 13ef8134ef)
2022-01-05 18:23:53 +01:00
Emmanuel Vadot
b2d245a0b0 pkgbase: Put more binaries/lib in runtime
Move some needed binaries/libs from FreeBSD-utilities to FreeBSD_runtime.
This is everything needed to boot to multiuser with FreeBSD-rc installed.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33435

(cherry picked from commit 93c4369096)
2022-01-05 18:23:51 +01:00
Emmanuel Vadot
26c7445164 pkgbase: Put yellow pages programs to its own package
YP is less and less used, split them to users have the choice to not
install them.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33441

(cherry picked from commit 5abb10faa1)
2022-01-05 18:23:51 +01:00
Emmanuel Vadot
880b9a8af6 pkgbase: Create a FreeBSD-ftp package
ftp tools aren't that useful nowadays but some might want them.
Create a FreeBSD-ftp package so users have a choice to have
them or not.

Differential Revision:	https://reviews.freebsd.org/D31794

(cherry picked from commit b5be5c35db)
2022-01-05 18:23:51 +01:00
Emmanuel Vadot
e6e5d8e7aa pkgbase: Remove libefivar package and add a efi-tools one
Put all the efi related tools into FreeBSD-efi-tools.

Differential Revision:	https://reviews.freebsd.org/D31803

(cherry picked from commit d8d41d3b84)
2022-01-05 18:23:50 +01:00
Emmanuel Vadot
f5ab36c2e1 pkgbase: Create a FreeBSD-kerberos package
This allows users to install or not kerberos related utilities
and libs.

Differential Revision:	https://reviews.freebsd.org/D31801

(cherry picked from commit a30235a4c3)
2022-01-05 18:23:50 +01:00
Emmanuel Vadot
ef2b8edd03 pkgbase: Put libbsdxml in FreeBSD-runtime
libbsdxml is used by a lot of programs so just put it in FreeBSD-runtime.

Differential Revision: https://reviews.freebsd.org/D31800
Reviewed by: emaste

(cherry picked from commit 30975efbaf)
2022-01-05 18:23:50 +01:00
Emmanuel Vadot
872aa9c8a6 pkgbase: Create a FreeBSD-telnet package
both telnet and telnetd aren't that useful nowadays but some
might want them.
Create a FreeBSD-telnet package so users have a choice to have
them or not.

Differential Revision:	https://reviews.freebsd.org/D31791
Reviewed by: emaste

(cherry picked from commit c7fd29f0f2)
2022-01-05 18:23:49 +01:00
Emmanuel Vadot
958d4404a5 pkgbase: Remove FreeBSD-libregex package
The only user of libregex is grep (and its variation), no need for a
dedicated package.
This moves libregex to the default package (FreeBSD-utilities).

Differential Revision: https://reviews.freebsd.org/D31802

(cherry picked from commit dfa9131d70)
2022-01-05 18:23:49 +01:00
Chuck Silvers
4191c1c4a0 librtld_db: Handle shlibs with discontiguous mappings.
Some shared libraries specify mappings that leave a gap (actually a
MAP_GUARD mapping) in between the file mappings (libcrypto.so was
the one I found), and this would cause rd_loadobj_iter() to report
the mapping info incorrectly, leaving out rdl_path and misreporting
rdl_offset for file mappings after the gap.  Fix rd_loadobj_iter()
to handle this situation.

Reviewed by:	markj
Sponsored by:	Netflix

(cherry picked from commit dfd00261c9)
2022-01-05 12:23:04 -05:00
Alexander Motin
375fdb6e16 libc: Fix build with -DNS_REREAD_CONF.
MFC after:	3 days

(cherry picked from commit 62ed2d0152)
2021-12-31 19:26:43 -05:00
Dawid Gorecki
d8247df24c libthr: Use kern.stacktop for thread stack calculation.
Use the new kern.stacktop sysctl to retrieve the address of stack top
instead of kern.usrstack. kern.usrstack does not have any knowledge
of the stack gap, so this can cause problems with thread stacks.
Using kern.stacktop sysctl should fix most of those problems.
kern.usrstack is used as a fallback when kern.stacktop cannot be read.

Rename usrstack variables to stacktop to reflect this change.

Fixes problems with firefox and thunderbird not starting with
stack gap enabled.

PR: 239873
Reviewed by: kib
Obtained from: Semihalf
Sponsored by: Stormshield
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D31898

(cherry picked from commit 78df56ccfc)
2021-12-30 16:25:25 +01:00
Ed Maste
c56c2f0fe2 getfh: clarify that it is a privileged operation
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33629

(cherry picked from commit 5bc2e6e227)
2021-12-29 19:27:34 -05:00
Andrew Turner
4741f854ce Add accelerated arm64 sha512 to libmd
As with sha256 add support for accelerated sha512 support to libmd on
arm64. This depends on clang 13+ to build as this is the first release
with the needed intrinsics. Gcc should also support them, however from
a currently unknown release.

Reviewed by:	cem
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33373

(cherry picked from commit 71bf1c4cc5)
2021-12-29 10:06:00 +00:00
Alexander Motin
9e5bf8cfca libpmc: Update some x86 event definitions.
MFC after:	1 month

(cherry picked from commit 52d973f52c)
2021-12-25 14:56:22 -05:00
Li-Wen Hsu
511d1d63b4
libefivar(3): efi_set_variables_supported.3 should be efi_variables_supported.3
MFC after:	3 days

(cherry picked from commit 71779dddff)
2021-12-24 14:49:37 +08:00
Andrew Turner
757a39b1b2 Use arm64 sha256 intrinsics in libmd
Summary:
When running on a CPU that supports the arm64 sha256 intrinsics use them
to improve perfromance of sha256 calculations.

With this changethe following improvement has been seen on an Apple M1
with FreeBS running under Parallels, with similar results on a
Neoverse-N1 r3p1.

x sha256.orig
+ sha256.arm64
+--------------------------------------------------------------------+
|++                                                               x x|
|+++                                                              xxx|
||A                                                               |A||
+--------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x   5          3.41           3.5          3.46         3.458   0.042661458
+   5          0.47          0.54           0.5         0.504   0.027018512
Difference at 95.0% confidence
        -2.954 +/- 0.0520768
        -85.4251% +/- 0.826831%
        (Student's t, pooled s = 0.0357071)

Reviewed by:	cem
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31284

(cherry picked from commit 69d8dc20be)
2021-12-20 11:09:26 +00:00
Konstantin Belousov
0a50e517cd Document new variant of swapoff(2)
(cherry picked from commit 9f0fea5d03)
2021-12-20 02:29:11 +02:00
Konstantin Belousov
1791debf4a swapoff: add one more variant of the syscall
For MFC, COMPAT_FREEBSD13 braces were removed.

(cherry picked from commit 5346570276)
2021-12-20 02:29:11 +02:00
Konstantin Belousov
0c747a70c8 swapoff(2): document extended syscall arguments
(cherry picked from commit 79d650f262)
2021-12-20 02:29:11 +02:00
Florian Walpen
30c3a5f248 Add idle priority scheduling privilege group to MAC/priority
(cherry picked from commit a9545eede4)
2021-12-19 04:42:51 +02:00
Florian Walpen
984b9d89f8 MAC/priority module for realtime privilege group
PR:	239125

(cherry picked from commit bf2fa8d9d1)
2021-12-19 04:42:51 +02:00
Dimitry Andric
606b6ce485 Remove set-but-unused variable from s_sincosl.c
This look like a copy and paste leftover.

Reported by:	enh@google.com (via freebsd-numerics@)
Reviewed by:	Steve Kargl <sgk@troutmask.apl.washington.edu>

(cherry picked from commit 20d425842a)
2021-12-17 19:32:40 +01:00
Andrew Turner
c71bfb1013 Revert "Switch to Arm Optimized Routines for mem* & str*"
The Arm Optimized Routines don't exist in 13. I missed this as my
builds succeeded, likely due to stale depends files.

This reverts commit bfd10d146b.
2021-12-14 12:34:09 +00:00
Andrew Turner
b2969efae8 Use a builtin where possible in msun
Some of the functions in msun can be implemented using a compiler
builtin function to generate a small number of instructions. Implement
this support in fma, fmax, fmin, and sqrt on arm64.

Care must be taken as the builtin can be implemented as a function
call on some architectures that lack direct support. In these cases
we need to use the original code path.

As we don't set errno on failure build with -fno-math-errno so the
toolchain doesn't convert a builtin into a function call when it
detects a failure, e.g. gcc will add a call to sqrt when the input
is negative leading to an infinite loop.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32801

(cherry picked from commit b2e843161d)
2021-12-14 10:58:01 +00:00
Andrew Turner
bfd10d146b Switch to Arm Optimized Routines for mem* & str*
These are the updated version of the older Cortex Strings Library we
previously used. The Arm Optimized Routines also support CPU features
that are currently in development on FreeBSD, e.g. Branch Target
Identification (BTI). Rather than add BTI support to the old code it's
easier to just use the maintained version.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32774

(cherry picked from commit 2e8ff4d1d5)
2021-12-14 10:58:01 +00:00
Dimitry Andric
8918a2875e Apply only the libadd/libnames part of dbf05458e3
Add libz to the dependencies for libdwarf. Otherwise, building older
branches on recent -CURRENT might fail in the cross-tools stage with:

ld: error: undefined symbol: uncompress
>>> referenced by libdwarf_elf_init.c:233 (/usr/src/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c:233)
>>>               libdwarf_elf_init.o:(_dwarf_elf_init) in archive /usr/lib/libdwarf.a

Direct commit to stable/13, since dbf05458e3 has other libdwarf
changes to support compressed ELF sections, which are more intrusive.
2021-12-13 22:23:44 +01:00
Mark Johnston
a5659943e3 libc: Add pdfork to the list of interposed system calls
Otherwise the asm stub is used and libthr interposition does not work.

Reviewed by:	kib
Fixes:		21f749da82 ("libthr: wrap pdfork(2), same as fork(2).")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit cbdec8db18)
2021-12-13 08:26:58 -05:00
Mateusz Piotrowski
190c88c458 gmultipath.8: Fix a typo
It's Word Wide Port Name, not World Word Port Name.

MFC after:	3 days

(cherry picked from commit 58d60030ff)
2021-12-13 02:10:26 +01:00
Konstantin Belousov
ba6f5ed72e fcntl(2): be more precise about third arg type
(cherry picked from commit 97722455cc)
2021-12-13 02:58:22 +02:00
Konstantin Belousov
9258e9e3a8 fcntl(2): add F_KINFO operation
(cherry picked from commit 794d3e8e63)
2021-12-13 02:58:22 +02:00
Ed Maste
bf4a70bb40 libc: Use musl's optimized strchr and strchrnul
Parentheses added to HASZERO macro to avoid a GCC warning, and formatted
with clang-format as we have adopted these and don't consider them
'contrib' code.

Obtained from:	musl (snapshot at commit 4d0a82170a25)
Reviewed by:	kib (libc integration), mjg (both earlier)
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17630

(cherry picked from commit 7f72497ef7)
2021-12-12 17:32:33 -05:00
Cy Schubert
26ede19e22 libradius: fix no SSL build
int alen is only used with SSL.

(cherry picked from commit 48b11217bf)

libradius: fix WITHOUT_OPENSSL build

int alen is used only with SSL.

Reported by:	Michael Dexter, Build Option Survey
MFC after:	3 days
Fixes:		8d5c781306 ("libradius: Fix input validation bugs")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a901f2af58)
2021-12-12 17:17:00 -05:00
Mike Karels
1ab4b70db5 res_init: remove unused inet_makeaddr with IN_LOOPBACKNET
Remove code that is ifdefed out on USELOOPBACK, which uses historical
class.  No functional change intended.

(cherry picked from commit 0bf7f99b2a)
2021-12-10 10:26:14 -06:00
Mike Karels
d98a0edb26 man pages: deprecate Internet Class A/B/C
Mark functions inet_netof(), inet_lnaof(), and inet_makeaddr() as
deprecated, as they assume Class A/B/C.  inet_makeaddr() mostly works
when networks are a multiple of 8 bits, but warn for anything other
than historical classes.  Reduce other mentions of network classes.

(cherry picked from commit 12bd931d8c)
2021-12-10 10:25:45 -06:00