1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00
Commit Graph

269108 Commits

Author SHA1 Message Date
Roger Pau Monné
41a0aef504 vt/vga: ignore ACPI_FADT_NO_VGA unless running virtualized
There's too many broken hardware out there that wrongly has the
ACPI_FADT_NO_VGA bit set. Ignore it unless running as a virtualized
guest, as then the expectation would be that the hypervisor does
provide correct ACPI tables.

Reviewed by: emaste, 0mp, eugen
Sponsored by: Citrix Systems R&D
PR: 230172

(cherry picked from commit 0518832011)
2022-03-23 14:44:30 +01:00
Roger Pau Monné
88aff320c8 x86/xen: fix CPUID signature
Reviewed by: cem
Sponsored by: Citrix Systems R&D

(cherry picked from commit 396a8479b0)
2022-03-23 14:44:07 +01:00
Alexander Motin
09d62b4382 Remove "/dev/" from geom name in gpart add command.
PR:		232462
MFC after:	1 week

(cherry picked from commit ed5d608911)
2022-03-22 21:28:52 -04:00
Ed Maste
79902c8c2d Add Tempo Semiconductor 92HD95B HDA codec ID
This codec is found in recent versions of the Framework laptop.  Tempo
Semiconductor acquired these products from IDT's Audio Business Unit.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e997f33700)
2022-03-22 21:27:16 -04:00
Mateusz Piotrowski
951da8807d nullfs.5: Add an example fstab(5) entry
Some other file system manual pages like msdosfs(5) feature similar
examples as well.

MFC after:	1 week

(cherry picked from commit 7d62b5df83)
2022-03-22 23:26:35 +01:00
Mateusz Piotrowski
7a88058a0e hier: Document /usr/freebsd-dist
/usr/freebsd-dist is used used by various programs as the location for
FreeBSD distribution files. In-tree programs following this convention
are bsdinstall(8) and release(7).

Reviewed by:	Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34552

(cherry picked from commit 11a6c85d7f)
2022-03-22 23:26:35 +01:00
Mateusz Piotrowski
be6b6b8bf2 uefi.8: Fix style
MFC after:	3 days

(cherry picked from commit 20f0dabb71)
2022-03-22 23:26:34 +01:00
Mateusz Piotrowski
c8b537e135 rc.subr.8: Format notes consistently
MFC after:	3 days

(cherry picked from commit fa1dab788d)
2022-03-22 23:26:34 +01:00
Mateusz Piotrowski
1af65c5009 gptboot.8: Fix a typo and fix lint warnings
MFC after:	3 days

(cherry picked from commit e405ae3097)
2022-03-22 23:26:33 +01:00
Piotr Pawel Stefaniak
acec1d6969 mount: improve error message for invalid filesystem names
For an invalid filesystem name used like this:
mount -t asdfs /dev/ada1p5 /usr/obj

emit an error message like this:
mount: /dev/ada1p5: Invalid fstype: Invalid argument

instead of:
mount: /dev/ada1p5: Operation not supported by device

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

(cherry picked from commit 6e8272f317)
2022-03-22 19:47:13 +01:00
Math Ieu
a4bd2216fb ps: fix ps -aa
Passing the -a flag multiple times made ps show no processes.

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

(cherry picked from commit bf27a2253f)
2022-03-22 19:46:40 +01:00
Piotr Pawel Stefaniak
e0414a826c tcp_wrappers: remove duplicate errno declarations
(cherry picked from commit 9b6a8ee28d)
2022-03-22 19:33:33 +01:00
Piotr Pawel Stefaniak
cf1507aacb tcp_wrappers: include <unistd.h>
This is for getdomainname(3).

(cherry picked from commit 7d636a4d3e)
2022-03-22 19:33:18 +01:00
Piotr Pawel Stefaniak
b8c2459228 ndiscvt: remove set but not used variable
This is a direct commit since ndiscvt has been removed from main.
2022-03-22 19:14:21 +01:00
Piotr Pawel Stefaniak
c38d2d1811 procstat: remove set but not used variable
In an earlier version of D26310, strcmp was strncmp.

(cherry picked from commit 8b1f5965d9)
2022-03-22 18:36:16 +01:00
Piotr Pawel Stefaniak
15635c0ed3 backlight: Remove set but not used variable
(cherry picked from commit fde687c239)
2022-03-22 18:36:04 +01:00
Ed Maste
812638797d Update deprecation notice in snd_maestro, snd_ds1
These drivers are broken and have been scheduled for removal since 2012.
They will finally be removed before FreeBSD 14.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 1d7f6de5cf)
2022-03-21 20:45:16 -04:00
hlh-restart
205fa5f0a5 rtsx: Call rtsx_init() on resume.
MFC after:	3 days

(cherry picked from commit 1b1bab0078)
2022-03-21 20:28:34 -04:00
Xin LI
08038f3cbf Update leap-seconds to leap-seconds.3676924800
Obtained from:	ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.3676924800
(cherry picked from commit 1d33307434)
2022-03-21 15:44:38 -07:00
Philip Paeps
5dbd160076 contrib/tzdata: import tzdata 2022a
Merge commit '971fa603f2bdf16273135a00ff16c5585520c53f'

Changes: https://github.com/eggert/tz/blob/2022a/NEWS

With this merge, we return to our previous long-standing practice of
distributing the IANA Time Zone Database unmodified.

Releases of tzdb since 2021b have merged some time zones where clocks
have agreed since 1970.  The overwhelming majority of users will not be
affected by this change.  A port of the newly created global-tz fork of
the IANA Time Zone database (misc/global-tz) is available for users who
need more granular pre-1970 time zone history.

(cherry picked from commit 8ea5af2b77)
2022-03-21 23:26:58 +08:00
Mateusz Piotrowski
2411090f69 zfskeys: Support autoloading of keys stored on ZFS
The zfskeys service script starts before the zfs service script, so that
dataset decryption keys are available when `zfs mount -a` is run. One of
the potential edge cases of this design is that if a key is stored on
ZFS it won't be loaded until `zfs mount -a` is issued.

In order to address that let's try to load the additional keys and mount
related ZFS datasets after the zfs script finishes its standard mounting
procedure.

PR:		262468
Reported by:	Graham Perrin <grahamperrin@gmail.com>
Reviewed by:	allanjude
Approved by:	allanjude (src)
Fixes:	33ff39796f Add zfskeys rc.d script for auto-loading encryption keys
MFC after:	3 days
Sponsored by:	Modirum
Sponsored by:	Klara Inc.
Differential Revision: https://reviews.freebsd.org/D34601

(cherry picked from commit 97aeda2243)
2022-03-21 15:47:20 +01:00
Mark Johnston
476b3bb091 fusefs: Initialize a pad word in the mknod message
Reported by:	Jenkins (KMSAN job)
Reviewed by:	asomers
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c0b98fe16f)
2022-03-21 10:42:39 -04:00
Vincenzo Maffione
ddb842e2ad netmap: add a tunable for the maximum number of VALE switches
The new dev.netmap.max_bridges sysctl tunable can be set in
loader.conf(5) to change the default maximum number of VALE
switches that can be created. Current defaults is 8.

MFC after:	2 weeks

(cherry picked from commit dd6ab49a9a)
2022-03-20 09:00:50 +00:00
Kristof Provost
f6138d93b5 if_epair: build fix
66acf7685b failed to build on riscv (and mips). This is because the
atomic_testandset_int() (and friends) functions do not exist there.
Happily those platforms do have the long variant, so switch to that.

PR:		262571
MFC after:	3 days

(cherry picked from commit 0bf7acd6b7)
2022-03-20 01:25:03 +01:00
Vincenzo Maffione
9f600a260a netmap: Fix TOCTOU vulnerability in nmreq_copyin
The total size of the user-provided nmreq was first computed and then
trusted during the copyin. This might lead to kernel memory corruption
and escape from jails/containers.

Reported by: Lucas Leong (@_wmliang_) of Trend Micro Zero Day Initiative
Security: CVE-2022-23084
MFC after:	3 days

(cherry picked from commit 3937299165)
2022-03-19 17:36:39 +00:00
Vincenzo Maffione
9df8dd3ea3 netmap: Fix integer overflow in nmreq_copyin
An unsanitized field in an option could be abused, causing an integer
overflow followed by kernel memory corruption. This might be used
to escape jails/containers.

Reported by: Reno Robert and Lucas Leong (@_wmliang_) of Trend Micro
Zero Day Initiative
Security: CVE-2022-23085

(cherry picked from commit 694ea59c70)
2022-03-19 17:36:27 +00:00
Warner Losh
eeec49e0b3 devd: correct wifi regexp
Correct the wifi regexp to include iwlwifi and remove wi driver that was
has been retired.

Sponsored by:		Netflix

(cherry picked from commit e0ab0ff104)
2022-03-19 07:59:07 -06:00
Warner Losh
cb95daaa91 devd: remove the scsi regexp
We don't really use the scsi regexp for anything. The rescan was a
workaround that was fixed a long time ago and has been disabled for
ages. And the regexp was incomplete.

Sponsored by:		Netflix

(cherry picked from commit 926e825ef8)
2022-03-19 07:59:07 -06:00
Mariusz Zaborski
e7023af434 touch: don't leak descriptor if fstat(2) fails
If fstat(2) fails the close(2) won't be called, which will leak the
file descriptor.

The idea was borrowed from OpenBSD, where similar patch
was applied for futimens(2).

MFC after:	1 week

(cherry picked from commit cb54c500d0)
2022-03-19 14:16:29 +01:00
Eugene Grosbein
4a11315a2c virtio_random(8): MFC: avoid deadlock at shutdown time (regression fix)
FreeBSD 13+ running as virtual guest may load virtio_random(8) driver
by means of devd(8) unless the driver is blacklisted or disabled
via device.hints(5). Currently, the driver may prevent
the system from rebooting or shutting down correctly.

This change deactivates virtio_random at very late stage
during system shutdown sequence to avoid deadlock
that results in kernel hang.

PR:		253175
Tested by:	tom
Relnotes:	yes

(cherry picked from commit adbf7727b3)
2022-03-19 11:20:58 +07:00
Zhenlei Huang
f877ca16c9 x86: Correctly report unexpected cache level
Reviewed by:	rpokala, emaste
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D34577

(cherry picked from commit ba46c6c4b7)
2022-03-18 20:31:00 -04:00
Toomas Soome
01f549e1c9 WITHOUT_BOOT build option appears to include stand, failing on libsa
building libsa needs to use -I${LDRSRC} for some files.

PR:		260083
Submitted by:	Ivan Rozhuk
Approved by:	re (gjb, early MFC)

(cherry picked from commit 9633c3d874)
2022-03-19 01:10:36 +02:00
Mark Johnston
c764d4468f armv8crypto: Remove leftover debug printfs
Fixes:	26b08c5d21 ("armv8crypto: Use cursors to access crypto buffer data")
Reported by:	bz

(cherry picked from commit c89def05b5)
2022-03-18 11:31:57 -04:00
Mark Johnston
f180b84358 armv8crypto: Use cursors to access crypto buffer data
Currently armv8crypto copies the scheme used in aesni(9), where payload
data and output buffers are allocated on the fly if the crypto buffer is
not virtually contiguous.  This scheme is simple but incurs a lot of
overhead: for an encryption request with a separate output buffer we
have to
- allocate a temporary buffer to hold the payload
- copy input data into the buffer
- copy the encrypted payload to the output buffer
- zero the temporary buffer before freeing it

We have a handy crypto buffer cursor abstraction now, so reimplement the
armv8crypto routines using that instead of temporary buffers.  This
introduces some extra complexity, but gallatin@ reports a 10% throughput
improvement with a KTLS workload without additional CPU usage.  The
driver still allocates an AAD buffer for AES-GCM if necessary.

Reviewed by:	jhb
Tested by:	gallatin
Sponsored by:	Ampere Computing LLC
Submitted by:	Klara Inc.

(cherry picked from commit 26b08c5d21)
2022-03-18 11:31:44 -04:00
Mark Johnston
2d7f27a4fb opencrypto: Add a routine to copy a crypto buffer cursor
This was useful in converting armv8crypto to use buffer cursors.  There
are some cases where one wants to make two passes over data, and this
provides a way to "reset" a cursor.

Reviewed by:	jhb

(cherry picked from commit 09bfa5cf16)
2022-03-18 11:31:33 -04:00
Mark Johnston
04df02b2f4 armv8crypto: Factor out some duplicated GCM code
This is in preparation for using buffer cursors.  No functional change
intended.

Reviewed by:	jhb
Sponsored by:	Ampere Computing LLC
Submitted by:	Klara Inc.

(cherry picked from commit 0b3235ef74)
2022-03-18 11:29:24 -04:00
Ed Maste
7d59a9451d loader: accept "yellow" as a named color
For historical reasons console color number 3 may be either yellow (most
consoles) or brown (VGA palette).  The console escape code standard
uses "yellow", but teken color name constants appear to be based on the
VGA scheme and use TC_BROWN for color 3.  Even so, the palette table
used 50,50,0 as the RGB percentage tuple, resulting in a dim yellow for
framebuffer consoles at the time teken was introduced.

Amusingly, in 19e2ce2d83 the comment on the palette entry was changed
from "brown" to "dark yellow" but the colour itself was changed from
a pure yellow to being somewhat brown.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e9249ef958)
2022-03-17 21:58:51 -04:00
Ed Maste
1dcb6002c5 loader: support numeric and named bright colors (8-15)
Accept "bright" or "light" prefix for named colors.

For numeric colors, update error message to specify that values 0 to 15
are allowed, and verify that values are in that range.

Reviewed by:	imp, tsoome (both earlier version)
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34512

(cherry picked from commit 425e57e7a2)
2022-03-17 21:58:01 -04:00
Hans Petter Selasky
19b779498c xhci(4): Add quirk for "Fresco Logic FL1009 USB3.0 xHCI Controller".
Submitted by:		John F Carr <jfc@mit.edu>
Sponsored by:		NVIDIA Networking

(cherry picked from commit 19837718ab)
2022-03-17 10:55:18 +01:00
Hans Petter Selasky
d17c5a4f62 LinuxKPI: Add comment describing proper use of the on_each_cpu() function.
Sponsored by:		NVIDIA Networking

(cherry picked from commit c6cf874c7d)
2022-03-17 10:55:15 +01:00
Hans Petter Selasky
d67b2c9615 lindebugfs: Make single_release() NULL safe.
Sponsored by:	NVIDIA Networking

(cherry picked from commit a23e475c48)
2022-03-17 10:55:12 +01:00
Hans Petter Selasky
a16772a811 lindebugfs: The Linux file operations use negative return values in the kernel.
Fix sign.

Sponsored by:	NVIDIA Networking

(cherry picked from commit 68ec2949ad)
2022-03-17 10:55:07 +01:00
Hans Petter Selasky
b5cc52c21d lindebugfs: Zero the linux_file structure before use.
This avoids clients using garbage values on the stack and makes
debugging easier.

Sponsored by:	NVIDIA Networking

(cherry picked from commit 88a29d89eb)
2022-03-17 10:55:02 +01:00
Wuyang Chung
4391c305e8 newfs(8): Fix a bug in initialization of sblock.fs_maxbsize .
Fixes:		1c85e6a35d (SVN r98542)
Pull Request:	https://github.com/freebsd/freebsd-src/pull/587
Sponsored by:	NVIDIA Networking

(cherry picked from commit c5f549c1e0)
2022-03-17 10:54:57 +01:00
Hans Petter Selasky
90afe1886f usbtest: Fix issue when multiple devices are sharing same USB vendor and product ID.
When there are multiple devices sharing the same USB vendor and product ID,
the wrong device may be selected. Fix this by also matching the bus and
device address, ugen<X>.<Y> .

Sponsored by:	NVIDIA Networking

(cherry picked from commit 16346e1401)
2022-03-17 10:54:52 +01:00
Ed Maste
2a71933318 dumpon: use underlying device if encrypted swap is in use
/etc/rc.d/dumpon runs before /etc/rc.d/swap.  When encrypted swap is in
use the .eli or .bde device will not exist at the time dumpon runs.

Even if this is addressed it does not make sense to dump core to
encrypted swap, as the encryption key will not be available after
reboot rendering the dump useless.  Thus, for the case that dumpdev=AUTO
and encrypted swap is in use, strip the extension and use the underlying
device.

Emit a warning if we are using the underlying device and the user has not
configured dump encryption, so that the user knows that the will not be
encrypted.

PR:		238301
Reported by:	Ivan Rozhuk
Reviewed by:	jilles
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34474

(cherry picked from commit 67e751f167)
2022-03-16 21:08:56 -04:00
Michael Gmelin
bb9ad300f0 if_epair: fix race condition on multi-core systems
As an unwanted side effect of the performance improvements in
24f0bfbad5, epair interfaces stop forwarding traffic on higher
load levels when running on multi-core systems.

This happens due to a race condition in the logic that decides when to
place work in the task queue(s) responsible for processing the content
of ring buffers.

In order to fix this, a field named state is added to the epair_queue
structure. This field is used by the affected functions to signal each
other that something happened in the underlying ring buffers that might
require work to be scheduled in task queue(s), replacing the existing
logic, which relied on checking if ring buffers are empty or not.

epair_menq() does:
  - set BIT_MBUF_QUEUED
  - queue mbuf
  - if testandset BIT_QUEUE_TASK:
      enqueue task

epair_tx_start_deferred() does:
  - swap ring buffers
  - process mbufs
  - clear BIT_QUEUE_TASK
  - if testandclear BIT_MBUF_QUEUED
      enqueue task

PR:		262571
Approved by:    re (gjb, early MFC)
Reported by:	Johan Hendriks <joh.hendriks@gmail.com>
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D34569

(cherry picked from commit 66acf7685b)
2022-03-17 00:38:33 +01:00
Kirk McKusick
934ba51bc9 Ensure that fsck(8) / fsck_ffs(8) produces the correct exit code for missing devices.
PR:          262580
Approved by: re (gjb, early MFC)

(cherry picked from commit 2983ec0a87)
2022-03-16 15:56:52 -07:00
Hans Petter Selasky
ea318f1ad1 xhci(4): Add quirk for "TUSB73x0 USB3.0 xHCI Controller".
Tested by:	br@
Sponsored by:	NVIDIA Networking

(cherry picked from commit 33cbbf268f)
2022-03-16 15:55:22 +01:00
Jung-uk Kim
97fe61d5bf OpenSSL: Merge OpenSSL 1.1.1n
(cherry picked from commit 5ac766ab8e)
2022-03-15 19:48:04 -04:00