commit 73d08802fdc2637b2781de39302b2f9f687ffffc
Author: Nicolas Viéville <nicolas.vieville(a)uphf.fr>
Date: Sat Oct 5 09:51:00 2024 +0200
Fix for 'index 0 is out of range for type 'uvm_gpu_chunk_t *[*]' and
uvm_page_directory_t *[*]' traces from kernel 6.8.x
Signed-off-by: Nicolas Viéville <nicolas.vieville(a)uphf.fr>
...index_0_is_out_of_range_kernel_6.8_traces.patch | 47 ++++++++++++++++++++++
1 file changed, 47 insertions(+)
---
diff --git a/nvidia-390xx-kmod-0092-fix_index_0_is_out_of_range_kernel_6.8_traces.patch
b/nvidia-390xx-kmod-0092-fix_index_0_is_out_of_range_kernel_6.8_traces.patch
new file mode 100644
index 0000000..f9d63f6
--- /dev/null
+++ b/nvidia-390xx-kmod-0092-fix_index_0_is_out_of_range_kernel_6.8_traces.patch
@@ -0,0 +1,47 @@
+From 2c7072fb5543e2be99f22682f6b561ece81dfdd6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nicolas=20Vi=C3=A9ville?= <nicolas.vieville(a)uphf.fr>
+Date: Thu, 3 Oct 2024 14:35:02 +0200
+Subject: [PATCH] Fix for 'index 0 is out of range for type 'uvm_gpu_chunk_t
+ *[*]' and uvm_page_directory_t *[*]' kernel 6.8.x traces. Suggested by:
+
https://forums.developer.nvidia.com/t/\
+ ubsan-array-index-out-of-bounds-complaints-in-newer-kernels/271705/5 Thanks
+ to Bruce Jerrick
https://bugzilla.rpmfusion.org/show_bug.cgi?id=7069
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Nicolas Viéville <nicolas.vieville(a)uphf.fr>
+---
+ kernel/nvidia-uvm/uvm8_mmu.h | 2 +-
+ kernel/nvidia-uvm/uvm8_pmm_gpu.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/kernel/nvidia-uvm/uvm8_mmu.h b/kernel/nvidia-uvm/uvm8_mmu.h
+index cddd43f..cf50c95 100644
+--- a/kernel/nvidia-uvm/uvm8_mmu.h
++++ b/kernel/nvidia-uvm/uvm8_mmu.h
+@@ -76,7 +76,7 @@ struct uvm_page_directory_struct
+
+ // pointers to child directories on the host.
+ // this array is variable length, so it needs to be last to allow it to take up
extra space
+- uvm_page_directory_t *entries[0];
++ uvm_page_directory_t *entries[];
+ };
+
+ struct uvm_mmu_mode_hal_struct
+diff --git a/kernel/nvidia-uvm/uvm8_pmm_gpu.c b/kernel/nvidia-uvm/uvm8_pmm_gpu.c
+index 602a286..6f0857e 100644
+--- a/kernel/nvidia-uvm/uvm8_pmm_gpu.c
++++ b/kernel/nvidia-uvm/uvm8_pmm_gpu.c
+@@ -209,7 +209,7 @@ struct uvm_pmm_gpu_chunk_suballoc_struct
+ // Array of all child subchunks
+ // TODO: Bug 1765461: Can the array be inlined? It could save the parent
+ // pointer.
+- uvm_gpu_chunk_t *subchunks[0];
++ uvm_gpu_chunk_t *subchunks[];
+ };
+
+ typedef enum
+--
+2.46.2
+