-
Notifications
You must be signed in to change notification settings - Fork 915
linuxkm: handle RHEL9 disabled akcipher sign/decrypt ops #9597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sameehj
wants to merge
1
commit into
wolfSSL:master
Choose a base branch
from
sameehj:rhel9_linuxkm_sign
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+28
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8fcecfe to
8960c37
Compare
douzzer
requested changes
Dec 31, 2025
Contributor
douzzer
left a comment
There was a problem hiding this 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]>
8960c37 to
3c0a365
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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