Skip to content

zfs: support wolfzfs patch.#10397

Open
philljj wants to merge 1 commit into
wolfSSL:masterfrom
philljj:support_wolfzfs
Open

zfs: support wolfzfs patch.#10397
philljj wants to merge 1 commit into
wolfSSL:masterfrom
philljj:support_wolfzfs

Conversation

@philljj
Copy link
Copy Markdown
Contributor

@philljj philljj commented May 5, 2026

Description

wolfzfs: support for wolfcrypt patch to OpenZFS.

@philljj philljj self-assigned this May 5, 2026
Copilot AI review requested due to automatic review settings May 5, 2026 06:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-wolfzfs configure option with yes/kernel handling.
  • 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.

Comment thread configure.ac Outdated
Comment thread configure.ac Outdated
Comment thread configure.ac Outdated
Comment thread configure.ac Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

MemBrowse Memory Report

No memory changes detected for:

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread configure.ac
Comment thread configure.ac
@philljj
Copy link
Copy Markdown
Contributor Author

philljj commented May 12, 2026

Retest this please

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the AC_ARG_ENABLE([aesccm]) at line 3355. When the user does not pass --enable-aesccm, AC_ARG_ENABLE will execute its default action ENABLED_AESCCM=no and silently overwrite this assignment. As a result this assignment has no effect, and $ENABLED_AESCCM will read as "no" in subsequent shell logic / summary output even though wolfzfs was requested. (The HAVE_AESCCM #define still ends up applied via the ENABLED_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 else branch unconditionally probed for stdatomic.h. After this change, the probe only runs when ENABLED_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 and WOLFSSL_HAVE_ATOMIC_H is 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 be test "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 with AC_MSG_ERROR like 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

Comment thread configure.ac

# wolfzfs support
AC_ARG_ENABLE([wolfzfs],
[AS_HELP_STRING([--enable-wolfzfs],[Enable wolfZFS support ((options: kernel, yes, no, disabled default: disabled)).])],
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.

2 participants