HomeFreeBSD

aesni: Push FPU sections down further

Description

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)

Details

Provenance
markjAuthored on Aug 29 2023, 1:26 AM
jhbCommitted on Dec 29 2023, 9:49 PM
Parents
rGcfc94a37d8d9: aesni: Switch to using FPU_KERN_NOCTX.
Branches
Unknown
Tags
Unknown