All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] parisc: Fix struct ipc64_perm to use userspace-clean types
@ 2015-10-28 22:27 Helge Deller
  0 siblings, 0 replies; only message in thread
From: Helge Deller @ 2015-10-28 22:27 UTC (permalink / raw)
  To: linux-parisc, James Bottomley, John David Anglin

The current implementation is just wrong. It should not use standard
types like uid_t which may be different if used with 32 or 64bit
userspace. Instead use the __kernel_* types which do not pollute
userspace.

This change fixes build errors like for the trinity debian package.

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/arch/parisc/include/uapi/asm/ipcbuf.h b/arch/parisc/include/uapi/asm/ipcbuf.h
index bd956c4..53472bc4 100644
--- a/arch/parisc/include/uapi/asm/ipcbuf.h
+++ b/arch/parisc/include/uapi/asm/ipcbuf.h
@@ -1,6 +1,8 @@
 #ifndef __PARISC_IPCBUF_H__
 #define __PARISC_IPCBUF_H__
 
+#include <linux/posix_types.h>
+
 /*
  * The ipc64_perm structure for PA-RISC is almost identical to
  * kern_ipc_perm as we have always had 32-bit UIDs and GIDs in the kernel.
@@ -10,16 +12,17 @@
 
 struct ipc64_perm
 {
-	key_t           key;
-	uid_t           uid;
-	gid_t           gid;
-	uid_t           cuid;
-	gid_t           cgid;
-	unsigned short int	__pad1;
-	mode_t          mode;
+	__kernel_key_t		key;
+	__kernel_uid_t		uid;
+	__kernel_gid_t		gid;
+	__kernel_uid_t		cuid;
+	__kernel_gid_t		cgid;
+				/* pad if mode_t is u16: */
+	unsigned char		__pad1[4 - sizeof(__kernel_mode_t)];
+	__kernel_mode_t		mode;
 	unsigned short int	__pad2;
 	unsigned short int	seq;
-	unsigned int	__pad3;
+	unsigned int		__pad3;
 	unsigned long long int __unused1;
 	unsigned long long int __unused2;
 };

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-28 22:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-28 22:27 [PATCH] parisc: Fix struct ipc64_perm to use userspace-clean types Helge Deller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.