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.")

Details

Provenance
markjAuthored on Aug 29 2023, 1:26 AM
Parents
rGaca3bd160257: libc: Fix fixed-width case in the new integer parser.
Branches
Unknown
Tags
Unknown