-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnvidia-390xx-kmod-0092-fix_index_0_is_out_of_range_kernel_6.8_traces.patch
47 lines (41 loc) · 1.74 KB
/
nvidia-390xx-kmod-0092-fix_index_0_is_out_of_range_kernel_6.8_traces.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 2c7072fb5543e2be99f22682f6b561ece81dfdd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20Vi=C3=A9ville?= <[email protected]>
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 <[email protected]>
---
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