[RFC] [PATCH] sys_shmat for 64-bits in 32-bit compat mode

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

 



Hello all,

I would like you to comment the following patch. At the some moment, I
was faced to problem with syscall sys_shmat in 32-bit mode on 64-bit
platforms. I have fixed the function in the same manner as native
sys_shmat had been: sys_shmat expects pointer to memory as the return
value rather than put_user'ed to the memory pointed by 3rd parameter.

Signed-off-by: dmitry pervushin <dpervushin@xxxxxxxxxxxxx>
 arch/mips/kernel/linux32.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

Index: linux-mips/arch/mips/kernel/linux32.c
===================================================================
--- linux-mips.orig/arch/mips/kernel/linux32.c
+++ linux-mips/arch/mips/kernel/linux32.c
@@ -36,6 +36,7 @@
 #include <linux/security.h>
 #include <linux/compat.h>
 #include <linux/vfs.h>
+#include <linux/ptrace.h>
 
 #include <net/sock.h>
 #include <net/scm.h>
@@ -978,7 +979,8 @@ asmlinkage long sys32_shmat(int shmid, c
 	if (err)
 		return err;
 
-	return put_user(raddr, addr);
+	force_successful_syscall_return();
+	return raddr;
 }
 
 struct sysctl_args32




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

  Powered by Linux