From: Ism Hong <ism.hong@gmail.com>
Cc: "Ism Hong" <ism.hong@gmail.com>,
"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
"Arnd Bergmann" <arnd@arndb.de>,
"Christian Brauner" <brauner@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Heiko Carstens" <hca@linux.ibm.com>,
"Jeff Xu" <jeffxu@chromium.org>,
"Christian Göttsche" <cgzones@googlemail.com>,
linux-mips@vger.kernel.org (open list:MIPS),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] mips: fix shmctl/semctl/msgctl syscall for o32
Date: Mon, 6 Jan 2025 19:52:27 +0800 [thread overview]
Message-ID: <20250106115227.1365643-1-ism.hong@gmail.com> (raw)
The commit 275f22148e87 ("ipc: rename old-style shmctl/semctl/msgctl
syscalls") switched various architectures to use sys_old_*ctl() with
ipc_parse_version, including mips n32/n64. However, for mips o32, commit
0d6040d46817 ("arch: add split IPC system calls where needed") added
separate IPC syscalls without properly using the old-style handlers.
This causes applications using uClibc-ng to fail with -EINVAL when
calling semctl/shmctl/msgctl with IPC_64 flag, as uClibc-ng uses the
syscall numbers from kernel headers to determine whether to use the IPC
multiplexer or split syscalls. In contrast, glibc is unaffected as it
uses a unified feature test macro __ASSUME_DIRECT_SYSVIPC_SYSCALLS
(disabled for mips-o32) to make this decision.
Fix this by switching the o32 ABI entries for semctl, shmctl and msgctl
to use the old-style handlers, matching the behavior of other
architectures and fixing compatibility with uClibc-ng.
Signed-off-by: Ism Hong <ism.hong@gmail.com>
---
arch/mips/kernel/syscalls/syscall_o32.tbl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/mips/kernel/syscalls/syscall_o32.tbl b/arch/mips/kernel/syscalls/syscall_o32.tbl
index 349b8aad1159..e8a57c206758 100644
--- a/arch/mips/kernel/syscalls/syscall_o32.tbl
+++ b/arch/mips/kernel/syscalls/syscall_o32.tbl
@@ -382,15 +382,15 @@
368 o32 io_pgetevents sys_io_pgetevents_time32 compat_sys_io_pgetevents
# room for arch specific calls
393 o32 semget sys_semget
-394 o32 semctl sys_semctl compat_sys_semctl
+394 o32 semctl sys_old_semctl compat_sys_old_semctl
395 o32 shmget sys_shmget
-396 o32 shmctl sys_shmctl compat_sys_shmctl
+396 o32 shmctl sys_old_shmctl compat_sys_old_shmctl
397 o32 shmat sys_shmat compat_sys_shmat
398 o32 shmdt sys_shmdt
399 o32 msgget sys_msgget
400 o32 msgsnd sys_msgsnd compat_sys_msgsnd
401 o32 msgrcv sys_msgrcv compat_sys_msgrcv
-402 o32 msgctl sys_msgctl compat_sys_msgctl
+402 o32 msgctl sys_old_msgctl compat_sys_old_msgctl
403 o32 clock_gettime64 sys_clock_gettime sys_clock_gettime
404 o32 clock_settime64 sys_clock_settime sys_clock_settime
405 o32 clock_adjtime64 sys_clock_adjtime sys_clock_adjtime
--
2.37.2
next reply other threads:[~2025-01-06 11:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-06 11:52 Ism Hong [this message]
2025-01-27 21:20 ` [PATCH] mips: fix shmctl/semctl/msgctl syscall for o32 Arnd Bergmann
2025-01-30 8:55 ` Thomas Bogendoerfer
2025-01-30 14:46 ` Ism Hong
2025-01-30 20:31 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250106115227.1365643-1-ism.hong@gmail.com \
--to=ism.hong@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=brauner@kernel.org \
--cc=cgzones@googlemail.com \
--cc=hca@linux.ibm.com \
--cc=jeffxu@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=tsbogend@alpha.franken.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox