1 |
cardoe 12/08/29 03:41:51 |
2 |
|
3 |
Added: nvidia-drivers-pax-usercopy.patch |
4 |
nvidia-drivers-pax-const.patch |
5 |
Log: |
6 |
Use Stefan Reimer <it@×××××××.de> Quark's overlay patches for PAX hacks by popular demand. bug #385837. |
7 |
|
8 |
(Portage version: 2.1.11.9/cvs/Linux x86_64) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: nvidia-drivers-pax-usercopy.patch |
17 |
=================================================================== |
18 |
diff -urp kernel.orig/nv.c kernel/nv.c |
19 |
--- kernel.orig/nv.c 2011-09-24 02:32:09.000000000 +0200 |
20 |
+++ kernel/nv.c 2011-10-05 19:13:41.474242252 +0200 |
21 |
@@ -1105,7 +1105,7 @@ static int __init nvidia_init_module(voi |
22 |
NV_SPIN_LOCK_INIT(&km_lock); |
23 |
#endif |
24 |
|
25 |
- NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t); |
26 |
+ NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t, SLAB_USERCOPY); |
27 |
if (nv_stack_t_cache == NULL) |
28 |
{ |
29 |
nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n"); |
30 |
@@ -1220,7 +1220,7 @@ static int __init nvidia_init_module(voi |
31 |
} |
32 |
#endif |
33 |
|
34 |
- NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t); |
35 |
+ NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t, 0); |
36 |
if (nv_pte_t_cache == NULL) |
37 |
{ |
38 |
rc = -ENOMEM; |
39 |
@@ -1229,7 +1229,7 @@ static int __init nvidia_init_module(voi |
40 |
} |
41 |
|
42 |
NV_KMEM_CACHE_CREATE(nvidia_p2p_page_t_cache, "nvidia_p2p_page_t", |
43 |
- nvidia_p2p_page_t); |
44 |
+ nvidia_p2p_page_t, 0); |
45 |
if (nvidia_p2p_page_t_cache == NULL) |
46 |
{ |
47 |
rc = -ENOMEM; |
48 |
diff -urp kernel.orig/nv-linux.h kernel/nv-linux.h |
49 |
--- kernel.orig/nv-linux.h 2011-09-24 02:32:09.000000000 +0200 |
50 |
+++ kernel/nv-linux.h 2011-10-05 19:14:42.522238996 +0200 |
51 |
@@ -695,16 +695,16 @@ extern nv_spinlock_t km_lock; |
52 |
|
53 |
#if defined(NV_KMEM_CACHE_CREATE_PRESENT) |
54 |
#if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 6) |
55 |
-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \ |
56 |
+#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \ |
57 |
{ \ |
58 |
kmem_cache = kmem_cache_create(name, sizeof(type), \ |
59 |
- 0, 0, NULL, NULL); \ |
60 |
+ 0, flags, NULL, NULL); \ |
61 |
} |
62 |
#elif (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5) |
63 |
-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \ |
64 |
+#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \ |
65 |
{ \ |
66 |
kmem_cache = kmem_cache_create(name, sizeof(type), \ |
67 |
- 0, 0, NULL); \ |
68 |
+ 0, flags, NULL); \ |
69 |
} |
70 |
#else |
71 |
#error "NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT value unrecognized!" |
72 |
|
73 |
|
74 |
|
75 |
1.1 x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch |
76 |
|
77 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch?rev=1.1&view=markup |
78 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch?rev=1.1&content-type=text/plain |
79 |
|
80 |
Index: nvidia-drivers-pax-const.patch |
81 |
=================================================================== |
82 |
Binary files kernel.orig/.nv-procfs.c.swp and kernel/.nv-procfs.c.swp differ |
83 |
diff -urp kernel.orig/nv-procfs.c kernel/nv-procfs.c |
84 |
--- kernel.orig/nv-procfs.c 2011-07-13 03:29:30.000000000 +0200 |
85 |
+++ kernel/nv-procfs.c 2011-07-19 15:45:27.982993911 +0200 |
86 |
@@ -707,8 +707,10 @@ int nv_register_procfs(void) |
87 |
* However, in preparation for this, we need to preserve |
88 |
* the procfs read() and write() operations. |
89 |
*/ |
90 |
- nv_procfs_registry_fops.read = entry->proc_fops->read; |
91 |
- nv_procfs_registry_fops.write = entry->proc_fops->write; |
92 |
+ pax_open_kernel(); |
93 |
+ *(void **)&nv_procfs_registry_fops.read = entry->proc_fops->read; |
94 |
+ *(void **)&nv_procfs_registry_fops.write = entry->proc_fops->write; |
95 |
+ pax_close_kernel(); |
96 |
|
97 |
entry = NV_CREATE_PROC_FILE("registry", proc_nvidia, |
98 |
nv_procfs_read_registry, |