From 6419bc968389dfcbfcd7dd4ade75f54c9531b4c6 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Oct 22 2012 08:45:28 +0000 Subject: add patch to revert ARM misaligned access check to stop kernel OOPS, actually apply highbank sata patch --- diff --git a/arm-linux-3.6-revert-missaligned-access-check-on-put_user.patch b/arm-linux-3.6-revert-missaligned-access-check-on-put_user.patch new file mode 100644 index 0000000..1558066 --- /dev/null +++ b/arm-linux-3.6-revert-missaligned-access-check-on-put_user.patch @@ -0,0 +1,83 @@ +commit dd945918f747f61eff384f5cb8889e524f60615a +Author: Jon Masters +Date: Fri Oct 5 22:32:29 2012 -0400 + + Revert "ARM: 7528/1: uaccess: annotate [__]{get,put}_user functions with might_fault()" + + This reverts commit ad72907acd2943304c292ae36960bb66e6dc23c9. + + Technically, the original commit is totally correct, however it exposes + a deep-rooted problem with missaligned accesses in e.g. the networking + stack and we need to revert this (sweep under rug) until we can get + a good solution in place upstream. The problem is that the compiler + believes the structs concerned are aligned (they are in the code), + however at runtime the IP structs are actually not aligned within + received network packets, and the fault handler is not guaranteed + to be entirely atomic and free of calls to the scheduler. + + Signed-off-by: Jon Masters + +diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h +index 77bd79f..6f83ad6 100644 +--- a/arch/arm/include/asm/uaccess.h ++++ b/arch/arm/include/asm/uaccess.h +@@ -118,7 +118,7 @@ extern int __get_user_4(void *); + : "0" (__p), "r" (__l) \ + : __GUP_CLOBBER_##__s) + +-#define __get_user_check(x,p) \ ++#define get_user(x,p) \ + ({ \ + unsigned long __limit = current_thread_info()->addr_limit - 1; \ + register const typeof(*(p)) __user *__p asm("r0") = (p);\ +@@ -141,12 +141,6 @@ extern int __get_user_4(void *); + __e; \ + }) + +-#define get_user(x,p) \ +- ({ \ +- might_fault(); \ +- __get_user_check(x,p); \ +- }) +- + extern int __put_user_1(void *, unsigned int); + extern int __put_user_2(void *, unsigned int); + extern int __put_user_4(void *, unsigned int); +@@ -161,7 +155,7 @@ extern int __put_user_8(void *, unsigned long long); + : "0" (__p), "r" (__r2), "r" (__l) \ + : "ip", "lr", "cc") + +-#define __put_user_check(x,p) \ ++#define put_user(x,p) \ + ({ \ + unsigned long __limit = current_thread_info()->addr_limit - 1; \ + register const typeof(*(p)) __r2 asm("r2") = (x); \ +@@ -186,12 +180,6 @@ extern int __put_user_8(void *, unsigned long long); + __e; \ + }) + +-#define put_user(x,p) \ +- ({ \ +- might_fault(); \ +- __put_user_check(x,p); \ +- }) +- + #else /* CONFIG_MMU */ + + /* +@@ -245,7 +233,6 @@ do { \ + unsigned long __gu_addr = (unsigned long)(ptr); \ + unsigned long __gu_val; \ + __chk_user_ptr(ptr); \ +- might_fault(); \ + switch (sizeof(*(ptr))) { \ + case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break; \ + case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break; \ +@@ -327,7 +314,6 @@ do { \ + unsigned long __pu_addr = (unsigned long)(ptr); \ + __typeof__(*(ptr)) __pu_val = (x); \ + __chk_user_ptr(ptr); \ +- might_fault(); \ + switch (sizeof(*(ptr))) { \ + case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break; \ + case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break; \ diff --git a/kernel.spec b/kernel.spec index cc60adb..ea14cb2 100644 --- a/kernel.spec +++ b/kernel.spec @@ -733,6 +733,7 @@ Patch19001: i82975x-edac-fix.patch Patch21000: arm-read_current_timer.patch Patch21001: arm-fix-omapdrm.patch Patch21002: arm-fix_radio_shark.patch +Patch21003: arm-linux-3.6-revert-missaligned-access-check-on-put_user.patch # OMAP # ARM tegra @@ -747,10 +748,6 @@ Patch21010: arm-highbank-sata-fix.patch Patch21020: arm-smdk310-regulator-fix.patch Patch21021: arm-origen-regulator-fix.patch -# ARM exynos4 -Patch21020: arm-smdk310-regulator-fix.patch -Patch21021: arm-origen-regulator-fix.patch - Patch21094: power-x86-destdir.patch #rhbz 754518 @@ -1356,10 +1353,8 @@ ApplyPatch arm-fix_radio_shark.patch ApplyPatch arm-tegra-nvec-kconfig.patch ApplyPatch arm-tegra-usb-no-reset-linux33.patch ApplyPatch arm-tegra-sdhci-module-fix.patch - -ApplyPatch arm-smdk310-regulator-fix.patch -ApplyPatch arm-origen-regulator-fix.patch - +ApplyPatch arm-highbank-sata-fix.patch +ApplyPatch arm-linux-3.6-revert-missaligned-access-check-on-put_user.patch ApplyPatch arm-smdk310-regulator-fix.patch ApplyPatch arm-origen-regulator-fix.patch @@ -2353,6 +2348,10 @@ fi # ||----w | # || || %changelog +* Mon Oct 22 2012 Peter Robinson +- Revert ARM misaligned access check to stop kernel OOPS +- Actually apply highbank sata patch + * Thu Oct 18 2012 Josh Boyer - Patch to have mac80211 connect with HT20 if HT40 is not allowed (rhbz 866013) - Enable VFIO (rhbz 867152)