aboutsummaryrefslogtreecommitdiffstats
path: root/main/linux-grsec/0001-pax-x86_64-fix-copy_user_generic.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-10-23 07:42:50 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-10-23 09:03:30 +0000
commit4b0e04733d6f696392dc8ec213120e7508de88c9 (patch)
treec9ab446505acee91b4b1b12b8f9ce0fa198c4471 /main/linux-grsec/0001-pax-x86_64-fix-copy_user_generic.patch
parent244667c408c035ba504efcedc10ffac325d673d4 (diff)
downloadaports-4b0e04733d6f696392dc8ec213120e7508de88c9.tar.bz2
aports-4b0e04733d6f696392dc8ec213120e7508de88c9.tar.xz
main/linux-grsec: fix x86_64 copy_user_generic
we also remove the requirement for CAP_SYS_ADMIN for /proc/sys so we can set ip_forward in a lxcontainer
Diffstat (limited to 'main/linux-grsec/0001-pax-x86_64-fix-copy_user_generic.patch')
-rw-r--r--main/linux-grsec/0001-pax-x86_64-fix-copy_user_generic.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/main/linux-grsec/0001-pax-x86_64-fix-copy_user_generic.patch b/main/linux-grsec/0001-pax-x86_64-fix-copy_user_generic.patch
new file mode 100644
index 0000000000..da442aae39
--- /dev/null
+++ b/main/linux-grsec/0001-pax-x86_64-fix-copy_user_generic.patch
@@ -0,0 +1,40 @@
+From b8bf456d13988fb38cfe248676327f44a2d2ed2e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Wed, 23 Oct 2013 09:54:54 +0300
+Subject: [PATCH] pax: x86_64: fix copy_user_generic
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Pax patch removed r10 from clobbers list as all assembly code was
+updated to not use it. However, in the error path the assembly code
+ends up calling copy_user_handle_tail() C-function that can clobber
+r10. This broke things for certain gcc optimizations (at least for gcc
+4.8.x), as copy_user_generic() is inline function, and the inline
+assembly incorrectly guaranteed not to clobber r10.
+
+Add r10 back to clobbers list like vanilla kernel has it. It is
+needed always due to the possibly C-function call in error path.
+
+Signed-off-by: Timo Teräs <timo.teras@iki.f>
+Acked-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+ arch/x86/include/asm/uaccess_64.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
+index 1dbe82f..9d398f4 100644
+--- a/arch/x86/include/asm/uaccess_64.h
++++ b/arch/x86/include/asm/uaccess_64.h
+@@ -44,7 +44,7 @@ copy_user_generic(void *to, const void *from, unsigned len)
+ ASM_OUTPUT2("=a" (ret), "=D" (to), "=S" (from),
+ "=d" (len)),
+ "1" (to), "2" (from), "3" (len)
+- : "memory", "rcx", "r8", "r9", "r11");
++ : "memory", "rcx", "r8", "r9", "r10", "r11");
+ return ret;
+ }
+
+--
+1.8.4.1
+