[kernel] r7641 - in dists/trunk/linux-2.6/debian: . patches/bugfix/sparc patches/series

Jurij Smakov jurij-guest at costa.debian.org
Tue Oct 24 03:01:51 UTC 2006


Author: jurij-guest
Date: Tue Oct 24 03:01:51 2006
New Revision: 7641

Added:
   dists/trunk/linux-2.6/debian/patches/bugfix/sparc/compat-alloc-user-space-alignment.patch
Modified:
   dists/trunk/linux-2.6/debian/changelog
   dists/trunk/linux-2.6/debian/patches/series/4

Log:
  * [sparc] Add bugfix/sparc/compat-alloc-user-space-alignment.patch
    (thanks to David Miller) to make sure that compat_alloc_user_space()
    always returns memory aligned on a 8-byte boundary on sparc. This
    prevents a number of unaligned memory accesses, like the ones in
    sys_msgrcv() and compat_sys_msgrcv(), triggered every 5 seconds 
    whenever fakeroot is running.



Modified: dists/trunk/linux-2.6/debian/changelog
==============================================================================
--- dists/trunk/linux-2.6/debian/changelog	(original)
+++ dists/trunk/linux-2.6/debian/changelog	Tue Oct 24 03:01:51 2006
@@ -9,6 +9,12 @@
   * [sparc] Add bugfix/sparc/sunblade-clock-hang.patch, fixing the
     boot-time crash during clock probing on SunBlade 100/150 due to
     incorrect mapping of PCI resources. (closes: #392078)
+  * [sparc] Add bugfix/sparc/compat-alloc-user-space-alignment.patch
+    (thanks to David Miller) to make sure that compat_alloc_user_space()
+    always returns memory aligned on a 8-byte boundary on sparc. This
+    prevents a number of unaligned memory accesses, like the ones in
+    sys_msgrcv() and compat_sys_msgrcv(), triggered every 5 seconds whenever
+    fakeroot is running.
 
  -- Norbert Tretkowski <nobse at debian.org>  Sat, 21 Oct 2006 18:52:12 +0200
 

Added: dists/trunk/linux-2.6/debian/patches/bugfix/sparc/compat-alloc-user-space-alignment.patch
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/sparc/compat-alloc-user-space-alignment.patch	Tue Oct 24 03:01:51 2006
@@ -0,0 +1,42 @@
+commit a94b1d1fd7ca3129e1d38d38167779fa6ee69780
+Author: David S. Miller <davem at sunset.davemloft.net>
+Date:   Sun Oct 22 21:53:30 2006 -0700
+
+    [SPARC64]: 8-byte align return value from compat_alloc_user_space()
+    
+    Otherwise we get a ton of unaligned exceptions, for cases such
+    as compat_sys_msgrcv() which go:
+    
+    	p = compat_alloc_user_space(second + sizeof(struct msgbuf));
+    
+    and here 'second' can for example be an arbitrary odd value.
+    
+    Based upon a bug report from Jurij Smakov.
+    
+    Signed-off-by: David S. Miller <davem at davemloft.net>
+
+diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h
+index c73935d..36511ca 100644
+--- a/include/asm-sparc64/compat.h
++++ b/include/asm-sparc64/compat.h
+@@ -164,7 +164,7 @@ static inline compat_uptr_t ptr_to_compa
+ 	return (u32)(unsigned long)uptr;
+ }
+ 
+-static __inline__ void __user *compat_alloc_user_space(long len)
++static inline void __user *compat_alloc_user_space(long len)
+ {
+ 	struct pt_regs *regs = current_thread_info()->kregs;
+ 	unsigned long usp = regs->u_regs[UREG_I6];
+@@ -174,7 +174,10 @@ static __inline__ void __user *compat_al
+ 	else
+ 		usp &= 0xffffffffUL;
+ 
+-	return (void __user *) (usp - len);
++	usp -= len;
++	usp &= ~0x7UL;
++
++	return (void __user *) usp;
+ }
+ 
+ struct compat_ipc64_perm {

Modified: dists/trunk/linux-2.6/debian/patches/series/4
==============================================================================
--- dists/trunk/linux-2.6/debian/patches/series/4	(original)
+++ dists/trunk/linux-2.6/debian/patches/series/4	Tue Oct 24 03:01:51 2006
@@ -1,2 +1,3 @@
 - sparc64-atyfb-xl-gr.patch
 + bugfix/sparc/sunblade-clock-hang.patch
++ bugfix/sparc/compat-alloc-user-space-alignment.patch



More information about the Kernel-svn-changes mailing list