[RFC PATCH V3 25/43] rv64ilp32_abi: exec: Adapt 64lp64 env and argv

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

 



From: "Guo Ren (Alibaba DAMO Academy)" <guoren@xxxxxxxxxx>

The rv64ilp32 abi reuses the env and argv memory layout of the
lp64 abi, so leave the space to fit the lp64 struct layout.

Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@xxxxxxxxxx>
---
 fs/exec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/exec.c b/fs/exec.c
index 506cd411f4ac..548d18b7ae92 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -424,6 +424,10 @@ static const char __user *get_user_arg_ptr(struct user_arg_ptr argv, int nr)
 	}
 #endif
 
+#if defined(CONFIG_64BIT) && (BITS_PER_LONG == 32)
+	nr = nr * 2;
+#endif
+
 	if (get_user(native, argv.ptr.native + nr))
 		return ERR_PTR(-EFAULT);
 
-- 
2.40.1





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux