]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agokern_procctl.c: use td->td_proc instead of curproc
Konstantin Belousov [Mon, 18 Oct 2021 21:07:25 +0000 (00:07 +0300)]
kern_procctl.c: use td->td_proc instead of curproc

(cherry picked from commit 3692877a6cf8fc374349f3d9b2cbb190fec484a0)

2 years agoprocctl: actually require debug privileges over target
Konstantin Belousov [Fri, 15 Oct 2021 20:09:39 +0000 (23:09 +0300)]
procctl: actually require debug privileges over target

(cherry picked from commit f5bb6e5a6d488740e451ad4acd82a70b95e786cd)

2 years agoprocctl: make it possible to specify that some operations require debug privilege...
Konstantin Belousov [Fri, 15 Oct 2021 20:02:06 +0000 (23:02 +0300)]
procctl: make it possible to specify that some operations require debug privilege over the target

(cherry picked from commit 1c4dbee5dd224c08241c0922ff577bb226171e81)

2 years agosys_procctl(): zero the data buffer once, on syscall entry
Konstantin Belousov [Sat, 16 Oct 2021 18:28:03 +0000 (21:28 +0300)]
sys_procctl(): zero the data buffer once, on syscall entry

(cherry picked from commit 32026f5983ed00e64829f8c20b09748077809729)

2 years agosys_procctl(): use table data to do copyin/copyout
Konstantin Belousov [Fri, 15 Oct 2021 19:56:12 +0000 (22:56 +0300)]
sys_procctl(): use table data to do copyin/copyout

(cherry picked from commit 56d5323b4d7d9ccbe1ca3e620400afd165519a12)

2 years agokern_procctl_single(): convert to use table data
Konstantin Belousov [Fri, 15 Oct 2021 19:22:18 +0000 (22:22 +0300)]
kern_procctl_single(): convert to use table data

(cherry picked from commit 68dc5b381a29aaa418064324519105a8c2a4a080)

2 years agoprocctl: convert PDEATHSIG_CTL/STATUS to regular kern_procctl_single() cases
Konstantin Belousov [Fri, 15 Oct 2021 19:06:22 +0000 (22:06 +0300)]
procctl: convert PDEATHSIG_CTL/STATUS to regular kern_procctl_single() cases

(cherry picked from commit 34f39a8c0e2a4100837eb406ae24a7d6a357d696)

2 years agoprocctl(2): add consistent shortcut P_ID:0 as curproc
Konstantin Belousov [Fri, 15 Oct 2021 19:01:42 +0000 (22:01 +0300)]
procctl(2): add consistent shortcut P_ID:0 as curproc

(cherry picked from commit f833ab9dd187328306fa1601330fbc8332392abe)

2 years agokern_procctl(): convert the function to be table-driven
Konstantin Belousov [Fri, 15 Oct 2021 18:57:17 +0000 (21:57 +0300)]
kern_procctl(): convert the function to be table-driven

(cherry picked from commit 7ae879b14a2086df521c59c4a379d3a072e08bc6)

2 years agosys_procctl(2): remove sysproto and argused
Konstantin Belousov [Fri, 15 Oct 2021 18:55:53 +0000 (21:55 +0300)]
sys_procctl(2): remove sysproto and argused

(cherry picked from commit 31faa565edea908a8caf71cc6783066c02fd6844)

2 years agonfsd: Disable the NFSv4.2 Allocate operation by default
Rick Macklem [Mon, 11 Oct 2021 01:46:02 +0000 (18:46 -0700)]
nfsd: Disable the NFSv4.2 Allocate operation by default

Some exported file systems, such as ZFS ones, cannot do VOP_ALLOCATE().
Since an NFSv4.2 server must either support the Allocate operation for
all file systems or not support it at all, define a sysctl called
vfs.nfsd.enable_v42allocate to enable the Allocate operation.
This sysctl is false by default and can only be set true if all
exported file systems (or all DSs for a pNFS server) can perform
VOP_ALLOCATE().

Unfortunately, there is no way to know if a ZFS file system will
be exported once the nfsd is operational, even if there are none
exported when the nfsd is started up, so enabling Allocate must
be done manually for a server configuration.

This problem was detected during a recent NFSv4 interoperability
testing event held by the IETF working group.

(cherry picked from commit dfe887b7d2265a5c6e0132cc03e006eb68223177)

2 years agonfscl: Fix NFS VOP_ALLOCATE for mounts without Allocate support
Rick Macklem [Sun, 10 Oct 2021 21:27:52 +0000 (14:27 -0700)]
nfscl: Fix NFS VOP_ALLOCATE for mounts without Allocate support

Without this patch, nfs_allocate() fell back on using vop_stdallocate()
for NFS mounts without Allocate operation support.  This was incorrect,
since some file systems, such as ZFS, cannot do allocate via
vop_stdallocate(), which uses writes to try and allocate blocks.

Also, fix nfs_allocate() to return EINVAL when mounts cannot do Allocate,
since that is the correct error for posix_fallocate(2).
Note that Allocate is only supported by some NFSv4.2 servers.

(cherry picked from commit 235891a1273d99b86784f935d2d6c554ce189559)

2 years agocamcontrol(8): Clean up references to removed symbols
Felix Johnson [Wed, 20 Oct 2021 04:32:54 +0000 (00:32 -0400)]
camcontrol(8): Clean up references to removed symbols

Patch the manpage to remove references to devq_openings and devq_queued.
Document the allocated tag that has been added in the same commit. The
relevant code change was committed as r271588
(959ec2581b23aefebb3bae26c527c1b25834a9e3) by mav@.

PR: 223651
Reported by: Bertrand Petit <bsdpr@phoe.frmug.org>

(cherry picked from commit d4cf7dc0df289ad0e16b5b40b076311c71e663dc)

2 years agoTeach the readelf about arm64 gnu properties
Andrew Turner [Fri, 17 Sep 2021 15:54:31 +0000 (15:54 +0000)]
Teach the readelf about arm64 gnu properties

On arm64 binaries can be tagged as using BTI or PAC. Add support to
decode these to the elftoolchain readelf.

To simplify the code use a table based method to find the flag
description table.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32315

(cherry picked from commit aacbf3fb8482226fcdf6a19af1011f9d65c20f2a)

2 years agoOnly demote when needed in the arm64 pmap_change_props_locked
Andrew Turner [Wed, 6 Oct 2021 16:38:22 +0000 (17:38 +0100)]
Only demote when needed in the arm64 pmap_change_props_locked

When changing page table properties there is no need to demote a
level 1 or level 2 block if we are changing the entire memory range the
block is mapping. In this case just change the block directly.

Reported by: alc, kib, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32339

(cherry picked from commit 806a88e742002b0e82a4ea06f8e147f627947c2c)

2 years agoAdd pmap_change_prot on arm64
Andrew Turner [Mon, 20 Sep 2021 16:49:18 +0000 (16:49 +0000)]
Add pmap_change_prot on arm64

Support changing the protection of preloaded kernel modules by
implementing pmap_change_prot on arm64 and calling it from
preload_protect.

Reviewed by: alc (previous version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32026

(cherry picked from commit a85ce4ad7272ffa4b4649b0ed463341b743e815f)

2 years agoAlso print symbols when printing arm64 registers
Andrew Turner [Thu, 23 Sep 2021 10:32:16 +0000 (10:32 +0000)]
Also print symbols when printing arm64 registers

When printing arm64 registers because of an exception in the kernel
also print the symbol and offset. This can be used to track down why
the exception occured without needing external tools.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32077

(cherry picked from commit 7ec86b66099124a9c2c88613507a10979cb8b191)

2 years agoAdd the arm64 table attributes and use them
Andrew Turner [Thu, 23 Sep 2021 15:00:55 +0000 (15:00 +0000)]
Add the arm64 table attributes and use them

Add the table page table attributes on arm64 and use them to add
restrictions to the block and page entries below them. This ensures
we are unable to increase the permissions in these last level entries
without also changing them in the upper levels.

Use the attributes to ensure the kernel can't execute from userspace
memory and vice versa, userspace has no access to read or write kernel
memory, and that the DMAP region is non-executable.

Reviewed by: alc, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32081

(cherry picked from commit f6de51d3e0315891f6ea9d12340b98336df409b7)

2 years agowpa: Reconnect ndis_events build
Cy Schubert [Fri, 22 Oct 2021 21:12:39 +0000 (14:12 -0700)]
wpa: Reconnect ndis_events build

ndis_events build was disconnected by the MFC of
25ecdc7d52770caf1c9b44b5ec11f468f6b636f3.
Reconnect it.

This is a direct commit to stable/13.

Reported by: Scott Allendorf <scott-allendorf@uiowa.edu>
Fixes: 13f32ff71eeb7213bb9f34bdfa88c7ccecf451bc

2 years agosafexcel: Set the context record unconditionally
Mark Johnston [Mon, 18 Oct 2021 13:40:47 +0000 (09:40 -0400)]
safexcel: Set the context record unconditionally

The condition added in commit 5bdb8b273aaf excludes plain SHA
transforms, so for such sessions crypto operations would return
incorrect results.

Fixes: 5bdb8b273aaf ("safexcel: Maintain per-session context records")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 36e4dcf47d45bbb87875ee4a9f5cc26a72a9f048)

2 years agoamd64: Zero the PML5 PTI page when initializing a pmap
Mark Johnston [Mon, 18 Oct 2021 13:29:20 +0000 (09:29 -0400)]
amd64: Zero the PML5 PTI page when initializing a pmap

The root page is not zeroed at allocation time since with 4-level tables
each entry is copied from a template.  However, with 5-level tables only
a single entry is filled, so the rest need to be cleared.

Reported by: alc
Reviewed by: alc, kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b0423d0f5eec89bd6c11c32649603031e3dbbfe1)

2 years agox86: Remove some leftover APM support
Mark Johnston [Sat, 16 Oct 2021 13:46:43 +0000 (09:46 -0400)]
x86: Remove some leftover APM support

This is obsolete since commit 8c576a279ed5 ("Remove APM BIOS support").

Reviewed by: imp, kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 06ebadc5f555fd7fa6f869af1e5daf834b1bb04e)

2 years agocontrib/tzdata: correct DST in Palestine
Philip Paeps [Mon, 25 Oct 2021 01:09:01 +0000 (01:09 +0000)]
contrib/tzdata: correct DST in Palestine

Direct commit to stable/13.

Merge the corrected DST transition date from tzdata 2021e.  This
corrects future timestamps in Palestine.

2 years agolorder: process read-only data symbols
Ed Maste [Mon, 18 Oct 2021 21:19:53 +0000 (17:19 -0400)]
lorder: process read-only data symbols

Previously they were skipped.  lorder(1) serves no functional purpose
today but we might as well address this longstanding bug while it is
still in the tree.

PR: 133860
MFC after: 1 week
Submitted by: John Hein

(cherry picked from commit e1d6d6f9249d37c10a0df68024c7dacebdc7bf98)

2 years agoBump __FreeBSD_version for LinuxKPI changes
Jessica Clarke [Sun, 17 Oct 2021 14:35:48 +0000 (15:35 +0100)]
Bump __FreeBSD_version for LinuxKPI changes

(cherry picked from commit 0d6516b453469ce1d92ec903c4c4df9ee08be0f9)

2 years agoLinuxKPI: Support lazy BAR allocation
Jessica Clarke [Sun, 17 Oct 2021 14:32:35 +0000 (15:32 +0100)]
LinuxKPI: Support lazy BAR allocation

Linux KPIs like pci_resource_start/len assume that BARs have been
allocated, but FreeBSD lazily allocates BARs if it cannot allocate the
firmware-allocated BARs. Thus using the Linux KPIs must force allocation
of the BARs rather than returning 0 for the start and length, which can
crash drm-kmod drivers that assume the BARs are valid. This is needed
for the AMDGPU driver to be able to attach on SiFive's HiFive Unmatched.

Reviewed by: hselasky, jhb, mav
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D32447

(cherry picked from commit 82098c8bb5b303c7c8b48e7537fadfe74b375bd3)

2 years agoLinuxKPI: Implement _ioremap_attr for riscv
Jessica Clarke [Sun, 17 Oct 2021 14:32:20 +0000 (15:32 +0100)]
LinuxKPI: Implement _ioremap_attr for riscv

Now that riscv implements pmap_mapdev_attr we can enable the non-stub
implementation for riscv, which is needed for drm-kmod to not fail at
run time for drivers that need to map I/O regions.

Reviewed by: hselasky, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D32446

(cherry picked from commit 60d962e0410340f107d062e8f4389c0d467613a2)

2 years agoriscv: Implement pmap_mapdev_attr
Jessica Clarke [Sun, 17 Oct 2021 14:31:35 +0000 (15:31 +0100)]
riscv: Implement pmap_mapdev_attr

This is needed for LinuxKPI's _ioremap_attr. This reuses the generic
implementation introduced for aarch64, and itself requires implementing
pmap_kenter, which is trivial to do given riscv currently treats all
mapping attributes the same due to the Svpbmt extension not yet being
ratified and in hardware.

Reviewed by: markj, mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D32445

(cherry picked from commit 682c00a6ce2f3870e9c698b283ee2b2a56c28c0b)

2 years agotimeout.1: Fix typos in examples
Mateusz Piotrowski [Thu, 21 Oct 2021 11:06:45 +0000 (13:06 +0200)]
timeout.1: Fix typos in examples

MFC after: 3 days

(cherry picked from commit 12615938c6e0bc3ca7604a8b0614ff23d9964370)

2 years agoAvoid lost buffers in fsck_ffs.
Kirk McKusick [Thu, 7 Oct 2021 22:51:56 +0000 (15:51 -0700)]
Avoid lost buffers in fsck_ffs.

Sponsored by: Netflix

(cherry picked from commit 4313e2ae44ba4e416a7ddaeaccf8ad311902f1c8)

2 years agocmp: initialize limit to avoid stack garbage limits
Kyle Evans [Thu, 21 Oct 2021 16:30:55 +0000 (11:30 -0500)]
cmp: initialize limit to avoid stack garbage limits

Pointy hat: kevans
Fixes: 4e380e847460 ("cmp: add -n, --bytes to limit number of bytes [...]")
Sponsored by: Klara, Inc.

(cherry picked from commit f1f7f31366e5830f4f5b96c6394a0b91475744f4)

2 years agoffs: retire unused fsckpid mount option
Robert Wing [Sat, 2 Oct 2021 23:11:40 +0000 (15:11 -0800)]
ffs: retire unused fsckpid mount option

The fsckpid mount option was introduced in 927a12ae16433b50 along with a
couple sysctl's to support SU+J with snapshots. However, those sysctl's
were never used and eventually removed in f2620e9ceb3ede02.

There are no in-tree consumers of this mount option.

Reviewed by: mckusick, kib
Differential Revision: https://reviews.freebsd.org/D32015

(cherry picked from commit 9acea16404117f2f54475640ff036c12130707d8)

2 years agortld-elf/paths.h: Make it usable outside rtld
Konstantin Belousov [Tue, 12 Oct 2021 15:50:49 +0000 (18:50 +0300)]
rtld-elf/paths.h: Make it usable outside rtld

(cherry picked from commit 33dba3bb0ec2a0f0a401bed145cc0ef95f37a5c3)

2 years agortld: Support DT_RELR relative relocation format
Fangrui Song [Sat, 16 Oct 2021 21:34:37 +0000 (14:34 -0700)]
rtld: Support DT_RELR relative relocation format

(cherry picked from commit a7d137fcbcac7182d4fcdc97a46b10edc5c7041d)

2 years agosys: Add definitions for RELR relative relocation format
Fangrui Song [Sat, 16 Oct 2021 21:31:42 +0000 (14:31 -0700)]
sys: Add definitions for RELR relative relocation format

(cherry picked from commit 1cf06333160a9a6a4dabeba19f6d67ab55f0dac2)

2 years agocrt_malloc: more accurate handling of mmap(2) failure
Konstantin Belousov [Fri, 15 Oct 2021 17:59:37 +0000 (20:59 +0300)]
crt_malloc: more accurate handling of mmap(2) failure

PR: 259076

(cherry picked from commit 73dddffc3175581ba99f6ced9a2e508a0e880e59)

2 years agocrt_malloc: Be more persistent when handling mmap() failure
Konstantin Belousov [Mon, 11 Oct 2021 16:13:31 +0000 (19:13 +0300)]
crt_malloc: Be more persistent when handling mmap() failure

PR: 259076

(cherry picked from commit 19e008e7f79ce55182d227be8513b3fa520471d8)

2 years agocrt_malloc: use uintptr_t instead of long for arithmetic on addresses
Konstantin Belousov [Tue, 12 Oct 2021 21:39:07 +0000 (00:39 +0300)]
crt_malloc: use uintptr_t instead of long for arithmetic on addresses

(cherry picked from commit 0b72d2965d68113bce16f6cccea77257283ef0a7)

2 years agoMark sppp(4) as gone in FreeBSD 14.
Gleb Smirnoff [Fri, 22 Oct 2021 18:27:00 +0000 (11:27 -0700)]
Mark sppp(4) as gone in FreeBSD 14.

2 years agopf tests: ensure that $nr expansion is correct
Kristof Provost [Sun, 3 Oct 2021 16:07:04 +0000 (18:07 +0200)]
pf tests: ensure that $nr expansion is correct

Test the $nr expansion in labels is correct, even if the optimiser
reduces the rule count.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D32489

(cherry picked from commit 914ec9c78dcd5d8f77552fb93d3bc15efe9c0f40)

2 years agopfctl: delay label macro expansion until after rule optimisation
Kristof Provost [Wed, 13 Oct 2021 14:06:47 +0000 (16:06 +0200)]
pfctl: delay label macro expansion until after rule optimisation

We used to expand the $nr macro in labels into the rule number prior to
the optimisation step. This would occasionally produce incorrect rule
numbers in the labels.

Delay all macro expansion until after the optimisation step to ensure
that we expand the correct values.

MFC after: 1 week
Reported by: Özkan KIRIK <ozkan.kirik@gmail.com>
Differential Revision: https://reviews.freebsd.org/D32488

(cherry picked from commit 09c7f2386973f8c36978895a7600320916bc3d07)

2 years agopf: do not copy anchor_wildcard / anchor_relative from userspace
Kristof Provost [Fri, 8 Oct 2021 13:13:21 +0000 (15:13 +0200)]
pf: do not copy anchor_wildcard / anchor_relative from userspace

We overwrite these fields again in pf_kanchor_setup() anyway.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 1c680e620bf7e53d043d10b23bdfc980e45e6455)

2 years agopf: remove unused field from pf_kanchor
Kristof Provost [Mon, 4 Oct 2021 08:58:27 +0000 (10:58 +0200)]
pf: remove unused field from pf_kanchor

The 'match' field is only used in the userspace version of the struct
(pf_anchor).

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 76c2e71c4c65a85279505005716aa43101c47bf7)

2 years agopfctl: Remove unused variable
Kristof Provost [Thu, 30 Sep 2021 15:25:45 +0000 (17:25 +0200)]
pfctl: Remove unused variable

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 90dedf0fef71d3e3081015525665bf335f9c7ee3)

2 years agodevd(8): Note default config file search locations
Felix Johnson [Tue, 19 Oct 2021 04:37:40 +0000 (00:37 -0400)]
devd(8): Note default config file search locations

PR: 197003
Reported by: Harald Schmalzbauer <bugzilla.freebsd@omnilan.de>

(cherry picked from commit bad324ace4f817206baf86ae7379c35c8199048e)

2 years agosched_ule(4): Fix possible significance loss.
Alexander Motin [Sat, 2 Oct 2021 03:47:18 +0000 (23:47 -0400)]
sched_ule(4): Fix possible significance loss.

Before this change kern.sched.interact sysctl setting above 32 gave
all interactive threads identical priority of PRI_MIN_INTERACT due to
((PRI_MAX_INTERACT - PRI_MIN_INTERACT + 1) / sched_interact) turning
zero.  Setting the sysctl lower reduced the range of used priority
levels up to half, that is not great either.

Change of the operations order should fix the issue, always using full
range of priorities, while overflow is impossible there since both
score and priority values are small.  While there, make the variables
unsigned as they really are.

MFC after: 1 month

(cherry picked from commit 1c119e173ddc7f5603a3b6cf940dc524e494a667)

2 years agosched_ule(4): Fix hang with steal_thresh < 2.
Alexander Motin [Sun, 26 Sep 2021 16:03:05 +0000 (12:03 -0400)]
sched_ule(4): Fix hang with steal_thresh < 2.

e745d729be60 caused infinite loop with interrupts disabled in load
stealing code if steal_thresh set below 2.  Such configuration should
not generally be used, but appeared some people are using it to
workaround some problems.

To fix the problem explicitly pass to sched_highest() minimum number
of transferrable threads, supported by the caller, instead of guessing.

MFC after: 25 days

(cherry picked from commit 08063e9f98a33980a09e3bd465926719b3437122)

2 years agox86: Add NUMA nodes into CPU topology.
Alexander Motin [Thu, 23 Sep 2021 17:41:02 +0000 (13:41 -0400)]
x86: Add NUMA nodes into CPU topology.

Depending on hardware, NUMA nodes may match last level caches, or
they may be above them (AMD Zen 2/3) or below (Intel Xeon w/ SNC).
This information is provided by ACPI instead of CPUID, and it is
provided for each CPU individually instead of mask widths, but
this code should be able to properly handle all the above cases.

This change should immediately allow idle stealing in sched_ule(4)
to prefer load from NUMA-local CPUs to remote ones when the node
does not match LLC.  Later we may think of how to better handle it
on sched_pickcpu() side.

MFC after: 1 month

(cherry picked from commit ef50d5fbc39fc39970eab1234222b5ac1d9ba74c)

2 years agoFix build without SMP.
Alexander Motin [Wed, 22 Sep 2021 02:13:33 +0000 (22:13 -0400)]
Fix build without SMP.

MFC after: 1 month

(cherry picked from commit 8db1669959ceebdc60a7d402830663953bf32818)

2 years agosched_ule(4): Improve long-term load balancer.
Alexander Motin [Tue, 21 Sep 2021 22:14:22 +0000 (18:14 -0400)]
sched_ule(4): Improve long-term load balancer.

Before this change long-term load balancer was unable to migrate
running threads, only ones waiting on run queues.  But with growing
number of CPU cores it is quite typical now for system to not have
many waiting threads.  But same time if due to some coincidence two
long-running CPU-bound threads ended up sharing same physical CPU
core, they could suffer from the SMT penalty indefinitely, and the
load balancer couldn't help.

Improve that by teaching the load balancer to hint running threads
to migrate by marking them with TDF_NEEDRESCHED and new TDF_PICKCPU
flag, making sched_pickcpu() to search for better CPU later, when
it is convenient.

Fix CPU search logic when balancing to limit round-robin migrations
in case of almost equal load to the group of physical cores.  The
previous code bounced threads across all the system, that should be
pretty bad for caches and NUMA affinity, while additional fairness
was almost invisible, diminishing with number of cores in the group.

MFC after: 1 month

(cherry picked from commit e745d729be60a47b49eb19c02a6864a747fb2744)

2 years agosbuf(9): Microoptimize sbuf_put_byte()
Alexander Motin [Tue, 5 Oct 2021 18:42:47 +0000 (14:42 -0400)]
sbuf(9): Microoptimize sbuf_put_byte()

This function is actively used by sbuf_vprintf(), so this simple
inlining in half reduces time of kern.geom.confxml generation.

MFC after: 2 weeks
Sponsored by: iXsystem, Inc.

(cherry picked from commit 7835b2cb4a1ae57f403739a2f1076ec7188f18c9)

2 years agoBump __FreeBSD_version for OCF changes to support variable nonce lengths.
John Baldwin [Wed, 6 Oct 2021 21:09:18 +0000 (14:09 -0700)]
Bump __FreeBSD_version for OCF changes to support variable nonce lengths.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit ac847dbf73685a5df9f70bbcdefa9fdeb559071d)

2 years agocrypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes.
John Baldwin [Wed, 6 Oct 2021 21:08:49 +0000 (14:08 -0700)]
crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes.

This is useful for WireGuard which uses a nonce of 8 bytes rather
than the 12 bytes used for IPsec and TLS.

Note that this also fixes a (should be) harmless bug in ossl(4) where
the counter was incorrectly treated as a 64-bit counter instead of a
32-bit counter in terms of wrapping when using a 12 byte nonce.
However, this required a single message (TLS record) longer than 64 *
(2^32 - 1) bytes (about 256 GB) to trigger.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32122

(cherry picked from commit 42dcd39528c6188a259951e28bbad309234324e4)

2 years agocrypto: Test all of the AES-CCM KAT vectors.
John Baldwin [Wed, 6 Oct 2021 21:08:48 +0000 (14:08 -0700)]
crypto: Test all of the AES-CCM KAT vectors.

Previously, only test vectors which used the default nonce and tag
sizes (12 and 16, respectively) were tested.  This now tests all of
the vectors.  This exposed some additional issues around requests with
an empty payload (which wasn't supported) and an empty AAD (which
falls back to CIOCCRYPT instead of CIOCCRYPTAEAD).

- Make use of the 'ivlen' and 'maclen' fields for CIOGSESSION2 to
  test AES-CCM vectors with non-default nonce and tag lengths.

- Permit requests with an empty payload.

- Permit an input MAC for requests without AAD.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32121

(cherry picked from commit 668770dc7de2ec8b5f5edf71e09b8a404120f6fa)

2 years agocryptosoft: Fix support for variable tag lengths in AES-CCM.
John Baldwin [Wed, 6 Oct 2021 21:08:48 +0000 (14:08 -0700)]
cryptosoft: Fix support for variable tag lengths in AES-CCM.

The tag length is included as one of the values in the flags byte of
block 0 passed to CBC_MAC, so merely copying the first N bytes is
insufficient.

To avoid adding more sideband data to the CBC MAC software context,
pull the generation of block 0, the AAD length, and AAD padding out of
cbc_mac.c and into cryptosoft.c.  This matches how GCM/GMAC are
handled where the length block is constructed in cryptosoft.c and
passed as an input to the Update callback.  As a result, the CBC MAC
Update() routine is now much simpler and simply performs the
XOR-and-encrypt step on each input block.

While here, avoid a copy to the staging block in the Update routine
when one or more full blocks are passed as input to the Update
callback.

Reviewed by: sef
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32120

(cherry picked from commit 4361c4eb6e3620e68d005c1671fdbf60b1fe83c6)

2 years agosafexcel: Support truncated tags for AES-CCM.
John Baldwin [Wed, 6 Oct 2021 21:08:48 +0000 (14:08 -0700)]
safexcel: Support truncated tags for AES-CCM.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32119

(cherry picked from commit 366ae4a000b1483390ddbf28e3dc420ebac894a0)

2 years agosafexcel: Support multiple nonce lengths for AES-CCM.
John Baldwin [Wed, 6 Oct 2021 21:08:48 +0000 (14:08 -0700)]
safexcel: Support multiple nonce lengths for AES-CCM.

Reviewed by: markj
Sponsored by: Chelsio Communications, The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32118

(cherry picked from commit 2ec2e4df094ba632e5e74268a8818f71903a4537)

2 years agoccr: Support AES-CCM requests with truncated tags.
John Baldwin [Wed, 6 Oct 2021 21:08:48 +0000 (14:08 -0700)]
ccr: Support AES-CCM requests with truncated tags.

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D32117

(cherry picked from commit e148e407df5c8b1c83bcd44da9f4837d94431d02)

2 years agoccr: Support multiple nonce lengths for AES-CCM.
John Baldwin [Wed, 6 Oct 2021 21:08:48 +0000 (14:08 -0700)]
ccr: Support multiple nonce lengths for AES-CCM.

Sponsored by: Chelsio Communications, The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32116

(cherry picked from commit 3e6a97b3a7bc80b1c12dd7b5208bfe99019c42b4)

2 years agoaesni: Support AES-CCM requests with a truncated tag.
John Baldwin [Wed, 6 Oct 2021 21:08:48 +0000 (14:08 -0700)]
aesni: Support AES-CCM requests with a truncated tag.

Reviewed by: sef
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32115

(cherry picked from commit 655eb762c31044a791e8c8c6355515e7c89c07ef)

2 years agoaesni: Permit AES-CCM requests with neither payload nor AAD.
John Baldwin [Wed, 6 Oct 2021 21:08:47 +0000 (14:08 -0700)]
aesni: Permit AES-CCM requests with neither payload nor AAD.

Reviewed by: sef
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32114

(cherry picked from commit c09c379c7aa7337680ff3cb73691ce12d627128b)

2 years agoaesni: Handle requests with an empty payload.
John Baldwin [Wed, 6 Oct 2021 21:08:47 +0000 (14:08 -0700)]
aesni: Handle requests with an empty payload.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32113

(cherry picked from commit d718c2d3c805001db0b0ae0cc0c8a811b8a90a95)

2 years agoaesni: Support multiple nonce lengths for AES-CCM.
John Baldwin [Wed, 6 Oct 2021 21:08:47 +0000 (14:08 -0700)]
aesni: Support multiple nonce lengths for AES-CCM.

Reviewed by: sef
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32112

(cherry picked from commit 8e6af6adfc2cc3d0ea89c20eaa5914e453c48b49)

2 years agocrypto: Support multiple nonce lengths for AES-CCM.
John Baldwin [Wed, 6 Oct 2021 21:08:47 +0000 (14:08 -0700)]
crypto: Support multiple nonce lengths for AES-CCM.

Permit nonces of lengths 7 through 13 in the OCF framework and the
cryptosoft driver.  A helper function (ccm_max_payload_length) can be
used in OCF drivers to reject CCM requests which are too large for the
specified nonce length.

Reviewed by: sef
Sponsored by: Chelsio Communications, The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32111

(cherry picked from commit ae18720d2792287c9ec658404f1a3173014d4979)

2 years agocryptocheck: Support multiple IV sizes for AES-CCM.
John Baldwin [Wed, 6 Oct 2021 21:08:47 +0000 (14:08 -0700)]
cryptocheck: Support multiple IV sizes for AES-CCM.

By default, the "normal" IV size (12) is used, but it can be overriden
via -I.  If -I is not specified and -z is specified, issue requests
for all possible IV sizes.

Reviewed by: markj
Sponsored by:  Chelsio Communications, The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32110

(cherry picked from commit bcb0fd6accc095295765b08b02f5f3b07ea62536)

2 years agocryptodev: Allow some CIOCCRYPT operations with an empty payload.
John Baldwin [Wed, 6 Oct 2021 21:08:47 +0000 (14:08 -0700)]
cryptodev: Allow some CIOCCRYPT operations with an empty payload.

If an operation would generate a MAC output (e.g. for digest operation
or for an AEAD or EtA operation), then an empty payload buffer is
valid.  Only reject requests with an empty buffer for "plain" cipher
sessions.

Some of the AES-CCM NIST KAT vectors use an empty payload.

While here, don't advance crp_payload_start for requests that use an
empty payload with an inline IV. (*)

Reported by: syzbot+d4b94fbd9a44b032f428@syzkaller.appspotmail.com (*)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32109

(cherry picked from commit a0cbcbb7917b0b8566ec0853425a73d7958ddbed)

2 years agocryptodev: Permit CIOCCRYPT for AEAD ciphers.
John Baldwin [Wed, 6 Oct 2021 21:08:47 +0000 (14:08 -0700)]
cryptodev: Permit CIOCCRYPT for AEAD ciphers.

A request without AAD for an AEAD cipher can be submitted via
CIOCCRYPT rather than CIOCCRYPTAEAD.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32108

(cherry picked from commit 70dbebea124236184a66a30175ba307793971f00)

2 years agocryptodev: Permit explicit IV/nonce and MAC/tag lengths.
John Baldwin [Wed, 6 Oct 2021 21:08:46 +0000 (14:08 -0700)]
cryptodev: Permit explicit IV/nonce and MAC/tag lengths.

Add 'ivlen' and 'maclen' fields to the structure used for CIOGSESSION2
to specify the explicit IV/nonce and MAC/tag lengths for crypto
sessions.  If these fields are zero, the default lengths are used.

This permits selecting an alternate nonce length for AEAD ciphers such
as AES-CCM which support multiple nonce leengths.  It also supports
truncated MACs as input to AEAD or ETA requests.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32107

(cherry picked from commit 16676123fc85233334983e0071cb446357abec8d)

2 years agocryptosoft, ccr: Use crp_iv directly for AES-CCM and AES-GCM.
John Baldwin [Wed, 6 Oct 2021 21:08:46 +0000 (14:08 -0700)]
cryptosoft, ccr: Use crp_iv directly for AES-CCM and AES-GCM.

Rather than copying crp_iv to a local array on the stack that is then
passed to xform reinit routines, pass crp_iv directly and remove the
local copy.

Reviewed by: markj
Sponsored by: Chelsio Communications, The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32106

(cherry picked from commit 5ae5ed5b8fd2955378ab67ba127cad8c981678ab)

2 years agocrypto: Permit variable-sized IVs for ciphers with a reinit hook.
John Baldwin [Wed, 6 Oct 2021 21:08:46 +0000 (14:08 -0700)]
crypto: Permit variable-sized IVs for ciphers with a reinit hook.

Add a 'len' argument to the reinit hook in 'struct enc_xform' to
permit support for AEAD ciphers such as AES-CCM and Chacha20-Poly1305
which support different nonce lengths.

Reviewed by: markj
Sponsored by: Chelsio Communications, The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32105

(cherry picked from commit 1833d6042c9a0116e8a1198256fd8fbc99cb11ad)
(cherry picked from commit d586c978b9b4216869e589daa5bbcc33225a0e35)

2 years agoossl: Use crypto_cursor_segment().
John Baldwin [Tue, 25 May 2021 23:59:19 +0000 (16:59 -0700)]
ossl: Use crypto_cursor_segment().

Reviewed by: markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30447

(cherry picked from commit 1c09320d5833fef8a4b6cc0091883fd47ea1eb1b)

2 years agocryptosoft: Use crypto_cursor_segment().
John Baldwin [Tue, 25 May 2021 23:59:19 +0000 (16:59 -0700)]
cryptosoft: Use crypto_cursor_segment().

Reviewed by: markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30446

(cherry picked from commit 86be314d09bc2857bb63d0a1e34945c63daa0008)

2 years agocrypto: Add crypto_cursor_segment() to fetch both base and length.
John Baldwin [Tue, 25 May 2021 23:59:19 +0000 (16:59 -0700)]
crypto: Add crypto_cursor_segment() to fetch both base and length.

This function combines crypto_cursor_segbase() and
crypto_cursor_seglen() into a single function.  This is mostly
beneficial in the unmapped mbuf case where back to back calls of these
two functions have to iterate over the sub-components of unmapped
mbufs twice.

Bump __FreeBSD_version for crypto drivers in ports.

Suggested by: markj
Reviewed by: markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30445

(cherry picked from commit beb817edfe22cdea91e19a60c42caabd9404da48)

2 years agocrypto: Add a new type of crypto buffer for a single mbuf.
John Baldwin [Tue, 25 May 2021 23:59:18 +0000 (16:59 -0700)]
crypto: Add a new type of crypto buffer for a single mbuf.

This is intended for use in KTLS transmit where each TLS record is
described by a single mbuf that is itself queued in the socket buffer.
Using the existing CRYPTO_BUF_MBUF would result in
bus_dmamap_load_crp() walking additional mbufs in the socket buffer
that are not relevant, but generating a S/G list that potentially
exceeds the limit of the tag (while also wasting CPU cycles).

Reviewed by: markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30136

(cherry picked from commit 883a0196b629a07e52562b4103cc0f6391083080)

2 years agosglist: Add sglist_append_single_mbuf().
John Baldwin [Tue, 25 May 2021 23:59:18 +0000 (16:59 -0700)]
sglist: Add sglist_append_single_mbuf().

This function appends the contents of a single mbuf to an sglist
rather than an entire mbuf chain.

Reviewed by: gallatin, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30135

(cherry picked from commit 6663f8a23e7cb60d798c5ffbd9c716b62b204f2a)

2 years agoSupport unmapped mbufs in crypto buffers.
John Baldwin [Tue, 25 May 2021 23:59:18 +0000 (16:59 -0700)]
Support unmapped mbufs in crypto buffers.

Reviewed by: markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30134

(cherry picked from commit 1c8f4b3c9f9e8ca5823d153d3b117246b3d18db4)

2 years agoRename m_unmappedtouio() to m_unmapped_uiomove().
John Baldwin [Tue, 25 May 2021 23:59:18 +0000 (16:59 -0700)]
Rename m_unmappedtouio() to m_unmapped_uiomove().

This function doesn't only copy data into a uio but instead is a
variant of uiomove() similar to uiomove_fromphys().

Reviewed by: gallatin, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30444

(cherry picked from commit aa341db39b6373c5e242f376a3cabe6a6b99141e)

2 years agoExtend m_copyback() to support unmapped mbufs.
John Baldwin [Tue, 25 May 2021 23:59:18 +0000 (16:59 -0700)]
Extend m_copyback() to support unmapped mbufs.

Reviewed by: gallatin, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30133

(cherry picked from commit 3f9dac85cc8f2963026fdc2d5477acb607176a89)

2 years agoExtend m_apply() to support unmapped mbufs.
John Baldwin [Tue, 25 May 2021 23:59:18 +0000 (16:59 -0700)]
Extend m_apply() to support unmapped mbufs.

m_apply() invokes the callback function separately on each segment of
an unmapped mbuf: the TLS header, individual pages, and the TLS
trailer.

Reviewed by: markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30132

(cherry picked from commit 3c7a01d773ac2d128eabb596eed7098f76966cc5)

2 years agoccp, ccr: Simplify drivers to assume an AES-GCM IV length of 12.
John Baldwin [Wed, 6 Oct 2021 21:08:46 +0000 (14:08 -0700)]
ccp, ccr: Simplify drivers to assume an AES-GCM IV length of 12.

While here, use crypto_read_iv() in a few more places in ccr(4) that I
missed previously.

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D32104

(cherry picked from commit cb128893b92994456107d6ca722fdf6e5028eacc)

2 years agocryptodev: Use 'csp' in the handlers for requests.
John Baldwin [Wed, 6 Oct 2021 21:08:46 +0000 (14:08 -0700)]
cryptodev: Use 'csp' in the handlers for requests.

- Retire cse->mode and use csp->csp_mode instead.
- Use csp->csp_cipher_algorithm instead of the ivsize when checking
  for the fixup for the IV length for AES-XTS.

Reviewed by: markj
Sponsored by: Chelsio Communications, The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32103

(cherry picked from commit b4e0a27c5be5090a9db16dd0ad417543b1fb0c4a)

2 years agocryptocheck: Expand the set of sizes tested by -z.
John Baldwin [Thu, 1 Apr 2021 22:42:30 +0000 (15:42 -0700)]
cryptocheck: Expand the set of sizes tested by -z.

Test individual sizes up to the max encryption block length as well as
a few sizes that include 1 full block and a partial block before
doubling the size.

Reviewed by: cem, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D29518

(cherry picked from commit c86de1dab8e65bc9d11501ca51f2e152276cb94e)

2 years agoossl: Don't encryt/decrypt too much data for chacha20.
John Baldwin [Thu, 1 Apr 2021 22:42:18 +0000 (15:42 -0700)]
ossl: Don't encryt/decrypt too much data for chacha20.

The loops for Chacha20 and Chacha20+Poly1305 which encrypted/decrypted
full blocks of data used the minimum of the input and output segment
lengths to determine the size of the next chunk ('todo') to pass to
Chacha20_ctr32().  However, the input and output segments could extend
past the end of the ciphertext region into the tag (e.g.  if a "plain"
single mbuf contained an entire TLS record).  If the length of the tag
plus the length of the last partial block together were at least as
large as a full Chacha20 block (64 bytes), then an extra block was
encrypted/decrypted overlapping with the tag.  Fix this by also
capping the amount of data to encrypt/decrypt by the amount of
remaining data in the ciphertext region ('resid').

Reported by: gallatin
Reviewed by: cem, gallatin, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D29517

(cherry picked from commit d2e076c37b0963a8be89684a656c4e1640dc7a3e)

2 years agoAdd Chacha20+Poly1035 to the list of AEAD algorithms.
John Baldwin [Thu, 18 Mar 2021 20:31:39 +0000 (13:31 -0700)]
Add Chacha20+Poly1035 to the list of AEAD algorithms.

Sponsored by: Netflix

(cherry picked from commit c853c53d024a3cc950854dfaade7f50303c5a022)

2 years agoossl: Add support for the ChaCha20 + Poly1305 AEAD cipher from RFC 8439
John Baldwin [Wed, 3 Mar 2021 23:17:51 +0000 (15:17 -0800)]
ossl: Add support for the ChaCha20 + Poly1305 AEAD cipher from RFC 8439

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D28757

(cherry picked from commit 78991a93eb9dd3074a3fc19b88a7c3e34e1ec703)

2 years agopoly1305: Don't export generic Poly1305_* symbols from xform_poly1305.c.
John Baldwin [Fri, 5 Mar 2021 17:47:58 +0000 (09:47 -0800)]
poly1305: Don't export generic Poly1305_* symbols from xform_poly1305.c.

There currently isn't a need to provide a public interface to a
software Poly1305 implementation beyond what is already available via
libsodium's APIs and these symbols conflict with symbols shared within
the ossl.ko module between ossl_poly1305.c and ossl_chacha20.c.

Reported by: se, kp
Fixes: 78991a93eb9d
Sponsored by: Netflix

(cherry picked from commit bb6e84c988d3f54eff602ed544ceaa9b9fe3e9ff)

2 years agoossl: Add ChaCha20 cipher support.
John Baldwin [Wed, 3 Mar 2021 23:17:43 +0000 (15:17 -0800)]
ossl: Add ChaCha20 cipher support.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D28756

(cherry picked from commit 92aecd1e6fac47ffc893f628c1fe289568bb19cb)

2 years agoThe ChaCha20 counter is little endian, not big endian.
John Baldwin [Wed, 3 Mar 2021 23:17:37 +0000 (15:17 -0800)]
The ChaCha20 counter is little endian, not big endian.

Reviewed by: cem
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D28755

(cherry picked from commit a899ce4ba4c404d342bf892b8b756b66fc65d6b5)

2 years agoossl: Add Poly1305 digest support.
John Baldwin [Wed, 3 Mar 2021 23:17:29 +0000 (15:17 -0800)]
ossl: Add Poly1305 digest support.

Reviewed by: cem
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D28754

(cherry picked from commit a079e38b08f2f07c50ba915dae66d099559abdcc)

2 years agocryptocheck: Free generated IV after each GMAC test.
John Baldwin [Wed, 3 Mar 2021 23:17:19 +0000 (15:17 -0800)]
cryptocheck: Free generated IV after each GMAC test.

Reviewed by: cem
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D28753

(cherry picked from commit 442a293611461834778d1b7cd2ac170fb3427dcf)

2 years agocryptocheck: Add support for the Poly1305 digest.
John Baldwin [Wed, 3 Mar 2021 23:17:00 +0000 (15:17 -0800)]
cryptocheck: Add support for the Poly1305 digest.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D28758

(cherry picked from commit 68c03734484f679bf2f15fc81359128e331db364)

2 years agocryptosoft: Support per-op keys for AES-GCM and AES-CCM.
John Baldwin [Thu, 18 Feb 2021 17:24:35 +0000 (09:24 -0800)]
cryptosoft: Support per-op keys for AES-GCM and AES-CCM.

Reviewed by: cem
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D28752

(cherry picked from commit a10020cfe2830e9626ac58ae97ecd12afb3553be)

2 years agocryptocheck: Add Chacha20-Poly1305 AEAD coverage.
John Baldwin [Thu, 18 Feb 2021 17:23:36 +0000 (09:23 -0800)]
cryptocheck: Add Chacha20-Poly1305 AEAD coverage.

- Make openssl_gcm_encrypt generic to AEAD ciphers (aside from CCM)
  and use it for Chacha20-Poly1305.

- Use generic AEAD control constants instead of GCM/CCM specific names.

Reviewed by: cem
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D27838

(cherry picked from commit 1bd9fc96d4e4a26bb0060698c07b6f13d19cd819)

2 years agoAdd an implementation of CHACHA20_POLY1305 to cryptosoft.
John Baldwin [Thu, 18 Feb 2021 17:22:18 +0000 (09:22 -0800)]
Add an implementation of CHACHA20_POLY1305 to cryptosoft.

This uses the chacha20 IETF and poly1305 implementations from
libsodium.  A seperate auth_hash is created for the auth side whose
Setkey method derives the poly1305 key from the AEAD key and nonce as
described in RFC 8439.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D27837

(cherry picked from commit dd2e1352b68aa33f7f6f8c19aaf88cf287013ae8)

2 years agoAdd an OCF algorithm for ChaCha20-Poly1305 AEAD.
John Baldwin [Thu, 18 Feb 2021 17:21:56 +0000 (09:21 -0800)]
Add an OCF algorithm for ChaCha20-Poly1305 AEAD.

Note that this algorithm implements the mode defined in RFC 8439.

Reviewed by: cem
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D27836

(cherry picked from commit fc8fc743d89388c0c5b97a491428fab2b36beac8)

2 years agocontrib/tzdata: correct DST in Fiji
Philip Paeps [Mon, 18 Oct 2021 06:19:42 +0000 (14:19 +0800)]
contrib/tzdata: correct DST in Fiji

Direct commit to stable/13.

Unfortunately, there is still no clear consensus on the tz mailing list
about some of the changes introduced by tzdata 2021b and later releases.
Pending consensus, only merge the recently announced DST transition date
for Fiji and corrections to commentary from tzdata 2021d.  This corrects
future timestamps in Fiji.

2 years agocxgbe/t4_tom: Use stale L2T entry and avoid busy-waiting for resolution.
Navdeep Parhar [Thu, 9 Sep 2021 03:46:42 +0000 (20:46 -0700)]
cxgbe/t4_tom: Use stale L2T entry and avoid busy-waiting for resolution.
Sponsored by: Chelsio Communications

(cherry picked from commit 53c17de2b472c5c4982d5a020268ad3098241498)

2 years agocxgbe(4): Fix the decode and display of the DBVFIFO region in meminfo.
Navdeep Parhar [Tue, 7 Sep 2021 23:28:11 +0000 (16:28 -0700)]
cxgbe(4): Fix the decode and display of the DBVFIFO region in meminfo.

Sponsored by: Chelsio Communications

(cherry picked from commit 92de737996660b70376a8b72b80037f89d876056)

2 years agocxgbe(4): Display HMA information in meminfo.
Navdeep Parhar [Tue, 7 Sep 2021 20:39:44 +0000 (13:39 -0700)]
cxgbe(4): Display HMA information in meminfo.

This should have been added with initial T6 support many years ago.

Sponsored by: Chelsio Communications

(cherry picked from commit 83a611e09238ead5a765c0ea2c02699fe8175756)

2 years agocxgbe(4): Initialize abs_id for ctrl and ofld queues.
Navdeep Parhar [Mon, 19 Jul 2021 22:47:07 +0000 (15:47 -0700)]
cxgbe(4): Initialize abs_id for ctrl and ofld queues.

Sponsored by: Chelsio Communications

(cherry picked from commit 76c890229628109e46f01c5037b773b59247a1f8)