-
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
Conversation
8fcecfe to
8960c37
Compare
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.
3c0a365 to
c15b35a
Compare
|
retest this please |
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]>
c15b35a to
d27c04b
Compare
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.
LGTM
passes linuxkm-fips-dev-insmod-cust-kernel-3-with-wolfguard and linuxkm-fips-v6-dist-insmod-cust-kernel-3-with-wolfguard, targeting RHEL 5.14.0-570.28.1.el9_6.
|
Retest this please. (reason unclear. PRB passed but got hung? the hostap failure will be unrelated and random) |
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