Skip to content

openssl_3_5: disable afalg engine - #579040

Merged
uninsane merged 1 commit into
NixOS:stagingfrom
whispersofthedawn:p/openssl/afalg-test
Oct 29, 2026
Merged

uninsane merged 1 commit into
NixOS:stagingfrom
whispersofthedawn:p/openssl/afalg-test

Conversation

@whispersofthedawn

Copy link
Copy Markdown
Contributor

this test is dependent on properties of the build kernel. it seems that additional restrictions to af_alg in kernel 7.3 are causing this test to fail. upstream dropped this test with the removal of engine support in openssl v4, so let's just disable this test for now to work around the issue.

failure logs:

30-test_afalg.t ......................... 
# The results of this test will end up in test-runs/test_afalg
1..1
    # Subtest: ../../test/afalgtest
    1..2
        # Subtest: test_afalg_aes_cbc
        1..3
ALG_PERR: engines/e_afalg.c(462): Failed to bind socket : No such file or directory
        # ERROR: (bool) 'EVP_CipherInit_ex(ctx, cipher, e, key, iv, 1) == true' failed @ test/afalgtest.c:79
        # false
        # 80B3FAF7FF7F0000:error:40000067:lib(128)::socket bind failed:engines/e_afalg.c:463:
        # OPENSSL_TEST_RAND_SEED=1792953249
        not ok 1 - iteration 1
ALG_PERR: engines/e_afalg.c(462): Failed to bind socket : No such file or directory
        # ERROR: (bool) 'EVP_CipherInit_ex(ctx, cipher, e, key, iv, 1) == true' failed @ test/afalgtest.c:79
        # false
        # 80B3FAF7FF7F0000:error:40000067:lib(128)::socket bind failed:engines/e_afalg.c:463:
        # OPENSSL_TEST_RAND_SEED=1792953249
        not ok 2 - iteration 2
ALG_PERR: engines/e_afalg.c(462): Failed to bind socket : No such file or directory
        # ERROR: (bool) 'EVP_CipherInit_ex(ctx, cipher, e, key, iv, 1) == true' failed @ test/afalgtest.c:79
        # false
        # 80B3FAF7FF7F0000:error:40000067:lib(128)::socket bind failed:engines/e_afalg.c:463:
        # OPENSSL_TEST_RAND_SEED=1792953249
        not ok 3 - iteration 3
    # OPENSSL_TEST_RAND_SEED=1792953249
    not ok 1 - test_afalg_aes_cbc
    ok 2 - test_pr16743
../../util/wrap.pl ../../test/afalgtest => 1
not ok 1 - running afalgtest

#   Failed test 'running afalgtest'
#   at test/recipes/30-test_afalg.t line 21.
# Looks like you failed 1 test of 1.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
Test Summary Report
-------------------
30-test_afalg.t                       (Wstat: 256 (exited 1) Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=347, Tests=4521, 777 wallclock secs (13.50 usr  2.07 sys + 578.76 cusr 317.03 csys = 911.36 CPU)
Result: FAIL
make[2]: *** [Makefile:3958: run_tests] Error 1
make[2]: Leaving directory '/build/openssl-3.5.9'
make[1]: *** [Makefile:3955: _tests] Error 2
make[1]: Leaving directory '/build/openssl-3.5.9'
make: *** [Makefile:3953: tests] Error 2

full: openssl-3.5.9.log

Things done

@nixpkgs-ci
nixpkgs-ci Bot requested review from a team, pyrox0 and thillux and removed request for a team October 26, 2026 01:48
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. labels Oct 26, 2026
@nixpkgs-ci
nixpkgs-ci Bot requested a review from a team October 26, 2026 01:57
@whispersofthedawn whispersofthedawn mentioned this pull request Oct 26, 2026
5 of 13 tasks
@thillux

thillux commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

I'd prefer to just disable the engine for OpenSSL < 4.0. Like:

@@ -228,7 +219,11 @@ let
       # We select KTLS here instead of the configure-time detection (which we patch out).
       # KTLS should work on FreeBSD 13+ as well, so we could enable it if someone tests it.
       ++ lib.optional (lib.versionAtLeast version "3.0.0" && enableKTLS) "enable-ktls"
-      ++ lib.optional (lib.versionAtLeast version "1.1.1" && stdenv.hostPlatform.isAarch64) "no-afalgeng"
+      # Linux kernel starting with 7.3 restricts the access to AF_ALG
+      # and probably will drop this interface in the future.
+      # 4.0 and above dropped it along with engine support in
+      # https://github.com/openssl/openssl/commit/2db3f8cf8b432f0c39b619dd92269a732256449e
+      ++ lib.optional (lib.versionOlder version "4.0") "no-afalgeng"
       # OpenSSL needs a specific `no-shared` configure flag.
       # See https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_Options
       # for a comprehensive list of configuration options.

@whispersofthedawn whispersofthedawn changed the title openssl_3_5: disable 30-test_afalg.t test which is dependent on build kernel openssl_3_5: disable afalg engine Oct 26, 2026
the linux kernel starting at 7.3 restricts access to AF_ALG and probably
will drop this interface in the future. 4.0 and above dropped it along
with engine support in openssl/openssl@2db3f8c.

this seems extremely unlikely to cause breakage, as this is a nichely
used API which was already linux-only and we had disabled on
aarch64-linux as well.

Co-authored-by: Markus Theil <[email protected]>
@whispersofthedawn

Copy link
Copy Markdown
Contributor Author

oh, i completely missed that we did that already for aarch64-linux. makes sense to me, applied. thanks!

(i was initially worried about breakage when i saw your comment, but the fact that this is already a niche api, broken on some configurations (kernel 7.3+ or restricted crypto user api), and was disabled on our of our two major linux platforms gives me enough confidence that that's unlikely to be a problem.)

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. and removed 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. labels Oct 26, 2026

@uninsane uninsane left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ built native x86_64 openssl_{3_5,4_1}, pkgsMusl.openssl_{3_5,4_1}, pkgsCross.aarch64-multiplatform.openssl_{3_5,4_1} from a linux 7.3 builder. thanks for fixing!

@uninsane
uninsane added this pull request to the merge queue Oct 29, 2026
@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 29, 2026
Merged via the queue into NixOS:staging with commit 3ff7c94 Oct 29, 2026
30 checks passed
@whispersofthedawn
whispersofthedawn deleted the p/openssl/afalg-test branch October 29, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants