zfs: support wolfzfs patch.#10397
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new --enable-wolfzfs configure-time path intended to tailor wolfSSL/wolfCrypt builds for the OpenZFS wolfCrypt patch, mainly by toggling crypto feature flags and kernel-oriented build defines in configure.ac.
Changes:
- Adds a new
--enable-wolfzfsconfigure option withyes/kernelhandling. - Forces wolfzfs-related AES feature toggles and extra preprocessor defines during configure.
- Adjusts atomic-header probing and AES-CCM configure logic to account for wolfzfs builds.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Retest this please |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (4)
configure.ac:3352
- The block setting
ENABLED_AESCCM="yes"here runs before theAC_ARG_ENABLE([aesccm])at line 3355. When the user does not pass--enable-aesccm, AC_ARG_ENABLE will execute its default actionENABLED_AESCCM=noand silently overwrite this assignment. As a result this assignment has no effect, and$ENABLED_AESCCMwill read as "no" in subsequent shell logic / summary output even though wolfzfs was requested. (The HAVE_AESCCM #define still ends up applied via theENABLED_WOLFZFS != "no"test below, but the ENABLED_AESCCM variable itself is wrong.) Either move this block after the AC_ARG_ENABLE for aesccm, or override the variable there.
if test "x$ENABLED_WOLFZFS" = "xyes" || test "x$ENABLED_WOLFZFS" = "xkernel"
then
# zfs uses ccm, and gcm streaming.
ENABLED_AESCCM="yes"
ENABLED_AESGCM="yes"
ENABLED_AESGCM_STREAM="yes"
fi
configure.ac:3362
- The condition
test "$ENABLED_WOLFZFS" != "no"is true for any value other than literally "no", including the documented value "disabled" mentioned in the help string above, and any unexpected user-supplied value. The intended set of values that should enable wolfzfs is "yes" or "kernel" (matching the test used at lines 193 and 3346). Use an explicit positive test (e.g.,= "yes" || = "kernel") for consistency and to avoid accidentally enabling AESCCM on misspelled or "disabled" inputs.
if test "$ENABLED_AESCCM" = "yes" || test "$ENABLED_WOLFENGINE" = "yes" ||
test "$ENABLED_WOLFZFS" != "no"
configure.ac:217
- This change silently alters the default behavior for all non-FreeBSD-kernel builds. Previously, the
elsebranch unconditionally probed forstdatomic.h. After this change, the probe only runs whenENABLED_WOLFZFS = "no". For any other value the wolfzfs variable might take (e.g., "yes" for userspace libzfs, "disabled", or any other string a user provides), the stdatomic.h probe is skipped entirely andWOLFSSL_HAVE_ATOMIC_His never defined. The accompanying comment says "Don't use stdatomic.h with wolfzfs kernel", implying only the kernel build should be excluded — userspace (--enable-wolfzfs=yes) should still get the probe. The condition should betest "x$ENABLED_WOLFZFS" != "xkernel"(or equivalent), not= "xno".
elif test "x$ENABLED_WOLFZFS" = "xno"; then
# Don't use stdatomic.h with wolfzfs kernel. It expects gcc builtins.
AC_CHECK_HEADER(stdatomic.h, [AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSL_HAVE_ATOMIC_H"],[])
configure.ac:205
- No validation is performed on the value of
$enableval— only "yes" and "kernel" are handled. Other inputs (e.g., a typo like--enable-wolfzfs=kernal, or the "disabled" value advertised in the help string) will silently fall through this block while still being treated as "not no" by the test at line 3361, producing an inconsistent partial configuration. Consider rejecting unknown values withAC_MSG_ERRORlike other multi-value--enable-*options in this file.
if test "x$ENABLED_WOLFZFS" = "xyes" || test "x$ENABLED_WOLFZFS" = "xkernel"
then
if test "x$ENABLED_WOLFZFS" = "xyes"; then
# userspace libzfs requires openssl compat layer, which will
# be detected and enabled later.
AM_CFLAGS="$AM_CFLAGS -DNO_OLD_SHA_NAMES"
fi
if test "x$ENABLED_WOLFZFS" = "xkernel"; then
# kernelspace libzfs
AM_CFLAGS="$AM_CFLAGS -DNO_STDDEF_H -DNO_STDATOMIC_H"
fi
fi
|
|
||
| # wolfzfs support | ||
| AC_ARG_ENABLE([wolfzfs], | ||
| [AS_HELP_STRING([--enable-wolfzfs],[Enable wolfZFS support ((options: kernel, yes, no, disabled default: disabled)).])], |
Description
wolfzfs: support for wolfcrypt patch to OpenZFS.