Skip to content

zfs: wolfZFS port for OpenZFS 2.4.2 (FIPS fixes; supersedes #341)#346

Draft
ColtonWilley wants to merge 1 commit into
wolfSSL:masterfrom
ColtonWilley:wolfzfs-2.4.2-fips
Draft

zfs: wolfZFS port for OpenZFS 2.4.2 (FIPS fixes; supersedes #341)#346
ColtonWilley wants to merge 1 commit into
wolfSSL:masterfrom
ColtonWilley:wolfzfs-2.4.2-fips

Conversation

@ColtonWilley

Copy link
Copy Markdown
Contributor

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 cd06f79e2 port

  • Rebased to zfs-2.4.2 — applies with 0 fuzz to both upstream zfs-2.4.2 and Proxmox 2.4.2-pve1.
  • module/zfs/hkdf.c: PRIVATE_KEY_UNLOCK bracket fixes FIPS_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).
  • In-kernel RNG keygen (wc_InitRng / wc_RNG_GenerateBlock) for the zfs_ioctl_os.c control sites and the zio_crypt.c per-block IV hot path.
  • Userspace key-derivation switched to provider-native EVP_KDF "PBKDF2" + RAND_bytes salt, 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, kernel 7.0.12-1-pve):

  • Patch applies with 0 fuzz to both upstream zfs-2.4.2 and Proxmox 2.4.2-pve1.
  • Kernel module (--with-config=kernel) builds: depends: spl,libwolfssl, 28 wc_ imports, 0 _fips symbols.
  • Encrypted dataset (aes-256-gcm) round-trips through wolfCrypt and survives reboot.

Patch stat: 41 files changed, 1002 insertions(+), 28613 deletions(-).

@ColtonWilley

Copy link
Copy Markdown
Contributor Author

Updated to fold in a small test-wiring fix the OpenZFS test suite exposed: the userspace ICP checksum test programs sha2_test/blake3_test link libicp.la directly, so they need -lwolfssl (otherwise undefined reference to wc_Sha256Final). Appended to their LDADD in tests/zfs-tests/cmd/Makefile.am.

Full validation on this patch (built from wolfSSL master for --enable-wolfzfs):

  • run_crypto: 2/2 — icp_aes_ccm 552/552, icp_aes_gcm 316/316 (both [wolfcrypt]-tagged, i.e. KATs route through wolfCrypt).
  • run_sanity: 822 PASS / 6 FAIL (99.3%); the 6 failures are a strict subset of the known vanilla-ZFS environmental failures — zero wolfCrypt-routing regressions. Encryption-exercising tests (zfs_send/receive_from_encrypted/rsend, encrypted create) all pass.
  • Applies with 0 fuzz to both upstream zfs-2.4.2 and Proxmox zfs-2.4.2-pve1; kernel module + encrypted-dataset round-trips validated on Proxmox VE 9.2 (kernel 7.0.12-1-pve).

@ColtonWilley ColtonWilley marked this pull request as draft June 23, 2026 22:52
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant