zfs: wolfZFS port for OpenZFS 2.4.2 (FIPS fixes; supersedes #341)#346
zfs: wolfZFS port for OpenZFS 2.4.2 (FIPS fixes; supersedes #341)#346ColtonWilley wants to merge 2 commits into
Conversation
909e44c to
98b07c7
Compare
|
Updated to fold in a small test-wiring fix the OpenZFS test suite exposed: the userspace ICP checksum test programs Full validation on this patch (built from wolfSSL master for
|
Rebase the wolfZFS port to the zfs-2.4.2 release tag and fold in the FIPS
fixes (-287 private-key unlock, GCM-IV approved-DRBG upgrade, provider-native
EVP_KDF userspace key-derivation). Link the userspace ICP checksum test
programs (sha2_test, blake3_test) against libwolfssl. Quote
MODULE_IMPORT_NS("WOLFSSL") for kernel >= 6.13.
RNG: rely on ZFS's native random_get_bytes() for all key/salt/IV material
(it is the wolfCrypt FIPS DRBG once the CRNG kernel patch is installed). The
only delta vs vanilla ZFS is upgrading the two GCM-IV sites in zio_crypt.c
(zio_crypt_key_wrap, zio_crypt_generate_iv) from random_get_pseudo_bytes to
random_get_bytes, so GCM IVs come from an approved DRBG (SP 800-38D requires
it; the xorshift pseudo-RNG is not approved). No direct wc_RNG calls remain;
wolfZFS owns the crypto primitives and the CRNG patch owns RNG.
Validated on Proxmox VE 9.2 (zfs-2.4.2-pve1, kernel 7.0.12-1-pve) and the
OpenZFS test suite: run_crypto 2/2, run_sanity with all failures within the
known vanilla-ZFS environmental baseline, zero regressions.
98b07c7 to
fe303a2
Compare
There was a problem hiding this comment.
This is cool and tests nicely on Debian 13 with a tiny modification.
Two suggestions:
-
We break
patches/into distros, like:patches/debian13/,patches/proxmox_ve_9.2/. I think the original debian 13 trixie POC is a generally applicable reference that we should keep. -
It seems there is still userspace
-lwolfssllinking even with this PR:
.libs/libzpool.so
linux-vdso.so.1 (0x00007f04383d5000)
...
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f0438397000)
libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f0438337000)
libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007f0437dbb000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f0437d9b000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0437cab000)
libwolfssl.so.45 => /usr/local/lib/libwolfssl.so.45 (0x00007f0437a00000)
If userspace -lwolfssl linking is unavoidable, we could patch the userspace part of OpenZFS to use wolfssl directly, and not use compat layer or provider interface.
Production userspace (zfs/zpool/zed via libzfs) performs all of its crypto (PBKDF2 key derivation, salt RNG) through OpenSSL 3.x provider-routable APIs and references no wolfSSL symbols; the -lwolfssl in libzfs_la_LIBADD only stamped a needless libwolfssl.so runtime dependency into libzfs.so (and into every libtool consumer via .la dependency_libs). Remove it so direct libwolfssl linking is confined to libzpool/libicp consumers (zdb, zhack, ztest, zstream, raidz_test and the ICP test binaries), keeping production userspace fully provider-routed. Verified with a userspace-only build on the zfs-2.4.2 tag: libzfs.so links with zero undefined symbols and a wolfssl-free runtime closure for zfs/zpool; libzpool.so retains libwolfssl.so as intended; ICP KATs pass via crypto_test (AES-GCM 316/316, AES-CCM 552/552).
Updates the wolfZFS port to OpenZFS 2.4.2 (tag
zfs-2.4.2) and folds in the FIPS fixes. Supersedes #341 (which carried only the -287 unlock) — that PR can be closed.Changes vs the
cd06f79e2portzfs-2.4.2— applies with 0 fuzz to both upstreamzfs-2.4.2and Proxmox2.4.2-pve1.module/zfs/hkdf.c:PRIVATE_KEY_UNLOCKbracket fixesFIPS_PRIVATE_KEY_LOCKED_E(-287) on encrypted dataset creation under wolfCrypt FIPS (this was zfs: fix FIPS_PRIVATE_KEY_LOCKED_E (-287) on encrypted dataset creation under wolfCrypt FIPS #341).wc_InitRng/wc_RNG_GenerateBlock) for thezfs_ioctl_os.ccontrol sites and thezio_crypt.cper-block IV hot path.EVP_KDF "PBKDF2"+RAND_bytessalt, so it routes through an OpenSSL 3.x provider (e.g. wolfProvider).MODULE_IMPORT_NS("WOLFSSL")quoted for kernel >= 6.13.Validation
Built and exercised on Proxmox VE 9.2 (
zfs-2.4.2-pve1, kernel7.0.12-1-pve):zfs-2.4.2and Proxmox2.4.2-pve1.--with-config=kernel) builds:depends: spl,libwolfssl, 28wc_imports, 0_fipssymbols.aes-256-gcm) round-trips through wolfCrypt and survives reboot.Patch stat: 41 files changed, 1002 insertions(+), 28613 deletions(-).