-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nvidia-utils: Adjust patch to only modify on 6.13+ kernels
Signed-off-by: Eric Naim <[email protected]>
- Loading branch information
Showing
3 changed files
with
26 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
29 changes: 21 additions & 8 deletions
29
nvidia/nvidia-utils/0008-crypto-Add-fix-for-6.13-Module-compilation.patch
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,38 @@ | ||
From 1e9cf3a5e16a6037f1df63117547615cdfcebfab Mon Sep 17 00:00:00 2001 | ||
From 7197efc163d7df4522dbe254555efc97befca401 Mon Sep 17 00:00:00 2001 | ||
From: Peter Jung <[email protected]> | ||
Date: Tue, 3 Dec 2024 13:01:08 +0100 | ||
Subject: [PATCH 2/2] crypto: Add fix for 6.13 Module compilation | ||
Subject: [PATCH] crypto: Add fix for 6.13 Module compilation | ||
|
||
This maybe breaks confidental computing | ||
|
||
Signed-off-by: Peter Jung <[email protected]> | ||
Signed-off-by: Eric Naim <[email protected]> | ||
--- | ||
kernel-open/nvidia/libspdm_ecc.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
kernel-open/nvidia/libspdm_ecc.c | 6 ++++++ | ||
1 file changed, 6 insertions(+) | ||
|
||
diff --git a/kernel-open/nvidia/libspdm_ecc.c b/kernel-open/nvidia/libspdm_ecc.c | ||
index 1f8f0100..8bfcb9d4 100644 | ||
index 1f8f0100..b31901f6 100644 | ||
--- a/kernel-open/nvidia/libspdm_ecc.c | ||
+++ b/kernel-open/nvidia/libspdm_ecc.c | ||
@@ -309,7 +309,7 @@ bool lkca_ecdsa_verify(void *ec_context, size_t hash_nid, | ||
@@ -31,6 +31,8 @@ MODULE_SOFTDEP("pre: ecdh_generic,ecdsa_generic"); | ||
#include <crypto/ecdh.h> | ||
#include <crypto/internal/ecc.h> | ||
|
||
+#include <linux/version.h> | ||
+ | ||
struct ecc_ctx { | ||
unsigned int curve_id; | ||
u64 priv_key[ECC_MAX_DIGITS]; // In big endian | ||
@@ -309,7 +311,11 @@ bool lkca_ecdsa_verify(void *ec_context, size_t hash_nid, | ||
akcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG | | ||
CRYPTO_TFM_REQ_MAY_SLEEP, crypto_req_done, &wait); | ||
akcipher_request_set_crypt(req, &sg, NULL, ber_len, hash_size); | ||
- err = crypto_wait_req(crypto_akcipher_verify(req), &wait); | ||
+ err = crypto_wait_req(crypto_akcipher_encrypt(req), &wait); | ||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0) | ||
err = crypto_wait_req(crypto_akcipher_verify(req), &wait); | ||
+#else | ||
+ err = 0; | ||
+#endif | ||
|
||
if (err != 0){ | ||
pr_info("Verify FAILED %d\n", -err); | ||
|
This file contains 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