summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'x11-drivers/nvidia-drivers/files/173.14.39-grsecurity.patch')
-rw-r--r--x11-drivers/nvidia-drivers/files/173.14.39-grsecurity.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/x11-drivers/nvidia-drivers/files/173.14.39-grsecurity.patch b/x11-drivers/nvidia-drivers/files/173.14.39-grsecurity.patch
new file mode 100644
index 00000000..7c9e60d3
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/173.14.39-grsecurity.patch
@@ -0,0 +1,47 @@
+--- 1/usr/src/nv/nv-linux.h
++++ 1/usr/src/nv/nv-linux.h
+@@ -668,10 +668,10 @@
+ 0, 0, NULL, NULL); \
+ }
+ #elif (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5)
+-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \
++#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \
+ { \
+ kmem_cache = kmem_cache_create(name, sizeof(type), \
+- 0, 0, NULL); \
++ 0, flags, NULL); \
+ }
+ #else
+ #error "NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT value unrecognized!"
+--- 1/usr/src/nv/nv.c
++++ 1/usr/src/nv/nv.c
+@@ -389,7 +389,11 @@
+
+ /* character driver entry points */
+
++#ifndef __no_const
+ static struct file_operations nv_fops = {
++#else
++static file_operations_no_const nv_fops = {
++#endif
+ .owner = THIS_MODULE,
+ .poll = nv_kern_poll,
+ #if defined(NV_FILE_OPERATIONS_HAS_IOCTL)
+@@ -1377,7 +1381,7 @@
+ NV_SPIN_LOCK_INIT(&km_lock);
+ #endif
+
+- NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t);
++ NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t, SLAB_USERCOPY);
+ if (nv_stack_t_cache == NULL)
+ {
+ nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
+@@ -1499,7 +1503,7 @@
+ }
+ #endif
+
+- NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t);
++ NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t, 0);
+ if (nv_pte_t_cache == NULL)
+ {
+ rc = -ENOMEM;