Skip to content

Conversation

@sameehj
Copy link
Contributor

@sameehj sameehj commented Dec 31, 2025

RHEL9 kernels (9.6+) disable RSA signing and decryption in the kernel crypto API for security reasons (CVE-2023-6240). The kernel forcibly overwrites akcipher sign/decrypt callbacks to return -ENOSYS, regardless of what the driver provides.

Commit 3709c35c in the RHEL kernel:
"crypto: akcipher - Disable signing and decryption"

This affects our self-tests which call crypto_akcipher_sign() and crypto_akcipher_decrypt(). On RHEL9, these operations return -ENOSYS even though our driver correctly implements them.

Add compile-time checks for RHEL_RELEASE_CODE >= 9.6 to detect this scenario and skip the affected self-tests gracefully. The tests pass since the algorithms are registered correctly; the kernel simply refuses to execute sign/decrypt operations as a matter of policy.

Note: encrypt and verify operations are unaffected and continue to be tested normally.

https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/commit/3709c35cf173f886689e201914911b464881c947

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@sameehj sameehj force-pushed the rhel9_linuxkm_sign branch 4 times, most recently from 8fcecfe to 8960c37 Compare December 31, 2025 12:10
Copy link
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

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

With the fix to the #include clause, this works!

[    0.000000] Linux version 5.14.0-xxx-rhel9v6 (douzzer@ganglion) (gcc (Gentoo 14.3.1_p20250718 p2) 14.3.1 20250718, GNU ld (Gentoo 2.44 p4) 2.44.0) #1 SMP PREEMPT_DYNAMIC Thu Aug 7 14:25:47 CDT 2025
[...]
[   38.370118] ecdsa-nist-p521-fips-140-3-wolfcrypt self-test OK -- registered for ecdsa-nist-p521 with priority 100000.
[   38.370163] alg: ecdh-nist-p256 (ecdh-nist-p256-fips-140-3-wolfcrypt) is disabled due to FIPS
[   38.370171] info: skipping unsupported kpp algorithm ecdh-nist-p256-fips-140-3-wolfcrypt: -2
[   38.370172] wolfCrypt: skipping FIPS-incompatible alg ecdh-nist-p256-fips-140-3-wolfcrypt.
[   38.370235] alg: ecdh-nist-p384 (ecdh-nist-p384-fips-140-3-wolfcrypt) is disabled due to FIPS
[   38.370248] info: skipping unsupported kpp algorithm ecdh-nist-p384-fips-140-3-wolfcrypt: -2
[   38.370249] wolfCrypt: skipping FIPS-incompatible alg ecdh-nist-p384-fips-140-3-wolfcrypt.
[   38.370333] alg: self-tests for pkcs1pad(rsa-fips-140-3-wolfcrypt,sha224) (pkcs1pad(rsa,sha224)) passed
[   38.466589] info: skipping crypto_akcipher_sign (disabled by RHEL policy)
[   38.466595] pkcs1pad(rsa-fips-140-3-wolfcrypt,sha224) self-test OK -- registered for pkcs1pad(rsa,sha224) with priority 100000.
[   38.466830] alg: self-tests for pkcs1pad(rsa-fips-140-3-wolfcrypt,sha256) (pkcs1pad(rsa,sha256)) passed
[   38.529209] info: skipping crypto_akcipher_sign (disabled by RHEL policy)
[   38.529217] pkcs1pad(rsa-fips-140-3-wolfcrypt,sha256) self-test OK -- registered for pkcs1pad(rsa,sha256) with priority 100000.
[   38.529363] alg: self-tests for pkcs1pad(rsa-fips-140-3-wolfcrypt,sha384) (pkcs1pad(rsa,sha384)) passed
[   38.794341] info: skipping crypto_akcipher_sign (disabled by RHEL policy)
[   38.794349] pkcs1pad(rsa-fips-140-3-wolfcrypt,sha384) self-test OK -- registered for pkcs1pad(rsa,sha384) with priority 100000.
[   38.794491] alg: self-tests for pkcs1pad(rsa-fips-140-3-wolfcrypt,sha512) (pkcs1pad(rsa,sha512)) passed
[   38.820485] info: skipping crypto_akcipher_sign (disabled by RHEL policy)
[   38.820490] pkcs1pad(rsa-fips-140-3-wolfcrypt,sha512) self-test OK -- registered for pkcs1pad(rsa,sha512) with priority 100000.
[   38.820599] alg: No test for pkcs1pad(rsa,sha3-256) (pkcs1pad(rsa-fips-140-3-wolfcrypt,sha3-256))
[   38.887265] info: skipping crypto_akcipher_sign (disabled by RHEL policy)
[   38.887272] pkcs1pad(rsa-fips-140-3-wolfcrypt,sha3-256) self-test OK -- registered for pkcs1pad(rsa,sha3-256) with priority 100000.
[   38.887397] alg: No test for pkcs1pad(rsa,sha3-384) (pkcs1pad(rsa-fips-140-3-wolfcrypt,sha3-384))
[   38.920057] info: skipping crypto_akcipher_sign (disabled by RHEL policy)
[   38.920064] pkcs1pad(rsa-fips-140-3-wolfcrypt,sha3-384) self-test OK -- registered for pkcs1pad(rsa,sha3-384) with priority 100000.
[   38.920215] alg: No test for pkcs1pad(rsa,sha3-512) (pkcs1pad(rsa-fips-140-3-wolfcrypt,sha3-512))
[   39.002644] info: skipping crypto_akcipher_sign (disabled by RHEL policy)
[   39.002650] pkcs1pad(rsa-fips-140-3-wolfcrypt,sha3-512) self-test OK -- registered for pkcs1pad(rsa,sha3-512) with priority 100000.
[   39.002803] alg: self-tests for rsa-fips-140-3-wolfcrypt (rsa) passed
[   39.077305] info: skipping crypto_akcipher_decrypt (disabled by RHEL policy)
[   39.077311] rsa-fips-140-3-wolfcrypt self-test OK -- registered for rsa with priority 100000.
[...]
[   42.364971] wolfCrypt: 43 algorithms registered.
[   42.364978] wolfCrypt 5.8.4 loaded with valid module signature.
[   42.364978] See https://www.wolfssl.com/ for more information.
[   42.364978] wolfCrypt Copyright (C) 2006-present wolfSSL Inc.  Licensed under GPL.

RHEL9 kernels (9.6+) disable RSA signing and decryption in the kernel
crypto API for security reasons (CVE-2023-6240). The kernel forcibly
overwrites akcipher sign/decrypt callbacks to return -ENOSYS, regardless
of what the driver provides.

Commit 3709c35c in the RHEL kernel:
"crypto: akcipher - Disable signing and decryption"

This affects our self-tests which call crypto_akcipher_sign() and
crypto_akcipher_decrypt(). On RHEL9, these operations return -ENOSYS
even though our driver correctly implements them.

Add compile-time checks for RHEL_RELEASE_CODE >= 9.6 to detect this
scenario and skip the affected self-tests gracefully. The tests pass
since the algorithms are registered correctly; the kernel simply
refuses to execute sign/decrypt operations as a matter of policy.

Note: encrypt and verify operations are unaffected and continue to be
tested normally.

Signed-off-by: Sameeh Jubran <[email protected]>
@sameehj sameehj force-pushed the rhel9_linuxkm_sign branch from 8960c37 to 3c0a365 Compare January 1, 2026 09:35
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