opnsense-src/sys/crypto/aesni
Mark Johnston 276666497e aesni: Push FPU sections down further
After commit 937b4473be21 aesni_cipher_crypt() and aesni_cipher_mac()
execute in a FPU_KERN_NOCTX section, which means that they must run with
preemption disabled.  These functions handle discontiguous I/O buffers
by allocating a contiguous buffer and copying as necessary, but this
allocation cannot happen with preemption disabled.  Fix the problem by
pushing the FPU section down into aesni_cipher_crypt() and
aesni_cipher_mac().  In particular, encrypt-then-auth transforms need
not be handled with a single FPU section.

Reported by:	syzbot+78258dbb02eb92157357@syzkaller.appspotmail.com
Discussed with:	jhb
Fixes:		937b4473be21 ("aesni: Switch to using FPU_KERN_NOCTX.")

(cherry picked from commit 6b635c74fd4135eaae68970bfc5aad9ae905fec7)
2023-12-29 13:49:42 -08:00
..
aesencdec.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
aeskeys_amd64.S Delete trailing whitespace from $FreeBSD$ removal 2023-08-21 19:37:28 -06:00
aeskeys_i386.S Delete trailing whitespace from $FreeBSD$ removal 2023-08-21 19:37:28 -06:00
aesni.c aesni: Push FPU sections down further 2023-12-29 13:49:42 -08:00
aesni.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
aesni_ccm.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
aesni_ghash.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
aesni_os.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
aesni_wrap.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
intel_sha1.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
intel_sha256.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
sha_sse.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00