[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a5766188-11d4-44f2-ae5b-8398260809d8@gigawatt.nl>
Date: Mon, 11 Sep 2023 00:33:03 +0100
From: Harald van Dijk <harald@...awatt.nl>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Andy Lutomirski <luto@...nel.org>, Rich Felker <dalias@...c.org>,
linux-x86_64@...r.kernel.org, Florian Weimer <fweimer@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
X86 ML <x86@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
Jessica Clarke <jrtc27@...c27.com>
Subject: [PATCH 1/2] uapi: Stop using __kernel_long_t in struct msgbuf
struct msgbuf is mostly an internal type: msgsnd and msgrcv have always
been documented as taking a pointer to a user-defined type starting with
a field of type long. __kernel_long_t is the same as long for all
platforms other than x32, almost all code out there using msgsnd and
msgrcv uses them as documented, and it is impossible to simultaneously
support existing binaries that use the documented API and existing
binaries that use the implemented API. This change breaks existing x32
binaries that use the implemented API, and fixes existing x32 binaries
that use the documented API.
This reverts commit 443d5670f77aab121cb95f45da60f0aad390bcb5.
Signed-off-by: Harald van Dijk <harald@...awatt.nl>
Cc: stable@...nel.org
---
arch/x86/entry/syscalls/syscall_64.tbl | 6 ++++--
include/uapi/linux/msg.h | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl
index 1d6eee30eceb2..f5d81fe2c94ca 100644
--- a/arch/x86/entry/syscalls/syscall_64.tbl
+++ b/arch/x86/entry/syscalls/syscall_64.tbl
@@ -77,8 +77,10 @@
66 common semctl sys_semctl
67 common shmdt sys_shmdt
68 common msgget sys_msgget
-69 common msgsnd sys_msgsnd
-70 common msgrcv sys_msgrcv
+69 64 msgsnd sys_msgsnd
+69 x32 msgsnd compat_sys_msgsnd
+70 64 msgrcv sys_msgrcv
+70 x32 msgrcv compat_sys_msgrcv
71 common msgctl sys_msgctl
72 common fcntl sys_fcntl
73 common flock sys_flock
diff --git a/include/uapi/linux/msg.h b/include/uapi/linux/msg.h
index 01ee8d54c1c8a..3881c94d48eae 100644
--- a/include/uapi/linux/msg.h
+++ b/include/uapi/linux/msg.h
@@ -36,7 +36,7 @@ struct msqid_ds {
/* message buffer for msgsnd and msgrcv calls */
struct msgbuf {
- __kernel_long_t mtype; /* type of message */
+ long mtype; /* type of message */
char mtext[1]; /* message text */
};
--
2.34.1
Powered by blists - more mailing lists