Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD: disable the use of hardware crypto offload drivers for now #11612

Merged
merged 1 commit into from
Feb 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions module/os/freebsd/zfs/crypto_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,19 @@ freebsd_crypt_newsession(freebsd_crypt_session_t *sessp,
error = ENOTSUP;
goto bad;
}
error = crypto_newsession(&sessp->fs_sid, &csp,
CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE);

/*
* Disable the use of hardware drivers on FreeBSD 13 and later since
* common crypto offload drivers impose constraints on AES-GCM AAD
* lengths that make them unusable for ZFS, and we currently do not have
* a mechanism to fall back to a software driver for requests not
* handled by a hardware driver.
*
* On 12 we continue to permit the use of hardware drivers since
* CPU-accelerated drivers such as aesni(4) register themselves as
* hardware drivers.
*/
error = crypto_newsession(&sessp->fs_sid, &csp, CRYPTOCAP_F_SOFTWARE);
mtx_init(&sessp->fs_lock, "FreeBSD Cryptographic Session Lock",
NULL, MTX_DEF);
crypt_sessions++;
Expand Down