Skip to content

Commit

Permalink
sparc32: fix struct ipc64_perm type definition
Browse files Browse the repository at this point in the history
[ Upstream commit 34ca70e ]

As discussed in the strace issue tracker, it appears that the sparc32
sysvipc support has been broken for the past 11 years. It was however
working in compat mode, which is how it must have escaped most of the
regular testing.

The problem is that a cleanup patch inadvertently changed the uid/gid
fields in struct ipc64_perm from 32-bit types to 16-bit types in uapi
headers.

Both glibc and uclibc-ng still use the original types, so they should
work fine with compat mode, but not natively.  Change the definitions
to use __kernel_uid32_t and __kernel_gid32_t again.

Fixes: 83c8698 ("sparc: unify ipcbuf.h")
Link: strace/strace#116
Cc: <[email protected]> # v2.6.29
Cc: Sam Ravnborg <[email protected]>
Cc: "Dmitry V . Levin" <[email protected]>
Cc: Rich Felker <[email protected]>
Cc: [email protected]
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
arndb authored and gregkh committed Feb 11, 2020
1 parent 9940e10 commit 9e15475
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions arch/sparc/include/uapi/asm/ipcbuf.h
Original file line number Diff line number Diff line change
@@ -15,19 +15,19 @@

struct ipc64_perm
{
__kernel_key_t key;
__kernel_uid_t uid;
__kernel_gid_t gid;
__kernel_uid_t cuid;
__kernel_gid_t cgid;
__kernel_key_t key;
__kernel_uid32_t uid;
__kernel_gid32_t gid;
__kernel_uid32_t cuid;
__kernel_gid32_t cgid;
#ifndef __arch64__
unsigned short __pad0;
unsigned short __pad0;
#endif
__kernel_mode_t mode;
unsigned short __pad1;
unsigned short seq;
unsigned long long __unused1;
unsigned long long __unused2;
__kernel_mode_t mode;
unsigned short __pad1;
unsigned short seq;
unsigned long long __unused1;
unsigned long long __unused2;
};

#endif /* __SPARC_IPCBUF_H */

0 comments on commit 9e15475

Please sign in to comment.