提交 b610c04c 编写于 作者: W Will Deacon 提交者: Linus Torvalds

ipc: allow compat IPC version field parsing if !ARCH_WANT_OLD_COMPAT_IPC

Commit 48b25c43 ("ipc: provide generic compat versions of IPC
syscalls") added a new ARCH_WANT_OLD_COMPAT_IPC config option for
architectures to select if their compat target requires the old IPC
syscall interface.

For architectures (such as AArch64) that do not require the internal
calling conventions provided by this option, but have a compat target
where the C library passes the IPC_64 flag explicitly,
compat_ipc_parse_version no longer strips out the flag before calling
the native system call implementation, resulting in unknown SHM/IPC
commands and -EINVAL being returned to userspace.

This patch separates the selection of the internal calling conventions
for the IPC syscalls from the version parsing, allowing architectures to
select __ARCH_WANT_COMPAT_IPC_PARSE_VERSION if they want to use version
parsing whilst retaining the newer syscall calling conventions.
Acked-by: NChris Metcalf <cmetcalf@tilera.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 079a96ae
...@@ -256,6 +256,7 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, ...@@ -256,6 +256,7 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
compat_size_t __user *len_ptr); compat_size_t __user *len_ptr);
#ifdef CONFIG_ARCH_WANT_OLD_COMPAT_IPC #ifdef CONFIG_ARCH_WANT_OLD_COMPAT_IPC
#define __ARCH_WANT_COMPAT_IPC_PARSE_VERSION
long compat_sys_semctl(int first, int second, int third, void __user *uptr); long compat_sys_semctl(int first, int second, int third, void __user *uptr);
long compat_sys_msgsnd(int first, int second, int third, void __user *uptr); long compat_sys_msgsnd(int first, int second, int third, void __user *uptr);
long compat_sys_msgrcv(int first, int second, int msgtyp, int third, long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
......
...@@ -118,7 +118,7 @@ extern int sem_ctls[]; ...@@ -118,7 +118,7 @@ extern int sem_ctls[];
static inline int compat_ipc_parse_version(int *cmd) static inline int compat_ipc_parse_version(int *cmd)
{ {
#ifdef CONFIG_ARCH_WANT_OLD_COMPAT_IPC #ifdef __ARCH_WANT_COMPAT_IPC_PARSE_VERSION
int version = *cmd & IPC_64; int version = *cmd & IPC_64;
/* this is tricky: architectures that have support for the old /* this is tricky: architectures that have support for the old
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册