shm ipc broken

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The attached patch fixes a problem with shm ipc. The structs ipc_perm in
/u/i/bits/ipc.h and ipc64_perm in include/asm/ipcbuf.h had different sizes
and so caused the copy_shminfo_to_user in ipc/shm.c to corrupt user space(the
kernel structure was 8 bytes larger). This is probably not the correct fix,
since the other arches have this padding, so maybe glibc must be fixed.
There's still a small problem since shm_nattch is a short in glibc and a long
in the kernel, so the attach-numbers are wrong(which I'm also not sure where
it has to be fixed).  
 -- Guido

P.S.: this fixes the X server crashes some people were seeing.
--- include/asm-mips/ipcbuf.h.orig	Sun Apr 29 19:55:41 2001
+++ include/asm-mips/ipcbuf.h	Sun Apr 29 20:23:00 2001
@@ -2,13 +2,12 @@
 #define _ASM_IPCBUF_H
 
 /* 
- * The ipc64_perm structure for alpha architecture.
+ * The ipc64_perm structure for mips architecture.
  * Note extra padding because this structure is passed back and forth
  * between kernel and user space.
  *
  * Pad space is left for:
  * - 32-bit seq
- * - 2 miscellaneous 64-bit values
  */
 
 struct ipc64_perm
@@ -21,8 +20,6 @@
 	__kernel_mode_t	mode; 
 	unsigned short	seq;
 	unsigned short	__pad1;
-	unsigned long	__unused1;
-	unsigned long	__unused2;
 };
 
 #endif /* _ASM_IPCBUF_H */

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux