Skip to content

Commit

Permalink
nvidia-utils: Adjust patch to only modify on 6.13+ kernels
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Naim <[email protected]>
  • Loading branch information
1Naim committed Dec 7, 2024
1 parent a460727 commit 2af635d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
4 changes: 2 additions & 2 deletions nvidia/nvidia-utils/.SRCINFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkgbase = nvidia-utils
pkgver = 565.77
pkgrel = 2
pkgrel = 3
url = http://www.nvidia.com/
arch = x86_64
license = custom
Expand Down Expand Up @@ -36,7 +36,7 @@ pkgbase = nvidia-utils
sha512sums = 8aa049884011d6664be04fa9f70856f56342e0e4e931858a88b96b9f628157fad3105d67626e6c71aa4ed35cf46eaf5d9020d90de508dd69761a8b559bd7c25e
sha512sums = 73f9d230142d9501ccf3efd8d40ea3b08b69fdbbdbac583df638d25efe4d8c320af3bb809ee408872c9737e123541dc3dc4e59fbeedb199e091876ef31f2a0aa
sha512sums = 919a8d00c4743147b01dbaae8792aa5f449e101bad37cfcfa7e8c4a91d5e6a042f632749f63347310902e511b9d12093e916592c15fbc9592326c773cc10c23e
sha512sums = fd9cb798c61cca51c1b3ed0ae291e42352b743da05ebdd40e419d374e62bf353540f757de0c73bc523e03c0a5ee592bc64a63970cbaad00c8819df2cd355fcca
sha512sums = f6a173aa55f75f0bfd768329a6ed9086989b53bfcacd696a3ad7f13410e374fdb5b44f4da6988df1f338cbce8bdaa0f03dc4e5780906e97c6b240ae42ee4044b
sha512sums = 7f578c4bc6ebf4694c0bd81f30aee3510910088f9eea2c49128c9b3039b4d2ce69453f1b2baf2e1639ad0c51452af744c4767fb4cc1706f072b7e09d7ac6c735

pkgname = nvidia-utils
Expand Down
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);
Expand Down
5 changes: 3 additions & 2 deletions nvidia/nvidia-utils/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
pkgbase=nvidia-utils
pkgname=('nvidia-utils' 'opencl-nvidia' 'nvidia-dkms' 'nvidia-open-dkms')
pkgver=565.77
pkgrel=2
pkgrel=3
arch=('x86_64')
url="http://www.nvidia.com/"
license=('custom')
Expand Down Expand Up @@ -44,7 +44,7 @@ sha512sums=('de7116c09f282a27920a1382df84aa86f559e537664bb30689605177ce37dc50677
'8aa049884011d6664be04fa9f70856f56342e0e4e931858a88b96b9f628157fad3105d67626e6c71aa4ed35cf46eaf5d9020d90de508dd69761a8b559bd7c25e'
'73f9d230142d9501ccf3efd8d40ea3b08b69fdbbdbac583df638d25efe4d8c320af3bb809ee408872c9737e123541dc3dc4e59fbeedb199e091876ef31f2a0aa'
'919a8d00c4743147b01dbaae8792aa5f449e101bad37cfcfa7e8c4a91d5e6a042f632749f63347310902e511b9d12093e916592c15fbc9592326c773cc10c23e'
'fd9cb798c61cca51c1b3ed0ae291e42352b743da05ebdd40e419d374e62bf353540f757de0c73bc523e03c0a5ee592bc64a63970cbaad00c8819df2cd355fcca'
'f6a173aa55f75f0bfd768329a6ed9086989b53bfcacd696a3ad7f13410e374fdb5b44f4da6988df1f338cbce8bdaa0f03dc4e5780906e97c6b240ae42ee4044b'
'7f578c4bc6ebf4694c0bd81f30aee3510910088f9eea2c49128c9b3039b4d2ce69453f1b2baf2e1639ad0c51452af744c4767fb4cc1706f072b7e09d7ac6c735')


Expand All @@ -68,6 +68,7 @@ prepare() {
# https://gitlab.archlinux.org/archlinux/packaging/packages/nvidia-utils/-/issues/14
# https://github.com/rpmfusion/nvidia-kmod/blob/master/make_modeset_default.patch
patch -Np1 < "$srcdir"/0001-Make-modeset-and-fbdev-default-enabled.patch -d "${srcdir}/${_pkg}/kernel"
patch -Np2 -i "$srcdir"/0007-6.13-Fix-for-modules-symlinking.patch -d "${srcdir}/${_pkg}/kernel"

# echo "Applying nvidia-patch..."

Expand Down

0 comments on commit 2af635d

Please sign in to comment.