Commit Graph

21671 Commits

Author SHA1 Message Date
Hans Petter Selasky
5b40c0aa73 mixer(3): Fix buildworld after 38c857d956 .
s/default_unit/dunit/g

Differential Revision:	https://reviews.freebsd.org/D32254
Sponsored by:	NVIDIA Networking
2021-10-01 16:34:10 +02:00
Hans Petter Selasky
433be7f21f mixer(3): Add some manual page symlinks.
Submitted by:	christos@
Differential Revision:	https://reviews.freebsd.org/D32254
Sponsored by:	NVIDIA Networking
2021-10-01 14:18:43 +02:00
Hans Petter Selasky
38c857d956 mixer(3): Add symbol versioning.
Suggested by:	kib
Differential Revision:	https://reviews.freebsd.org/D32254
Sponsored by:	NVIDIA Networking
2021-10-01 14:18:43 +02:00
Kyle Evans
5487294d79 libc: ssp: sprinkle around some __dead2
This is consistent with, e.g., NetBSD's implementation, which declares
these as noreturn in ssp/ssp.h.
2021-09-30 23:55:17 -05:00
Kyle Evans
0f43c5b55c kqueue: clean up some igor and mandoc -Tlint warnings 2021-09-30 21:31:28 -05:00
Kyle Evans
4b5554cebb kqueue: document how timers with low/past timeouts are handled
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D32237
2021-09-30 21:31:28 -05:00
Kyle Evans
a6499c56ab jail(3lua): add jail.attach()/jail.remove() methods
These aren't a part of or use libjail(3), but rather are direct
syscalls.  Still, they seem like good additions, allowing us to attach
to already-running jails.

Reviewed by:	freqlabs
Differential Revision:	https://reviews.freebsd.org/D26927
2021-09-30 16:31:04 -05:00
Kyle Evans
6a7647eccd jail(3lua): add a jail.list() method
This is implemented as an iterator, reusing parts of the earlier logic
to populate jailparams from a passed in table.

The user may request any number of parameters to pull in while we're
searching, but we'll force jid and name to appear at a minimum.

Reviewed by:	freqlabs
Differential Revision:	https://reviews.freebsd.org/D26756
2021-09-30 16:30:57 -05:00
Mitchell Horne
a20c10893e libpmc: add some AMD pmu counter aliases
Make it mostly compatible with what's defined for Intel. Except where
noted, these are defined for all of amdzen(1|2|3).

Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32162
2021-09-30 11:15:26 -03:00
Mitchell Horne
937539e0a3 libpmc: fix the 'cycles' event alias on x86
Looking for "tsc-tsc" in the pmu tables will fail every time. Instead,
make this an alias for the static TSC event defined in pmc_events.h.
This fixes 'pmcstat -s cycles' on Intel and AMD.

Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32197
2021-09-30 11:15:26 -03:00
Warner Losh
5547ed2cb2 bluetooth: Remove one more h4 reference.
Sponsored by:		Netflix
2021-09-29 22:02:25 -06:00
Warner Losh
24ccef8140 bluetooth: Remove stray btccc references
The 3com bluetooth PC Card adapter was removed from the tree when PC
Card support was removed earlier this year. Remove stray references to
it still in the tree.

Sponsored by:		Netflix
2021-09-29 21:58:27 -06:00
Kristof Provost
5062afff9d pfctl: userspace adaptive syncookies configration
Hook up the userspace bits to configure syncookies in adaptive mode.

MFC after:	1 week
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D32136
2021-09-29 15:11:54 +02:00
Hans Petter Selasky
3984400149 mixer(3): Add support for controlling mixer mute and volume on feeder channels.
PR:	258711
Reported by:	jbeich@FreeBSD.org
Differential Revision:	https://reviews.freebsd.org/D31636
Sponsored by:	NVIDIA Networking
2021-09-28 11:20:23 +02:00
Konstantin Belousov
364790beaf pidfile test: guarantee nul termination of the read pid string
PR:	258701
Based on the submission by:	sigsys@gmail.com
MFC after:	1 week
2021-09-24 19:52:41 +03:00
Kristof Provost
63b3c1c770 pf: support dummynet
Allow pf to use dummynet pipes and queues.

We re-use the currently unused IPFW_IS_DUMMYNET flag to allow dummynet
to tell us that a packet is being re-injected after being delayed. This
is needed to avoid endlessly looping the packet between pf and dummynet.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31904
2021-09-24 11:41:25 +02:00
Nathaniel Wesley Filardo
0321a7990b kqueue: Add EV_KEEPUDATA flag
When this flag is set, operations that update an existing kevent will
not change the udata field.  This can be used to NOTE_TRIGGER or
EV_{EN,DIS}ABLE events without overwriting the stashed pointer.

Reviewed by:	Domagoj Stolfa <domagoj.stolfa@gmail.com>
Obtained from:	CheriBSD
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D30286
2021-09-23 17:31:39 -07:00
Nathaniel Wesley Filardo
701a99939f libsysdecode: Permit _ in VM_PROT_(.*) names.
CheriBSD defines additional protection flags which use underscores
such as VM_PROT_READ_CAP and VM_PROT_WRITE_CAP.

Obtained from:	CheriBSD
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D30017
2021-09-23 17:31:39 -07:00
Wojciech Macek
319b150003 pmc: intr pmc.soft(3) update
Obtained from:		Semihalf
Sponsored by:		Stormshield
Reviewed by:		mhorne
Differential revision:	https://reviews.freebsd.org/D32055
2021-09-23 06:13:58 +02:00
John Baldwin
b5f90655ea sysdecode.3: Remove documentation of CloudABI ABIs.
Fixes:		cf0ee8738e Drop cloudabi
2021-09-22 17:02:17 -07:00
Olivier Houchard
9bab18b861 libsysdecode: Decode FreeBSD32 syscalls on arm64.
Add aarch64 to the list of architectures that can run 32bits FreeBSD binaries,
so that truss works correctly with an arm32 binary.
The same should probably be done with mips.

MFC After:	1 week
2021-09-23 00:24:50 +02:00
Hans Petter Selasky
db6ba1e0c5 mixer(3) and mixer(8): Update manual pages.
- Use correct e-mail address.
- Set FreeBSD 14.0 as introduction for the updated mixer(8) utility.

Submitted by:	christos@
Differential Revision:	https://reviews.freebsd.org/D31636
Sponsored by:	NVIDIA Networking
2021-09-22 22:01:40 +02:00
Hans Petter Selasky
903873ce15 Implement and use new mixer(3) library for FreeBSD.
Wiki article: https://wiki.freebsd.org/SummerOfCode2021Projects/SoundMixerImprovements
This project was part of Google Summer of Code 2021.

Submitted by:	christos@
Differential Revision:	https://reviews.freebsd.org/D31636
Sponsored by:	NVIDIA Networking
2021-09-22 19:43:56 +02:00
Konstantin Belousov
cf0ee8738e Drop cloudabi
According to https://github.com/NuxiNL/cloudlibc:
CloudABI is no longer being maintained. It was an awesome experiment,
but it never got enough traction to be sustainable.

There is no reason to keep it in FreeBSD.

Approved by:	ed (private mail)
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D31923
2021-09-22 00:18:44 +03:00
Warner Losh
da73926566 libcam: Define depop structures and introduce scsi_wrap
Define structures related to the depop set of commands (GET PHYSICAL ELEMENT
STATUS, REMOVE ELEMENT AND TRUNCATE, and RESTORE ELEMENT AND REBUILD) as
well as the CDB construction routines.

Also create scsi_wrap.c. This will have convenience routines that will do all
the elements of allocating the ccb, generating the CDB, sending the command
(looping as necessary for cases where data is returned, but it's size isn't
known up front), etc. As this functionality is fleshed out, calling many
camcontrol commands programatically gets much easier.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D29017
2021-09-20 16:27:59 -06:00
Mark Johnston
7eb138a9e5 libc/locale: Fix races between localeconv(3) and setlocale(3)
Each locale embeds a lazily initialized lconv which is populated by
localeconv(3) and localeconv_l(3).  When setlocale(3) updates the global
locale, the lconv needs to be (lazily) reinitialized.  To signal this,
we set flag variables in the locale structure.  There are two problems:

- The flags are set before the locale is fully updated, so a concurrent
  localeconv() call can observe partially initialized locale data.
- No barriers ensure that localeconv() observes a fully initialized
  locale if a flag is set.

So, move the flag update appropriately, and use acq/rel barriers to
provide some synchronization.  Note that this is inadequate in the face
of multiple concurrent calls to setlocale(3), but this is not expected
to work regardless.

Thanks to Henry Hu <henry.hu.sh@gmail.com> for providing a test case
demonstrating the race.

PR:		258360
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31899
2021-09-17 10:47:46 -04:00
Konstantin Belousov
796a8e1ad1 procctl(2): Add PROC_WXMAP_CTL/STATUS
It allows to override kern.elf{32,64}.allow_wx on per-process basis.
In particular, it makes it possible to run binaries without PT_GNU_STACK
and without elfctl note while allow_wx = 0.

Reviewed by:	brooks, emaste, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31779
2021-09-17 15:42:01 +03:00
Konstantin Belousov
f575573ca5 Remove PT_GET_SC_ARGS_ALL
Reimplement bdf0f24bb1 by checking for the caller' ABI in
the implementation of PT_GET_SC_ARGS, and copying out everything if
it is Linuxolator.

Also fix a minor information leak: if PT_GET_SC_ARGS_ALL is done on the
thread reused after other process, it allows to read some number of that
thread last syscall arguments. Clear td_sa.args in thread_alloc().

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D31968
2021-09-16 20:11:27 +03:00
John Baldwin
5ac4ac85ca Remove an always-true check.
This fixes a -Wtype-limits error from GCC 9.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D31936
2021-09-15 09:03:17 -07:00
Edward Tomasz Napierala
bdf0f24bb1 linux: implement PTRACE_GET_SYSCALL_INFO
This is one of the pieces required to make modern (ie Focal)
strace(1) work.

Reviewed By:	jhb (earlier version)
Sponsored by:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D28212
2021-09-14 20:19:55 +00:00
Edward Tomasz Napierala
ddedf2a11e tzcode: Implement timezone change detection
Implement optional timezone change detection for local time libc
functions.  This is disabled by default; set WITH_DETECT_TZ_CHANGES
to build it.

Reviewed By:	imp
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
X-NetApp-PR:	#47
Differential Revision:	https://reviews.freebsd.org/D30183
2021-09-12 03:07:58 +00:00
Ed Maste
b9df18d6e8 libprocstat: extend zfs_defs hack for .pieo
By default _pie.a archives are built only for INTERNALLIBs, so there is
usually no need for zfs_defs.pieo to exist.  However, some experimental
work builds _pie.a archives for everything.  Extend the existing set of
zfs_defs hacks to build zfs_defs.pieo as well.

Reviewed by:	arichardson
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31924
2021-09-13 09:03:55 -04:00
Jessica Clarke
877175a17a libc: Fix build on case-insensitive file systems
On case-insensitive file systems (most likely to be seen on macOS, where
it is the default), _Fork.o for the new POSIX _Fork function conflicts
with _fork.o for the PSEUDO file. This results in non-determinsitic
behaviour in terms of which ends up being present; if _Fork.o wins then
the build fails to link libc.so due to missing __sys_fork, and if
_fork.o wins then libc silently fails to include the implementation of
_Fork. A similar issue occurred in the past for C99's _Exit conflicting
with exit(2) and was fixed in cb1cb6a2a8, so this adds a fix based on
that.

As a longer-term solution it might be better to instead make the
generated files use a different prefix that's less likely to conflict
with other things (such as __sys_foo.o given they always contain that)
but that's a rather more invasive change.

Fixes:	49ad342cc1 ("Add _Fork()")
Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31895
2021-09-10 01:19:38 +01:00
Baptiste Daroussin
635eb7ac79 fetch: do not confuse capacity and length
The patch converting fetch to getline
(ee3ca711a8),
did confuse the capacity of the line buffer with the actual len of the read
line confusing fetch -v.
2021-09-09 16:51:26 +02:00
Alex Richardson
395db99f32 Export _mmap and __sys_mmap from libc.so
Unlike the other syscalls these two symbols were missing from the
version script. I noticed this while looking into the compiler-rt
runtime libraries for CHERI.

Reviewed by:	brooks
Obtained from:	https://github.com/CTSRD-CHERI/cheribsd/pull/1063
MFC after:	3 days
2021-09-09 11:46:53 +01:00
Ed Maste
19261079b7 openssh: update to OpenSSH v8.7p1
Some notable changes, from upstream's release notes:

- sshd(8): Remove support for obsolete "host/port" syntax.
- ssh(1): When prompting whether to record a new host key, accept the key
  fingerprint as a synonym for "yes".
- ssh-keygen(1): when acting as a CA and signing certificates with an RSA
  key, default to using the rsa-sha2-512 signature algorithm.
- ssh(1), sshd(8), ssh-keygen(1): this release removes the "ssh-rsa"
  (RSA/SHA1) algorithm from those accepted for certificate signatures.
- ssh-sk-helper(8): this is a new binary. It is used by the FIDO/U2F
  support to provide address-space isolation for token middleware
  libraries (including the internal one).
- ssh(1): this release enables UpdateHostkeys by default subject to some
  conservative preconditions.
- scp(1): this release changes the behaviour of remote to remote copies
  (e.g. "scp host-a:/path host-b:") to transfer through the local host
  by default.
- scp(1): experimental support for transfers using the SFTP protocol as
  a replacement for the venerable SCP/RCP protocol that it has
  traditionally used.

Additional integration work is needed to support FIDO/U2F in the base
system.

Deprecation Notice
------------------

OpenSSH will disable the ssh-rsa signature scheme by default in the
next release.

Reviewed by:	imp
MFC after:	1 month
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29985
2021-09-07 21:05:51 -04:00
Brooks Davis
85bea309f9 mprotect.2: Improve the description of prot
The new wording for standard flags is losely based on the POSIX
description.

Make it clearer that PROT_MAX() is a local extension.

Reviewed by:	alc, mckusick, imp, kib, markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D31777
2021-09-07 17:28:50 +01:00
Mark Johnston
f756c91168 kqueue.2: Document the fact that EVFILT_READ can be used on kqueues
Reviewed by:	bcr, kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31864
2021-09-07 11:19:29 -04:00
Emmanuel Vadot
b5be5c35db 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
2021-09-07 10:25:23 +02:00
Emmanuel Vadot
d8d41d3b84 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
2021-09-07 10:24:21 +02:00
Emmanuel Vadot
dfa9131d70 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
2021-09-07 10:23:53 +02:00
Emmanuel Vadot
a30235a4c3 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
2021-09-07 10:23:14 +02:00
Emmanuel Vadot
30975efbaf 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
2021-09-07 10:22:45 +02:00
Emmanuel Vadot
c7fd29f0f2 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
2021-09-07 10:18:11 +02:00
Dimitry Andric
efe67f33c3 compiler-rt: add aarch64 init function for LSE atomics
As reported by Ronald, adding the out-of-line LSE atomics helpers for
aarch64 to compiler-rt was not sufficient to link programs using these,
as they also require a __aarch64_have_lse_atomics global. This is
initialized in compiler-rt's lib/builtins/cpu_model.c, roughly similar
to the x86 CPU model and feature detection in that file.

Since upstream does not yet have a FreeBSD specific implementation for
getting the required information, add a simple one that should work for
now, while I try to get it sorted with the LLVM people.

Reported by:	Ronald Klop <ronald-lists@klop.ws>
Fixes:		cc55ee8009
PR:		257392
MFC after:	2 weeks
2021-09-06 21:24:01 +02:00
Mark Murray
292815eac6 Fix powf().
Summary:
From Steve Kargl:

Paul Zimmermann has identified a bug in Openlibm's powf(),
which is identical to FreeBSD's libm.  Both derived from
fdlibm. https://github.com/JuliaMath/openlibm/issues/212.

Consider

% cat h.c
int
main(void)
{
  float x, y, z;
  x =  0x1.ffffecp-1F;
  y = -0x1.000002p+27F;
  z =  0x1.557a86p115F;
  printf("%e %e %e <-- should be %e\n", x, y, powf(x,y), z);
  return 0;
}

% cc -o h -fno-builtin h.c -lm && ./h
9.999994e-01 -1.342177e+08 inf <-- should be 5.540807e+34

Reviewers: manu

Subscribers: imp, andrew, emaste

Differential Revision: https://reviews.freebsd.org/D31865
2021-09-06 18:51:31 +01:00
Alex Richardson
021385aba5 Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain
When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils as
ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones.
Having the LLVM binutils instead of the elftoolchain ones allows us to use
features such as LTO that depend on binutils that understand LLVM IR.
Another benefit will be an improved user-experience when compiling with
AddressSanitizer, since ASAN does not symbolize backtraces correctly if
addr2line is elftoolchain addr2line instead of llvm-symbolizer.
See https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/000062.html
for more details.

This is currently off by default but will be turned on by default at some
point in the near future.

Reviewed By:	emaste

Differential Revision: https://reviews.freebsd.org/D31060
2021-09-06 09:49:49 +01:00
Brooks Davis
e51b29b5a9 mprotect.2: Remove legacy BSD text
This text dates to the BSD 4.4 import and is misleading.  The mprotect
syscall acts on page granularity and breaks up mappings as required to
do so.

Note that with the addition of non-transparent superpages (aka
largepages) the size of a page at a given address may vary.  This
commit does not attempt to address the lack of documentation of this
feature.

Sponsored by:	DARPA

Reviewed by:	alc, mckusick, imp, kib, markj
Differential Revision:	https://reviews.freebsd.org/D31776
2021-09-03 19:30:23 +01:00
Bryan Drewery
8f8a794775 getdelim(3): Fix losing data on [EAGAIN]
Currently when an [EAGAIN] is encountered we return a partial result
that does not contain the delimeter.  On the next (successful) read we
were returning the next part of the line without the preceding string
from the first failed call.

Fix this by using the same mechanism as ungetc(3) does.  For the buffered
case we could simply set fp->_r and fp->_p back to their values before
sappend() is ran but for simplicity ungetc(3) is done in there as well.

Reviewed by:	kib
Differential Revision: https://reviews.freebsd.org/D31687
2021-09-02 11:26:26 -07:00
Ka Ho Ng
9bb8304c10 Symbol.map: Remove an extra space before _Fork
Make it consistent with all other entries.

Sponsored by:	The FreeBSD Foundation
2021-09-02 21:10:22 +08:00