Commit Graph

269336 Commits

Author SHA1 Message Date
Edward Tomasz Napierala
2ec26ae402 linux: Improve debug for PTRACE_GETEVENTMSG
No functional changes.

Sponsored By:	EPSRC
2021-10-23 19:53:12 +01:00
Edward Tomasz Napierala
6e66030c4c linux: implement PTRACE_EVENT_EXEC
This fixes strace(1) from Ubuntu Focal.

Reviewed By:	jhb
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D32367
2021-10-23 19:46:26 +01:00
Dimitry Andric
4b9725184e Fix clang's internal assembler adding unwanted prefix to VIA xstore
Merge commit 2d8c18fbbdd1 from llvm git (by Jessica Clarke):

  [X86] Don't add implicit REP prefix to VIA PadLock xstore

  Commit 8fa3e8fa1492 added an implicit REP prefix to all VIA PadLock
  instructions, but GNU as doesn't add one to xstore, only all the others.
  This resulted in a kernel panic regression in FreeBSD upon updating to
  LLVM 11 (https://bugs.freebsd.org/259218) which includes the commit in
  question. This partially reverts that commit.

  Reviewed By: craig.topper

  Differential Revision: https://reviews.llvm.org/D112355

MFC after:	3 days
2021-10-23 20:20:00 +02:00
Edward Tomasz Napierala
2558bb8e91 linux: Make PTRACE_GET_SYSCALL_INFO handle EJUSTRETURN
This fixes panic when trying to run strace(8) from Focal.

Reviewed By:	kib
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D32355
2021-10-23 18:56:39 +01:00
Edward Tomasz Napierala
e3a83df119 linux: Improve debug for PTRACE_GETREGSET
No functional changes.

Sponsored By:	EPSRC
2021-10-23 09:30:06 +01:00
Edward Tomasz Napierala
2c7f798282 linux: Fix ENOTSOCK handling in sendfile(2)
The Linux way for sendfile(2) to tell the application
to fallback to another way of copying data is by EINVAL,
not ENOTSOCK.  This fixes package installation scripts
for Mono packages from Focal.

Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D32604
2021-10-23 09:15:58 +01:00
Edward Tomasz Napierala
3417c29851 linux: Constify bsd_to_linux_regset()
No functional changes.

Reviewed By:	emaste
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D32599
2021-10-23 08:33:58 +01:00
Peter Holm
50b8e3efaf stress2: Fix typo 2021-10-23 06:39:36 +00:00
Warner Losh
3550a49f68 msun: Add copyright notices
These files were copied from MUSL. Add the standard copyright notice and
SPDX-License-Identifier: MIT consistent with our new draft license
policy. It reads word for word the same as the MIT license on the SPDX
web site. Add a pointer to the MUSL COPYIRGHT file which contains a list
of all authors of MUSL.

Sponsored by:		Netflix
Noticed by:		Steve Kargl
2021-10-22 22:00:54 -06:00
Ed Maste
7b1e19ad78 Add libfido2 to the build
From https://github.com/Yubico/libfido2:

    libfido2 provides library functionality and command-line tools to
    communicate with a FIDO device over USB, and to verify attestation
    and assertion signatures.

    libfido2 supports the FIDO U2F (CTAP 1) and FIDO 2.0 (CTAP 2)
    protocols.

libfido2 will be used by ssh to support FIDO/U2F keys. It is currently
intended only for use by ssh, and so is installed as a PRIVATELIB and is
placed in the ssh pkgbase package.

This is currently disabled for the 32-bit library build as libfido2 is
not compatible with the COMPAT_32BIT hack in usb_ioctl.h.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32448
2021-10-22 19:57:57 -04:00
Konstantin Belousov
362c6d8dec nehemiah: manually assemble xstore(-rng)
It seems that clang IAS erronously adds repz prefix which should not be
there.  Cpu would try to store around %ecx bytes of random, while we
only expect a word.

PR:	259218
Reported and tested by:	 Dennis Clarke <dclarke@blastwave.org>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-10-23 02:31:16 +03:00
Ed Maste
5fff2859ec bsnmpd: Remove "All Rights Reserved" from FreeBSD Foundation copyrights
Sponsored by:	The FreeBSD Foundation
2021-10-22 18:53:35 -04:00
Gleb Smirnoff
c8ee75f231 Use network epoch to protect local IPv4 addresses hash.
The modification to the hash are already naturally locked by
in_control_sx.  Convert the hash lists to CK lists. Remove the
in_ifaddr_rmlock. Assert the network epoch where necessary.

Most cases when the hash lookup is done the epoch is already entered.
Cover a few cases, that need entering the epoch, which mostly is
initial configuration of tunnel interfaces and multicast addresses.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D32584
2021-10-22 14:40:53 -07:00
Gleb Smirnoff
c242672339 Fix sconfig(8) build.
Missed that since sconfig(8) was built on i386 only. Since I enabled
cp(4) on amd64, enable sconfig(8) as well.

Fixes:	6aae3517ed
2021-10-22 13:28:44 -07:00
Mark Johnston
70f51f0e47 Revert "Handle partial reads in zfs_read"
This reverts commit 59eab1093a.

The change suppressed EFAULT originating from uiomove().  The deadlock
avoidance mechanism implemented by vn_io_fault1() in the VFS handles
such errors by wiring the user pages and retrying, but this change
caused read() to return early instead.  This can result in short I/O,
causing misbehaviour in some applications, and possibly other
consequences.

Until this is resolved somehow, revert the commit.

Approved by:	mm
2021-10-22 15:16:42 -04:00
Gleb Smirnoff
6aae3517ed Retire synchronous PPP kernel driver sppp(4).
The last two drivers that required sppp are cp(4) and ce(4).

These devices are still produced and can be purchased
at Cronyx <http://cronyx.ru/hardware/wan.html>.

Since Roman Kurakin <rik@FreeBSD.org> has quit them, they no
longer support FreeBSD officially.  Later they have dropped
support for Linux drivers to.  As of mid-2020 they don't even
have a developer to maintain their Windows driver.  However,
their support verbally told me that they could provide aid to
a FreeBSD developer with documentaion in case if there appears
a new customer for their devices.

These drivers have a feature to not use sppp(4) and create an
interface, but instead expose the device as netgraph(4) node.
Then, you can attach ng_ppp(4) with help of ports/net/mpd5 on
top of the node and get your synchronous PPP.  Alternatively
you can attach ng_frame_relay(4) or ng_cisco(4) for HDLC.
Actually, last time I used cp(4) back in 2004, using netgraph(4)
instead of sppp(4) was already the right way to do.

Thus, remove the sppp(4) related part of the drivers and enable
by default the negraph(4) part.  Further maintenance of these
drivers in the tree shouldn't be a big deal.

While doing that, remove some cruft and enable cp(4) compilation
on amd64.  The ce(4) for some unknown reason marks its internal
DDK functions with __attribute__ fastcall, which most likely is
safe to remove, but without hardware I'm not going to do that, so
ce(4) remains i386-only.

Reviewed by:		emaste, imp, donner
Differential Revision:	https://reviews.freebsd.org/D32590
See also:		https://reviews.freebsd.org/D23928
2021-10-22 11:41:36 -07:00
Leandro Lupori
a23e18ea54 powerpc64: tell kernel when radix is not available
If CAS detects that radix is not supported, set radix_mmu to 0
to avoid the kernel trying to use it and panic.

MFC after:	2 weeks
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
2021-10-22 13:44:21 -03:00
Mark Johnston
d7acbe481d vm_page: Break reservations to handle noobj allocations
vm_reserv_reclaim_*() will release pages to the default freepool, not
the direct freepool from which noobj allocations are drawn.  But if both
pools are empty, the noobj allocator variants must break reservations to
make progress.

Reported by:	cy
Reviewed by:	kib (previous version)
Fixes:	b498f71bc5 ("vm_page: Add a new page allocator interface for unnamed pages")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32592
2021-10-22 09:25:59 -04:00
Randall Stewart
4e4c84f8d1 tcp: Add hystart-plus to cc_newreno and rack.
TCP Hystart draft version -03:
https://datatracker.ietf.org/doc/html/draft-ietf-tcpm-hystartplusplus

Is a new version of hystart that allows one to carefully exit slow start if the RTT
spikes too much. The newer version has a slower-slow-start so to speak that then
kicks in for five round trips. To see if you exited too early, if not into congestion avoidance.
This commit will add that feature to our newreno CC and add the needed bits in rack to
be able to enable it.

Reviewed by: tuexen
Sponsored by: Netflix Inc.
Differential Revision:	https://reviews.freebsd.org/D32373
2021-10-22 07:10:28 -04:00
Peter Grehan
5a3eb6207a igc: correctly update RCTL when changing multicast filters.
Fix clearing of bits in RCTL for the non-bpf/non-allmulti case.
Update RCTL after modifying the multicast filter registers as per
the Linux driver.

This fixes LACP on igc interfaces, where incoming LACP multicasti
control packets were being dropped.

Reviewed by:	kbowling
Obtained from:	Rubicon Communications, LLC ("Netgate")
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D32574
2021-10-22 21:16:12 +10:00
Bjoern A. Zeeb
3dc7a1897e net80211: correct input_sta length checks and control frame handling
Correct input_sta "assertion" checks.  CTS/ACK CTRL frames are shorter
then sizeof(struct ieee80211_frame_min) and were thus running into the
is_rx_tooshort error case.
Use ieee80211_anyhdrsize() to handle this better but make sure we do
at least have the first 2 octets needed for that.
While here move the safety checks before any code which may not obey
them later, just for good style.

The non-scanning check further down assumes a frame format also not
matching control frames.  For now skip the checks for control frames
which allows us to deal with some of them at least now.

Sponsored by:	The FreeBSD Foundation
Obtained from:	20210906 wireless v0.91 code drop
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D32238
2021-10-22 10:42:06 +00:00
Bjoern A. Zeeb
9a6695532b net80211/drivers: improve ieee80211_rx_stats for band
While IEEE80211_R_BAND was defined, there was no place to store the
band.  Add a field for that, adjust ieee80211_lookup_channel_rxstatus()
to require it, and update drivers passing "R_{FREQ|IEEE}" in already to
provide the band as well.  For the moment keep the fall-back code
requiring all three fields.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D30662
2021-10-22 09:55:54 +00:00
Kristof Provost
30276ef12c pf tests: test NAT-ed ICMP errors
Ensure that the ICMP error is returned with the correct
source and destination addresses.

MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32572
2021-10-22 09:52:17 +02:00
Luiz Otavio O Souza
ab238f1454 pf: ensure we have the correct source/destination IP address in ICMP errors
When we route-to a packet that later turns out to not fit in the
outbound interface MTU we generate an ICMP error.
However, if we've already changed those (i.e. we've passed through a NAT
rule) we have to undo the transformation first.

Obtained from:	pfSense
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32571
2021-10-22 09:52:17 +02:00
Elliott Mitchell
cfd8fda159
RELNOTES: Fix KMSAN entry
The lead digit was lost in 05eba8e068 making it impossible to find the
commit.

The two subsequent RELNOTES commits gave one less digit of the commit
hash, which is what `git rev-parse --short` thinks the minimal length is,
but keep them to align with other entries.

Fixes:		05eba8e068
Differential Revision:	https://reviews.freebsd.org/D32595
2021-10-22 15:16:54 +08:00
Philip Paeps
b02df2322c contrib/tzdata: import tzdata 2021e
Merge commit 'c66f7aacfc78e5e86469f85f20d3d4fc7d1e9a74'

Changes: https://github.com/eggert/tz/blob/2021e/NEWS

MFC after:	3 days
2021-10-22 13:20:20 +08:00
Philip Paeps
c66f7aacfc Import tzdata 2021e 2021-10-22 13:17:04 +08:00
Li-Wen Hsu
73f8667ed4
Document my doc commit bit history
Reminded by:	ygy
2021-10-22 11:54:06 +08:00
Colin Percival
6fa58bfb3e uefi(8): loader.efi does not search for loader.efi
This man page formerly referred to boot1.efi searching for loader.efi;
when boot1.efi was obsoleted in favour of having loader.efi launched
directly, this was left claiming that loader.efi searched for
loader.efi.

Reviewed by:	bcran
Fixes:		db8b561345 Rework UEFI ESP generation
Differential Revision:	https://reviews.freebsd.org/D32334
2021-10-21 13:17:33 -07:00
Guangyuan Yang
d677560dd0 arswitch(4): Hook new manpage to build
PR:		211668
Fixes:		262717e270
Reported by:	jhb
2021-10-21 15:23:48 -04:00
Konstantin Belousov
3b5331dd8d uipc_shm: silent warnings about write-only variables in largepage code
In shm_largepage_phys_populate(), the result from vm_page_grab() is only
needed for assertion.

In shm_dotruncate_largepage(), there is a commented-out prototype code
for managed largepages.   The oldobjsz is saved for its sake, so mark
the variable as __unused directly.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-10-21 21:40:46 +03:00
Konstantin Belousov
3d2778515a sig_ast_checksusp(): mark the local p as __diagused
It is only used to assert that the (current) process is locked

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-10-21 21:40:46 +03:00
Konstantin Belousov
6776747a0e subr_firmware.c::unloadentry(): remote write-only variable
The function ignores result returned by linker_release_module().
The FW_UNLOAD flag on the file is cleared, so even on error it would
not be tried again.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-10-21 21:40:46 +03:00
Konstantin Belousov
993446638c alq_open_flags(): mark local td variable as unused
It is passed to the NDINIT() macro which ignores the thread argument
for some time.

Sponsored by:	The FreeBSD Foundation
2021-10-21 21:40:46 +03:00
Konstantin Belousov
661bd70bd7 DMAR: clean up warnings about write-only variables
For some of them, used only when KTR or KMSAN are configured, apply
__unused attribute directly.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-10-21 21:40:46 +03:00
Konstantin Belousov
bded8fa300 umtxq_requeue: remove write-only variable uh2
umtxq_queue_lookup() does not change state.  It is redone inside
umtxq_insert() later, anyway.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-10-21 21:40:46 +03:00
Konstantin Belousov
2030ee0e1b ufs: remove write-only variables
Mark variables as __diagused for invariant-only vars

Reviewed by:	imp, mjg
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32577
2021-10-21 21:40:46 +03:00
John Baldwin
96668a81ae ktls: Always create a software backend for receive sessions.
A future change to TOE TLS will require a software fallback for the
first few TLS records received.  Future support for NIC TLS on receive
will also require a software fallback for certain cases.

Reviewed by:	gallatin, hselasky
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D32566
2021-10-21 09:37:17 -07:00
John Baldwin
b33ff94123 ktls: Change struct ktls_session.cipher to an OCF-specific type.
As a followup to SW KTLS assuming an OCF backend, rename
struct ocf_session to struct ktls_ocf_session and forward
declare it in <sys/ktls.h> to use as the type of
struct ktls_session.cipher.

Reviewed by:	gallatin, hselasky
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D32565
2021-10-21 09:36:53 -07:00
John Baldwin
c57dbec69a ktls: Add a routine to query information in a receive socket buffer.
In particular, ktls_pending_rx_info() determines which TLS record is
at the end of the current receive socket buffer (including
not-yet-decrypted data) along with how much data in that TLS record is
not yet present in the socket buffer.

This is useful for future changes to support NIC TLS receive offload
and enhancements to TOE TLS receive offload.  Those use cases need a
way to synchronize a state machine on the NIC with the TLS record
boundaries in the TCP stream.

Reviewed by:	gallatin, hselasky
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D32564
2021-10-21 09:36:29 -07:00
Kyle Evans
f1f7f31366 cmp: initialize limit to avoid stack garbage limits
Pointy hat:	kevans
Fixes:	4e380e8474 ("cmp: add -n, --bytes to limit number of bytes [...]")
Sponsored by:	Klara, Inc.
2021-10-21 11:30:55 -05:00
Dawid Gorecki
8cb175ba0c Enable stack gap on arm64
Stack gap code used on amd64 can also be reused for arm64. Point
sv_stackgap to elf64_stackgap to enable this feature.

Reviewed by: mw, kib, emaste
Tested by: mw
MFC: after 1 month
Differential Revision: https://reviews.freebsd.org/D32588
2021-10-21 17:20:08 +02:00
Martin Matuska
6ba2210ee0 zfs: merge openzfs/zfs@ec64fdb93 (master) into main
Notable upstream pull request merges:
  #12392 Avoid panic in case of pool errors and missing L2ARC
  #12448 skip snapshot in zfs_iter_mounted()
  #12516 Fix NFS and large reads on older kernels
  #12533 Fail invalid incremental recursive send gracefully
  #12569 FreeBSD: Really zero the zero page
  #12575 Reject zfs send -RI with nonexistent fromsnap
  #12602 Correct refcount_add in dmu_zfetch
  #12650 zpool should call zfs_nicestrtonum() with non-NULL handle

Obtained from:	OpenZFS
OpenZFS commit:	ec64fdb93d
2021-10-21 15:06:06 +02:00
Andrew Turner
01593a0ff9 Only change the fadt revision in acpidump on i386
There is a workaround in acpidump for an old IBM laptop. This is being
hit on a modern arm64 system causing acpidump to use the wrong field
when reading a later address.

As the laptop has a 32-bit CPU the only FreeBSD support for it is i386.
As such limit the workaround to that architecture.

Reviewed by:	emaste, jkim, jhb (all earlier version)
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32573
2021-10-21 12:20:32 +01:00
Mateusz Piotrowski
12615938c6 timeout.1: Fix typos in examples
MFC after:	3 days
2021-10-21 13:07:32 +02:00
Elliott Mitchell
5bb67f5f3f xen/devices: purge uses of intr_machdep.h
Devices in sys/dev should be architecture-independent and NOT #include
intr_machdep.h.

Reviewed by: mhorne royger
Differential Revision: https://reviews.freebsd.org/D29959
2021-10-21 09:39:16 +02:00
Roger Pau Monné
535badd1b8 xen/pcifront: purge from tree
Xen pcifront has been unhooked from the build for a long time, as it's
only used by PV mode which FreeBSD doesn't support. Remove it from the
tree.
2021-10-21 09:39:16 +02:00
Rebecca Cran
35175e100a bhyve: Bump the SMBIOS firmware version to 14.0 for 14-CURRENT
Bump the firmware version to 14.0 and set the firmware release date
to today.

Reviewed by: jhb, bz, imp
Differential Revision: https://reviews.freebsd.org/D32534
2021-10-20 22:10:33 -06:00
Konstantin Belousov
2c7a6dad4d ldd: do not use dlopen(RTLD_TRACE) for dso when format is specified
Problem is that rtld cannot reliably access updated environment.
This was made more obvious by bfd4c875a1.  The application
environment can be in arbitrary state and place, system components
can observe it only during execve(2), or in case of rtld, right after
execve, when environment is still at know location and format.

Instead spawn ld-elf.so.1 in direct exec mode which can correctly read
all inherited updates to the environment.

PR:	259069
Reviewed by:	arichardson, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32464
2021-10-21 03:09:14 +03:00
Konstantin Belousov
ca8c576d10 ldd: style
Reviewed by:	arichardson, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32464
2021-10-21 03:09:03 +03:00