Commit Graph

273375 Commits

Author SHA1 Message Date
Ed Maste
2b20327ec9 dumpon: proceed without compression if the kernel lacks support
PR:		252554
Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34520
2022-03-16 12:08:28 -04:00
Hans Petter Selasky
19837718ab xhci(4): Add quirk for "Fresco Logic FL1009 USB3.0 xHCI Controller".
Submitted by:		John F Carr <jfc@mit.edu>
MFC after:		1 week
Sponsored by:		NVIDIA Networking
2022-03-16 16:49:00 +01:00
Hans Petter Selasky
c6cf874c7d LinuxKPI: Add comment describing proper use of the on_each_cpu() function.
MFC after:		1 week
Sponsored by:		NVIDIA Networking
2022-03-16 15:44:07 +01:00
Fernando Apesteguía
4bbc8ee29e logger.1: Clarify -i flag
The PID of the logger process is always recorded along with the move from RFC
3164 to RFC 5424.

Indicate the -i flag is a no-op now in logger(1).

Related to a similary change in syslog.3

Reported by:	danfe@
Approved by:	manpages (0mp)
Fixes:	94eb6c42ab
Differential Revision:	https://reviews.freebsd.org/D34578
2022-03-16 11:41:55 +01:00
Vincenzo Maffione
3937299165 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
2022-03-16 06:58:50 +00:00
Vincenzo Maffione
694ea59c70 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
2022-03-16 06:57:54 +00:00
Eugene Grosbein
adbf7727b3 virtio_random(8): avoid deadlock at shutdown time
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
MFC after:	3 days
2022-03-16 11:41:51 +07:00
Alexander Motin
ed5d608911 Remove "/dev/" from geom name in gpart add command.
PR:		232462
MFC after:	1 week
2022-03-16 00:09:09 -04:00
Alexander Motin
bd0f3d34fa GEOM: Fix regression after 7f16b501e2.
find_geom() in some classes trim leading "/dev/" from geom names.
Lack of that in geom_gettree_geom() broke some existing scripts.

PR:		262554
MFC after:	2 months
2022-03-16 00:06:49 -04:00
Andy Fiddaman
f6f357efb1 bhyve: missing mutex initializations
Explicitly initialize the mutex that a PCI virtio module passes back to
virtio.

It so happens that these mutexes were being initialized regardless, no
functional change intended.

Reviewed by:    chuck, jhb
Differential Revision:  https://reviews.freebsd.org/D34372
2022-03-15 19:54:16 -08:00
Alfonso S. Siciliano
8cdecdecb4
spkrtest(8): Replace dialog with bsddialog
Replace (LGPL) dialog with (BSD-2-Clause) bsddialog and update manual.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34459
2022-03-16 01:48:53 +01:00
Justin Hibbits
d7661890ef gpiopower: Fix failure case for attach
Summary:
We really should be checking the return value of
ofw_gpiobus_parse_gpios_impl, not the value of sc_pins, which isn't
changed on failure.

Reported by:	alfredo@

Reviewers: #powerpc, alfredo

Reviewed By: #powerpc, alfredo

Subscribers: imp, loos

Differential Revision: https://reviews.freebsd.org/D34571
2022-03-15 19:16:17 -05:00
Jung-uk Kim
5ac766ab8e OpenSSL: Merge OpenSSL 1.1.1n 2022-03-15 19:37:45 -04:00
Alfonso S. Siciliano
f27c6a3e87
bsdinstall/distfetch: Replace libdialog with libbsddialog
Replace (LGPL) libdialog with (BSD-2-Clause) libbsddialog,
while here diversify error messages to find quickly the exact point
of failure.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34464
2022-03-16 00:27:36 +01:00
Andrew Turner
813738faba Fix arm64 TLB invalidation with non-4k pages
When using 16k or 64k pages atop will shift the address by more than
the needed amount for a tlbi instruction. Replace this with a new macro
to shift the address by 12 and use PAGE_SIZE in the for loop to let the
code work with any page size.

Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34516
2022-03-15 17:25:28 +00:00
Andrew Turner
51f5cafcdc Remove a redundant L1_BLOCK == L2_BLOCK check
We have two checks for L1_BLOCK == L2_BLOCK. Remove one.

Sponsored by:	The FreeBSD Foundation
2022-03-15 17:25:28 +00:00
Gordon Tetlow
fdc418f15e Fix a bug in BN_mod_sqrt() that can cause it to loop forever.
Obtained from:	OpenSSL Project
Security:	CVE-2022-0778
2022-03-15 09:48:59 -07:00
Mateusz Piotrowski
7d62b5df83 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
2022-03-15 17:21:51 +01:00
Alfredo Dal'Ava Junior
aa37fbc200 powerpcspe: add virtio in-kernel support
Adding it in order to make easier using powerpcspe images under qemu

Reviewed by:	jhibbits
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D34554
2022-03-15 09:34:22 -03:00
Mateusz Piotrowski
5ffaf7957f tools/tools/README: Remove tinybsd entry
Fixes:	0c7a642ae8 tinybsd: Remove
2022-03-15 13:06:53 +01:00
Mateusz Guzik
b3b50e64d7 zfs: add missing replay check to an assert in zfs_xvattr_set 2022-03-15 11:38:58 +00:00
Andrew Turner
f2e36d47e3 Make page size dynamic in libkvm for arm64
To allow for a future 16k or 64k page size we need to tell libkvm which
is being used. Add a flag field in unused space in minidumphdr and use
it to signal between the different options.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34548
2022-03-15 09:52:15 +00:00
Andrew Turner
5e2f304cb4 Fix calculating l0index in _pmap_alloc_l3 on arm64
When moving from the l1 index to l0 index we need to use the l1 shift
value not the l0 shift value. With 4k pages they are identical, however
with 16k pages we only have 2 l0 entries so the shift value is incorrect.

Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34517
2022-03-15 09:51:41 +00:00
Peter Holm
0977ebb071 stress2: A unmount of a unionfs file system may return EBUSY. 2022-03-15 10:24:55 +01:00
Mateusz Piotrowski
11a6c85d7f 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
2022-03-15 09:54:38 +01:00
Peter Holm
9e8fbb95b3 stress2: A unmount of a unionfs file system may return EBUSY. 2022-03-15 09:35:22 +01:00
Tom Jones
81e0e7b9e3 bsnmp: Use mkstemp when creating clients local socket
Reviewed by:	harti, rew
Sponsored by:   NetApp, Inc.
Sponsored by:   Klara, Inc.
X-NetApp-PR:    #72
Differential Revision:	https://reviews.freebsd.org/D34550
2022-03-15 08:20:13 +00:00
Wei Hu
80c3eb7bc6 Hyper-V: hn: add switch to turn on and off RSC
Currently RSC offloading is enabled by default.
With this new change rsc will be disabled by default.
By using sysctl we can enable and disable it.

Reviewed by:	whu
Signed-off-by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Fixes:		a491581f3f Enable vSwitch RSC support in hn netvsc driver
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D34507
2022-03-15 08:12:22 +00:00
Kristof Provost
734782a781 pf tests: Test new L3 inspection for pf 'ether' rules
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34483
2022-03-14 22:43:38 +01:00
Kristof Provost
8a42005d1e pf: support basic L3 filtering in the Ethernet rules
Allow filtering based on the source or destination IP/IPv6 address in
the Ethernet layer rules.

Reviewed by:	pauamma_gundo.com (man), debdrup (man)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34482
2022-03-14 22:42:37 +01:00
John Baldwin
2814ba8ef1 Move NO_WUNUSED_BUT_SET_VARIABLE clang helper to the right place.
Reviewed by:	imp, dim, emaste
Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D34537
2022-03-14 14:05:25 -07:00
John Baldwin
18207579a2 module_test: Fix some assignments to errno intended to be tests.
Reported by:	vangyzen
Reviewed by:	vangyzen, markj
Sponsored by:	University of Cambridge, Google, Inc.
Differential Revision:	https://reviews.freebsd.org/D34528
2022-03-14 14:05:05 -07:00
Hans Petter Selasky
d5ad1713cc Chase mixer(8) command-line interface changes
Some more nits regarding mute feature.

Differential revision:	https://reviews.freebsd.org/D34545
Sponsored by:		NVIDIA Networking
2022-03-14 09:38:04 +01:00
Wojciech Macek
25bcd81b8d armv6/legacy: optimize cpu_getcount performance
Use nanotime instread of binuptime.
This change is for old and legacy platforms and does not impact any armv7 and later.
Might be MFCed to 13.0 once armv6 support is finally dropped in 14.0

Sponsored by:		Stormshield
Reviewed by:		mw
Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D33719
2022-03-14 07:51:21 +01:00
Xin LI
1d33307434 Update leap-seconds to leap-seconds.3676924800
Obtained from:	ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.3676924800
MFC after:	3 days
2022-03-13 23:37:56 -07:00
Rick Macklem
57014f21e7 nfscl: Fix NFSv4.1/4.2 Lookup+Open RPC
Use of the Lookup+Open RPC is currently disabled,
due to a problem detected during testing.  This
patch fixes this problem.  The problem was that
nfscl_postop_attr() does not parse the attributes
if nd_repstat != 0.  It also would parse the
return status for the operation, where the
Lookup+Open code had already parsed it.

The first change in the patch does not make any
semantics change, but makes the code identical
to what is done later in the function, so that
it is apparent that the semantics should be the
same in both places.

Lookup+Open remains disabled while further
testing is being done, so this patch has no
effect at this time.
2022-03-13 13:15:12 -07:00
Jose Luis Duran
19a6267d61 rc.d/*: Use startmsg instead of echo on start messages
By rc.conf(5), setting rc_startmsgs="NO" should silence start messages.

Fix a few rc scripts by using startmsg.

PR:		255207
Reported by:	Jose Luis Duran <jlduran@gmail.com>
Reviewed by:	imp, 0mp
Approved by:	imp (src)
Differential Revision:	https://reviews.freebsd.org/D34514
2022-03-13 18:57:31 +01:00
Jose Luis Duran
325ebf37d8 Introduce startmsg and use it in rc scripts
startmsg is a new rc.subr(8) function function to be used instead of
echo(1) when for boot messages. It replaces the often forgotten

    check_startmsgs && echo ...

with

    startmsg ...

No functional change intended.

I adjusted the commit message and did some final clean-ups of the patch
before committing.

PR:		255207
Reported by:	Jose Luis Duran <jlduran@gmail.com>
Reviewed by:	imp, 0mp
Approved by:	imp (src)
Differential Revision:	https://reviews.freebsd.org/D34514
2022-03-13 18:57:29 +01:00
Mateusz Piotrowski
e83a53abeb Chase mixer(8) command-line interface changes
FreeBSD 14.0 is going to ship with a new implementation of the mixer(8)
command. Unfortunately, in order to support new features like mute, the
command-line interface of the new implementation is not backwards
compatible.

Update all the remaining documentation and scripts in the src tree
to use the new syntax.

While here, document in usbhidaction.1 that the mute functionality is
now supported.

Reviewed by:	christos, debdrup, hselasky
Approved by:	hselasky (src)
Fixes:	903873ce15 Implement and use new mixer(3) library for FreeBSD.
Differential Revision:	https://reviews.freebsd.org/D34545
2022-03-13 17:43:49 +01:00
Mateusz Guzik
0134bbe56f vfs: prefix lookup and relookup with vfs_
Reviewed by:	imp, mckusick
Differential Revision:		https://reviews.freebsd.org/D34530
2022-03-13 14:44:39 +00:00
Mateusz Guzik
02fc4e319c cache: use flexible array member
... instead of 0-sizing the array
2022-03-13 14:43:35 +00:00
Hans Petter Selasky
16346e1401 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> .

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-13 15:18:17 +01:00
Mateusz Piotrowski
c36d04222d mixer .8: Clean up the manual page
- Use correct macros (e.g., Pa for paths, Ar for arguments, Cm for
  command modifiers).
- Pet igor and mandoc -Tlint (e.g., start sentences after a newline).
- Use Ta instead of a tab character in tables.
- Stylize all table headers with Sy consistency.
- Add a missing "vol" variant to the synopsis of "dev.volume".
- Sort dev.recsrc command modifiers consistency.
- Use "Bd -literal" for code blocks in the examples. "Bl -tag" is not
  the right macro for that.

Fixes:	903873ce15 Implement and use new mixer(3) library for FreeBSD.
2022-03-13 13:40:51 +01:00
Piotr Kubaj
3781e77995 riscv: actually enable sanitizers
1. Backport b475ce39e8.
2. Enable libclang_rt for riscv.

Previous commit missed it.

MFC after:	3 days
Reviewed by:	dim
Differential Revision: https://reviews.freebsd.org/D34543
2022-03-13 13:06:57 +01:00
Alfonso S. Siciliano
bce40c0242
Merge commit '2f8d4418415511460bd7b3b3e532f6b328cf993f' 2022-03-13 02:38:51 +01:00
Alfonso S. Siciliano
2f8d441841
bsddialog: Import version0.2
This version provides improvements and fixes mainly to use bsddialog
utility in bsdinstall/scripts. The lib API is not broken so the
previous converted utilities (tzsetup, distextract, etc.) are OK.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34458
2022-03-13 02:34:57 +01:00
Matteo Riondato
a33ead9c9c pfdenied: match actual variable name to the documented one
PR:		262446
Reviewed by:	kp
2022-03-12 23:59:25 +01:00
Alexander Motin
7f16b501e2 GEOM: Introduce partial confxml API
Traditionally the GEOM's primary channel of information from kernel to
user-space was confxml, fetched by libgeom through kern.geom.confxml
sysctl.  It is convenient and informative, representing full state of
GEOM in a single XML document.  But problems start to arise on systems
with hundreds of disks, where the full confxml size reaches many
megabytes, taking significant time to first write it and then parse.

This patch introduces alternative solution, allowing to fetch much
smaller XML document, subset of the full confxml, limited to 64KB and
representing only one specified geom and optionally its parents.  It
uses existing GEOM control interface, extended with new "getxml" verb.
In case of any error, such as the buffer overflow, it just transparently
falls back to traditional full confxml.  This patch uses the new API in
user-space GEOM tools where it is possible.

Reviewed by:	imp
MFC after:	2 month
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D34529
2022-03-12 11:55:52 -05:00
Steve Wills
db11c57a6c usr.bin/who.c: Fix boot time checking
The boot time entry doesn't have a tty specified, so don't check it.
While here, make ttystat handle that case.

Approved by:	kevans (src)
Differential Revision:	https://reviews.freebsd.org/D34524
2022-03-12 11:49:49 -05:00
Mateusz Guzik
5fc3cc2713 amd64: make bcmp in libc just call memcmp
Preferably bcmp would just alias memcmp but there is build magic which
makes this problematic.

Reviewed by:	jhb
Differential Revision:		https://reviews.freebsd.org/D28846
2022-03-12 14:59:14 +00:00