Commit Graph

256361 Commits

Author SHA1 Message Date
Jung-uk Kim
bb8acd558e OpenSSL: Regenerate manual pages.
MFC after:	1 week
2021-01-28 10:24:24 -08:00
John Baldwin
aa906e2a49 OpenSSL: Support for kernel TLS offload (KTLS)
This merges upstream patches from OpenSSL's master branch to add
KTLS infrastructure for TLS 1.0-1.3 including both RX and TX
offload and SSL_sendfile support on both Linux and FreeBSD.

Note that TLS 1.3 only supports TX offload.

A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with
KTLS support.  It defaults to enabled on amd64 and disabled on all
other architectures.

Reviewed by:	jkim (earlier version)
Approved by:	secteam
Obtained from:	OpenSSL (patches from master)
MFC after:	1 week
Relnotes:	yes
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28273
2021-01-28 10:24:13 -08:00
Alex Richardson
9a0a48b12d usr.sbin/pkg: Don't re-define roundup2
The file already includes sys/param.h and should use that definition.
I found this while testing D28332.

Reviewed By:	bapt
Differential Revision: https://reviews.freebsd.org/D28331
2021-01-28 17:25:53 +00:00
Alex Richardson
869cc06480 tests/sys/audit: fix timeout calculation
This changes the behaviour to a 30s total timeout (needed when running
on slow emulated uniprocessor systems) and timing out after 10s without
any input. This also uses timespecsub() instead of ignoring the
nanoseconds field.

After this change the tests runs more reliably on QEMU and time out less
frequently.

Reviewed By:	asomers
Differential Revision: https://reviews.freebsd.org/D28391
2021-01-28 17:24:24 +00:00
Alex Richardson
83ff5d5d98 Un-XFAIL two tests with Clang > 10
SVN r343917 fixed this for in-tree clang, but when building with a newer
out-of-tree clang the test was still marked as XFAIL.

Reviewed By:	dim
Differential Revision: https://reviews.freebsd.org/D28390
2021-01-28 17:24:24 +00:00
Alex Richardson
bcc5b24456 rc.d/auditd: set pidfile
auditd creates a pidfile so we should use it for status checks.
This also seems to speed up the frequent onestatus checks used in
tests/sys/audit.

Reviewed By:	asomers
Differential Revision: https://reviews.freebsd.org/D28389
2021-01-28 17:24:24 +00:00
Randall Stewart
1a714ff204 This pulls over all the changes that are in the netflix
tree that fix the ratelimit code. There were several bugs
in tcp_ratelimit itself and we needed further work to support
the multiple tag format coming for the joint TLS and Ratelimit dances.

    Sponsored by: Netflix Inc.
    Differential Revision:  https://reviews.freebsd.org/D28357
2021-01-28 11:53:05 -05:00
Kristof Provost
cd579b6fba pf tests: Test that dup-to doesn't produce extra duplicate packets 2021-01-28 16:46:44 +01:00
Yannis Planus
0c458752ce pf: duplicate frames only once when using dup-to pf rule
When using DUP-TO rule, frames are duplicated 3 times on both output
interfaces and duplication interface. Add a flag to not duplicate a
duplicated frame.

Inspired by a patch from Miłosz Kaniewski milosz.kaniewski at gmail.com
https://lists.freebsd.org/pipermail/freebsd-pf/2015-November/007886.html

Reviewed by:		kp@
Differential Revision:	https://reviews.freebsd.org/D27018
2021-01-28 16:46:44 +01:00
Bjoern A. Zeeb
d386f3a3c3 Bump __FreeBSD_version for multiple LinuxKPI updates conflicting
with DRM.  Be sure to update your drm-kmod port to after the update.
2021-01-28 16:37:28 +00:00
Bjoern A. Zeeb
fa765ca73e LinuxKPI: implement devres() framework parts and two examples
This code implements a version of the devres framework found
working for various iwlwifi use cases and also providing functions
for ttm_page_alloc_dma.c from DRM.

Part of the framework replicates the consumed KPI, while others
are internal helper functions.

In addition the simple devm_k*malloc() consumers were implemented
and kvasprintf() was enhanced to also work for the devm_kasprintf()
case.
Addmittingly lkpi_devm_kmalloc_release() could be avoided but for
the overall understanding of the code and possible memory tracing
it may still be helpful.

Further devsres consumer are implemented for iwlwifi but will follow
later as the main reason for this change is to sort out overlap with
DRM.

Sponsored-by:	The FreeBSD Foundation
Obtained-from:	bz_iwlwifi
MFC After:	3 days
Reviewed-by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D28189
2021-01-28 16:32:43 +00:00
Bjoern A. Zeeb
1fac2cb4d6 LinuxKPI: enhance PCI bits for DRM
In pci_domain_nr() directly return the domain which got set in
lkpifill_pci_dev() in all cases.  This was missed between D27550
and 105a37cac7 .

In order to implement pci_dev_put() harmonize further code
(which was started in the aforementioned commit) and add kobj
related bits (through the now common lkpifill_pci_dev() code)
to the DRM specific calls without adding the DRM allocated
pci devices to the pci_devices list.
Add a release for the lkpinew_pci_dev() (DRM) case so freeing
will work.
This allows the DRM created devices to use the normal kobj/refcount
logic and work with, e.g., pci_dev_put().
(For a slightly more detailed code walk see the review).

Sponsored-by:	The FreeBSD Foundation
Obtained-from:	bz_iwlwifi (partially)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D28188
2021-01-28 16:23:19 +00:00
Bjoern A. Zeeb
4abbf816bf LinuxKPI: upstream a collection of drm-kmod conflicting changes
The upcoming in-kernel implementations for LinuxKPI based on work on
iwlwifi (and other wireless drivers) conflicts in a few places with
the drm-kmod graphics work outside the base system.

In order to transition smoothly extract the conflicting bits.
This included "unaligned" accessor functions, sg_pcopy_from_buffer(),
IS_*() macros (to be further restricted in the future), power management
bits (possibly no longer conflicting with DRM), and other minor changes.

Obtained-from:  bz_iwlwifi
Sponsored-by:   The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	kib, hselasky, manu, bdragon (looked at earlier versions)
Differential Revision: https://reviews.freebsd.org/D26598
2021-01-28 16:15:12 +00:00
Bjoern A. Zeeb
a6c2507d1b LinuxKPI: add firmware loading support
Implement linux firmware KPI compat code.
This includes: request_firmware() request_firmware_nowait(),
request_firmware_direct(), firmware_request_nowarn(),
and release_firmware().

Given we will try to map requested names from natively ported
or full-linuxkpi-using drivers to a firmware(9) auto-loading
name format (.ko file name and image name matching),
we quieten firmware(9) and print success or failure (unless
the _nowarn() version was called) in the linuxkpi implementation.
At the moment we try up-to 4 different naming combinations,
with path stripped, original name, and requested name with '/'
or '.' replaced.

We do not currently defer loading in the "nowait" case.

Sponsored-by:	The FreeBSD Foundation
Sponsored-by:	Rubicon Communications, LLC ("Netgate")
		(firmware(9) nowarn update from D27413)
MFC after:	3 days
Reviewed by:	kib, manu (looked at older versions)
Differential Revision:	https://reviews.freebsd.org/D27414
2021-01-28 16:05:32 +00:00
Hans Petter Selasky
b8051298b0 Fix missing value in uar_page field for ratelimit in mlx5en(4).
This is a regression issue after the new UAR API was introduced
by f8f5b459d2 .

MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-01-28 14:51:58 +01:00
Andrew Turner
4e76e4c301 Remove obsolete code gated on _ARM_ARCH_*
This is all code only run on ARMv4 and ARMv5. Support for these have
been dropped from FreeBSD.

Differential Revision:	https://reviews.freebsd.org/D28314
2021-01-28 10:41:45 +00:00
Andrew Turner
4d2ff2330f Remove the old ARMv4 memcpy
This was only used when building for ARMv4 or some ARMv5 or when
_STANDALONE is defined. As ARMv4 and ARMv5 support has been removed,
and we only define _STANDALONE in the bootloader where we don't use
this version of memcpy we can remove it.

Differential Revision:	https://reviews.freebsd.org/D28313
2021-01-28 10:39:38 +00:00
Andrew Turner
e09c8c9ad9 Remove leftover big-endian arm support
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D28312
2021-01-28 10:33:40 +00:00
Baptiste Daroussin
f59810e34b pci_vendors: update to 2021.01.11 2021-01-28 09:20:09 +01:00
Toomas Soome
9b388ac303 loader: unload command should reset tg_kernel_supported in gfx_state
While loading kernel, we check if vt/vbe backend support is included in
kernel and set the tg_kernel_supported flag in gfx_state. unload
command needs to reset this flag to allow next load to perform
this check with new kernel.

Reported by: jhb
2021-01-28 09:52:20 +02:00
Cy Schubert
0e01ea872e Fix a typo.
MFC after:	3 days
2021-01-27 21:52:41 -08:00
Mitchell Horne
7b08a307e8 bsdinstall: riscv-specific tweaks
Make the installer more useful, by allowing it to create a bootable
installation. Also, enable the menu option for ZFS-on-root.

Like arm64, RISC-V boots by UEFI only, so arm64's partedit
implementation is renamed and shared among the two platforms.

Reviewed by:	gjb
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D28180
2021-01-27 19:29:42 -04:00
Mitchell Horne
676b7d077c bsdinstall: create /efi/boot directory in ESP
If the installer is creating a new ESP, then this directory will not
exist and the subsequent cp will fail silently. This is usually of no
consequence if /efi/freebsd/loader.efi is set up correctly.

Reviewed by:	imp
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D28176
2021-01-27 19:27:51 -04:00
Danjel Qyteza
9bae4ce661 riscv: add SBI system reset extension
The System Reset extension provides functions to shutdown or reboot the
system via SBI firmware. This newly defined extension supersedes the
functionality of the legacy shutdown extension.

Update the SBI code to use the new System Reset extension when
available, and fall back to the legacy one.

Reviewed By:	kp, jhb
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D28226
2021-01-27 19:19:54 -04:00
Mitchell Horne
a6405133b7 riscv: style(9) nits in sbi.c
Wrap a few lines at 80 columns, which were overlooked in recent commits.
2021-01-27 19:17:26 -04:00
Emmanuel Vadot
183d6cc0e0 release: ROCKPRO64: Remove the quirk that disable the big cores
It's not needed anymore.
2021-01-27 23:31:18 +01:00
Dimitry Andric
6e26189be4 Fix loader detection of vbefb support on !amd64
On i386, after 6c7a932d0b, the vbefb vt
driver was no longer detected by the loader, if any kernel module was
loaded after the kernel itself.

This was caused by the parse_vt_drv_set() function being called multiple
times, resetting the detection flag. (It was called multiple times,
becuase i386 .ko files are shared objects like the kernel proper, while
this is not the case on amd64.)

Fix this by skipping the set_vt_drv_set lookup if vbefb was already
detected.

Reviewed by:	tsoome
2021-01-27 22:28:43 +01:00
Mark Johnston
2fccd4f9b6 safexcel: Disallow unsupported buffer layouts
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-01-27 15:31:10 -05:00
Mark Johnston
e1b50e8184 qat.4: Minor tweaks
- Document a constraint on the AAD size for AES-GCM.
- Note that the list of supported platforms and add-on devices is not
  complete and indicate that QAT devices will show up in pciconf
  output. [1]

PR:		252984 [1]
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-01-27 15:31:10 -05:00
Mark Johnston
bd674d8b1f qat: Add support for separate AAD and output buffers
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-01-27 15:30:58 -05:00
Lutz Donnerhacke
d0d2e523ba netgraph/ng_car: Add color marking code
Chained policing should be able to reuse the classification of
traffic.  A new mbuf_tag type is defined to handle gereral QoS
marking.  A new subtype is defined to track the color marking.

Reviewed by:	manpages (bcr), melifaro, kp
Approved by:	kp (mentor)
Sponsored by:	IKS Service GmbH
MFC after:	1 month
Differential Revision: https://reviews.freebsd.org/D22110
2021-01-27 21:22:51 +01:00
Ryan Moeller
65efb73fbd sbin/sysctl: Fix CTLFLAG_SKIP for adjacent nodes
The OID is saved when we encounter CTLFLAG_SKIP so that descendants can
be skipped as well. We then must not update the skip OID until we are
out of the node. This was achieved by resetting the skip OID once the
prefix no longer matches, but the case where the OID we reset on has
CTLFLAG_SKIP was not accounted for.

Reported by:	mav
Reviewed by:	mav
MFC after:	2 days
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D28364
2021-01-27 14:27:46 -05:00
Jessica Clarke
48397f6c7d libllvmminimal: Add missing Support/ABIBreak.cpp
When building natively on RISC-V, linking the bootstrap clang-tblgen
fails with:

  ld: error: undefined symbol: llvm::EnableABIBreakingChecks
  >>> referenced by PrettyStackTrace.cpp
  >>>               PrettyStackTrace.o:(.sdata+0x0) in archive
  /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a
  >>> referenced by Signals.cpp
  >>>               Signals.o:(.sdata+0x8) in archive
  /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a
  >>> referenced by Timer.cpp
  >>>               Timer.o:(.sdata+0x28) in archive
  /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a

This is likely due to Error.h's inclusion of abi-breaking.h. It's
unclear why this only affects RISC-V, but perhaps relates to its more
eager use of .sdata due to the ABI's support for linker relaxations.
Regardless, this is theoretically an issue for all architectures.

Reported by:	Dennis Clarke <dclarke@blastwave.org>
Reviewed by:	dim
Tested by:	mhorne
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D28367
2021-01-27 19:19:00 +00:00
Andrew Turner
dd6c1c2a6c Remove redundantcy from the arm GIC softc
A struct recource already contains the bus_space_tag_t and
bus_space_handle_t. There is no neec to read them and store them again
in the drivers softc. Remove them and use the struct resource directly
with bus_read_* and bus_write_*.

Reviewed by:	mmel
Differential Revision:	https://reviews.freebsd.org/D28339
2021-01-27 19:03:39 +00:00
Kyle Evans
7012461c9b stand: ensure that the efi directory's dependencies are correct
efi, like the various ${MACHINE} directories, should have a dependency on
the enabled interpreters.

The general rule here is that any top-level directory that has a program at
any depth within that includes loader.mk should add ${INTERP_DEPENDS} added
to its dependencies so that the appropriate ficl/lua bits are ready before
they begin.

Note that the only directories in-tree that require it but will not get it
in a more appropriate manner are i386 (on amd64), efi, and userboot. i386
and userboot are handled explicitly in Makefile.amd64 where they are added
to S.yes.

Reported-by:	bcran
MFC-after:	3 days
2021-01-27 13:02:51 -06:00
Randall Stewart
24a8f6d369 When we are about to send down to the driver layer
we need to make sure that the m_nextpkt field is NULL
else the lower layers may do unwanted things.

Reviewed By:  gallatin, melifaro
Differential Revision: https://reviews.freebsd.org/D28377
2021-01-27 13:52:44 -05:00
Alex Richardson
4f009328a2 kerberos5: Silence compiler warnings
Building the kerberos5 subdirectory currently produces lots of warnings.
Since there are many instances of these warnings and it's contrib code,
this change silences the warnings instead of fixing them.

Reviewed By:	jhb, cy, bjk
Differential Revision: https://reviews.freebsd.org/D28025
2021-01-27 17:48:47 +00:00
Gordon Bergling
8a2f9dff2b VOP_BMAP(9): Remove obsolete comma 2021-01-27 18:20:04 +01:00
Gordon Bergling
8dba3dd846 cnv(9): Use a proper manual page section 2021-01-27 18:18:17 +01:00
Kristof Provost
35dabb7b9c altq: Fix typo in features sysctl description
Reported by:	Jose Luis Duran
2021-01-27 16:42:14 +01:00
Kristof Provost
7a808c5ee3 pf: Improve pf_rule input validation
Move the validation checks to pf_rule_to_krule() to reduce duplication.
This also makes the checks consistent across different ioctls.

Reported-by:	syzbot+e9632d7ad17398f0bd8f@syzkaller.appspotmail.com
Reviewed by:	tuexen@, donner@
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28362
2021-01-27 16:42:14 +01:00
Mateusz Guzik
5c325977b1 cache: add missing MNT_NOSYMFOLLOW check to symlink traversal 2021-01-27 15:08:38 +00:00
Mateusz Guzik
5fc384d181 cache: fallback when encountering a mount point during .. lookup
The current abort is overzealous.
2021-01-27 16:00:31 +01:00
Marius Strobl
c262e8e87e e1000: fix build after c1655b0f 2021-01-27 15:30:35 +01:00
Bjoern A. Zeeb
6f65b50546 firmware(9): extend firmware_get() by a "no warn" flag.
With the upcoming usage from LinuxKPI but also from drivers
ported natively we are seeing more probing of various
firmware (names).

Add the ability to firmware(9) to silence the
"firmware image loading/registering errors" by adding a new
firmware_get_flags() functions extending firmware_get() and
taking a flags argument as firmware_put() already does.

Requested-by:	zeising (for future LinuxKPI/DRM)
Sponsored-by:	The FreeBSD Foundation
Sponsored-by:	Rubicon Communications, LLC ("Netgate")
MFC after:	3 days
Reviewed-by:	markj
Differential Revision:	https://reviews.freebsd.org/D27413
2021-01-27 13:51:26 +00:00
Mateusz Guzik
bcb7f57aa2 conf/kern.mk: save some work by using realpath instead of cd ; pwd
I did not check if the entire ordeal can be avoided in the first place.
2021-01-27 12:41:33 +00:00
Baptiste Daroussin
7a57c9cb5a diff: eleminitate useless macros
The diff_output was not bringing any values but was obfuscating
the code.
2021-01-27 12:29:33 +01:00
Baptiste Daroussin
e43239f514 diff: simplify the hash functions
Instead of 3 different complex case they have all been folded into a
simple on based on switch
2021-01-27 12:28:26 +01:00
Baptiste Daroussin
e52546a3a7 diff: fix typo in a comment 2021-01-27 12:18:46 +01:00
Baptiste Daroussin
931ad51808 diff: remove stalled entries in headers 2021-01-27 12:18:45 +01:00