summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@gentoo.org>2012-08-29 03:41:50 +0000
committerDoug Goldstein <cardoe@gentoo.org>2012-08-29 03:41:50 +0000
commitdbc875de125e0605f779b1655e4ab5ab4bc44833 (patch)
treee3400a773071ad19d573e633dc66a2c6dc9fd681 /x11-drivers
parentRemove older stables, bug #433092 (diff)
downloadgentoo-2-dbc875de125e0605f779b1655e4ab5ab4bc44833.tar.gz
gentoo-2-dbc875de125e0605f779b1655e4ab5ab4bc44833.tar.bz2
gentoo-2-dbc875de125e0605f779b1655e4ab5ab4bc44833.zip
Use Stefan Reimer <it@startux.de> Quark's overlay patches for PAX hacks by popular demand. bug #385837.
(Portage version: 2.1.11.9/cvs/Linux x86_64)
Diffstat (limited to 'x11-drivers')
-rw-r--r--x11-drivers/nvidia-drivers/ChangeLog8
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch17
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch54
-rw-r--r--x11-drivers/nvidia-drivers/metadata.xml1
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-304.43.ebuild13
5 files changed, 90 insertions, 3 deletions
diff --git a/x11-drivers/nvidia-drivers/ChangeLog b/x11-drivers/nvidia-drivers/ChangeLog
index 1ffdda67d08a..ffddd285247f 100644
--- a/x11-drivers/nvidia-drivers/ChangeLog
+++ b/x11-drivers/nvidia-drivers/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for x11-drivers/nvidia-drivers
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.390 2012/08/28 23:05:39 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.391 2012/08/29 03:41:50 cardoe Exp $
+
+ 29 Aug 2012; Doug Goldstein <cardoe@gentoo.org> nvidia-drivers-304.43.ebuild,
+ +files/nvidia-drivers-pax-const.patch,
+ +files/nvidia-drivers-pax-usercopy.patch:
+ Use Stefan Reimer <it@startux.de> Quark's overlay patches for PAX hacks by
+ popular demand. bug #385837.
*nvidia-drivers-304.43 (28 Aug 2012)
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch
new file mode 100644
index 000000000000..f3b82593570e
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch
@@ -0,0 +1,17 @@
+Binary files kernel.orig/.nv-procfs.c.swp and kernel/.nv-procfs.c.swp differ
+diff -urp kernel.orig/nv-procfs.c kernel/nv-procfs.c
+--- kernel.orig/nv-procfs.c 2011-07-13 03:29:30.000000000 +0200
++++ kernel/nv-procfs.c 2011-07-19 15:45:27.982993911 +0200
+@@ -707,8 +707,10 @@ int nv_register_procfs(void)
+ * However, in preparation for this, we need to preserve
+ * the procfs read() and write() operations.
+ */
+- nv_procfs_registry_fops.read = entry->proc_fops->read;
+- nv_procfs_registry_fops.write = entry->proc_fops->write;
++ pax_open_kernel();
++ *(void **)&nv_procfs_registry_fops.read = entry->proc_fops->read;
++ *(void **)&nv_procfs_registry_fops.write = entry->proc_fops->write;
++ pax_close_kernel();
+
+ entry = NV_CREATE_PROC_FILE("registry", proc_nvidia,
+ nv_procfs_read_registry,
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch
new file mode 100644
index 000000000000..ce8c201b8e05
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch
@@ -0,0 +1,54 @@
+diff -urp kernel.orig/nv.c kernel/nv.c
+--- kernel.orig/nv.c 2011-09-24 02:32:09.000000000 +0200
++++ kernel/nv.c 2011-10-05 19:13:41.474242252 +0200
+@@ -1105,7 +1105,7 @@ static int __init nvidia_init_module(voi
+ 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");
+@@ -1220,7 +1220,7 @@ static int __init nvidia_init_module(voi
+ }
+ #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;
+@@ -1229,7 +1229,7 @@ static int __init nvidia_init_module(voi
+ }
+
+ NV_KMEM_CACHE_CREATE(nvidia_p2p_page_t_cache, "nvidia_p2p_page_t",
+- nvidia_p2p_page_t);
++ nvidia_p2p_page_t, 0);
+ if (nvidia_p2p_page_t_cache == NULL)
+ {
+ rc = -ENOMEM;
+diff -urp kernel.orig/nv-linux.h kernel/nv-linux.h
+--- kernel.orig/nv-linux.h 2011-09-24 02:32:09.000000000 +0200
++++ kernel/nv-linux.h 2011-10-05 19:14:42.522238996 +0200
+@@ -695,16 +695,16 @@ extern nv_spinlock_t km_lock;
+
+ #if defined(NV_KMEM_CACHE_CREATE_PRESENT)
+ #if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 6)
+-#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, NULL); \
++ 0, flags, 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!"
diff --git a/x11-drivers/nvidia-drivers/metadata.xml b/x11-drivers/nvidia-drivers/metadata.xml
index 1a54b153e9b4..f60e0ea72e38 100644
--- a/x11-drivers/nvidia-drivers/metadata.xml
+++ b/x11-drivers/nvidia-drivers/metadata.xml
@@ -21,5 +21,6 @@
<flag name='tools'>Installs additional tools such as nvidia-settings</flag>
<flag name='X'>Controls whether the X.org driver, OpenGL libraries,
XvMC libraries, and VDPAU libraries are installed</flag>
+ <flag name='pax_kernel'>PaX patches from the PaX project</flag>
</use>
</pkgmetadata>
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-304.43.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-304.43.ebuild
index 6cdfc5ba8daf..0e29f9b0e69c 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-304.43.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-304.43.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-304.43.ebuild,v 1.1 2012/08/28 23:05:39 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-304.43.ebuild,v 1.2 2012/08/29 03:41:50 cardoe Exp $
EAPI=4
@@ -22,7 +22,7 @@ SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_P
LICENSE="NVIDIA"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
-IUSE="acpi multilib kernel_FreeBSD kernel_linux +tools +X"
+IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools +X"
RESTRICT="strip"
EMULTILIB_PKG="true"
@@ -139,6 +139,15 @@ src_prepare() {
# If greater than 2.6.5 use M= instead of SUBDIR=
convert_to_m "${NV_SRC}"/Makefile.kbuild
fi
+
+ if use pax_kernel; then
+ ewarn "Using PAX patches is not supported. You will be asked to"
+ ewarn "use a standard kernel should you have issues. Should you"
+ ewarn "need support with these patches, contact the PaX team."
+ epatch "${FILESDIR}"/nvidia-drivers-pax-const.patch
+ epatch "${FILESDIR}"/nvidia-drivers-pax-usercopy.patch
+ fi
+
cat <<- EOF > "${S}"/nvidia.icd
/usr/$(get_libdir)/libnvidia-opencl.so
EOF