* [PATCH] arm64: uid16: fix __kernel_old_{gid,uid}_t definitions
@ 2014-06-02 10:47 Will Deacon
2014-06-02 11:45 ` Arnd Bergmann
0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2014-06-02 10:47 UTC (permalink / raw)
To: linux-arm-kernel
Whilst native arm64 applications don't have the 16-bit UID/GID syscalls
wired up, compat tasks can still access them. The 16-bit wrappers for
these syscalls use __kernel_old_uid_t and __kernel_old_gid_t, which must
be 16-bit data types to maintain compatibility with the 16-bit UIDs used
by compat applications.
This patch defines 16-bit __kernel_old_{gid,uid}_t types for arm64
instead of using the 32-bit types provided by asm-generic.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm64/include/asm/Kbuild | 1 -
arch/arm64/include/uapi/asm/posix_types.h | 10 ++++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
create mode 100644 arch/arm64/include/uapi/asm/posix_types.h
diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild
index 83f71b3004a8..f06a9c2d399e 100644
--- a/arch/arm64/include/asm/Kbuild
+++ b/arch/arm64/include/asm/Kbuild
@@ -30,7 +30,6 @@ generic-y += msgbuf.h
generic-y += mutex.h
generic-y += pci.h
generic-y += poll.h
-generic-y += posix_types.h
generic-y += preempt.h
generic-y += resource.h
generic-y += rwsem.h
diff --git a/arch/arm64/include/uapi/asm/posix_types.h b/arch/arm64/include/uapi/asm/posix_types.h
new file mode 100644
index 000000000000..7985ff60ca3f
--- /dev/null
+++ b/arch/arm64/include/uapi/asm/posix_types.h
@@ -0,0 +1,10 @@
+#ifndef __ASM_POSIX_TYPES_H
+#define __ASM_POSIX_TYPES_H
+
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+#define __kernel_old_uid_t __kernel_old_uid_t
+
+#include <asm-generic/posix_types.h>
+
+#endif /* __ASM_POSIX_TYPES_H */
--
1.9.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] arm64: uid16: fix __kernel_old_{gid,uid}_t definitions
2014-06-02 10:47 [PATCH] arm64: uid16: fix __kernel_old_{gid,uid}_t definitions Will Deacon
@ 2014-06-02 11:45 ` Arnd Bergmann
2014-06-02 12:35 ` Will Deacon
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2014-06-02 11:45 UTC (permalink / raw)
To: linux-arm-kernel
On Monday 02 June 2014 11:47:29 Will Deacon wrote:
> Whilst native arm64 applications don't have the 16-bit UID/GID syscalls
> wired up, compat tasks can still access them. The 16-bit wrappers for
> these syscalls use __kernel_old_uid_t and __kernel_old_gid_t, which must
> be 16-bit data types to maintain compatibility with the 16-bit UIDs used
> by compat applications.
>
> This patch defines 16-bit __kernel_old_{gid,uid}_t types for arm64
> instead of using the 32-bit types provided by asm-generic.
>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Is this a theoretical problem, or did you actually encounter binaries
with old uid syscalls?
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH] arm64: uid16: fix __kernel_old_{gid,uid}_t definitions
2014-06-02 11:45 ` Arnd Bergmann
@ 2014-06-02 12:35 ` Will Deacon
0 siblings, 0 replies; 3+ messages in thread
From: Will Deacon @ 2014-06-02 12:35 UTC (permalink / raw)
To: linux-arm-kernel
Hi Arnd,
On Mon, Jun 02, 2014 at 12:45:39PM +0100, Arnd Bergmann wrote:
> On Monday 02 June 2014 11:47:29 Will Deacon wrote:
> > Whilst native arm64 applications don't have the 16-bit UID/GID syscalls
> > wired up, compat tasks can still access them. The 16-bit wrappers for
> > these syscalls use __kernel_old_uid_t and __kernel_old_gid_t, which must
> > be 16-bit data types to maintain compatibility with the 16-bit UIDs used
> > by compat applications.
> >
> > This patch defines 16-bit __kernel_old_{gid,uid}_t types for arm64
> > instead of using the 32-bit types provided by asm-generic.
> >
> > Signed-off-by: Will Deacon <will.deacon@arm.com>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
Cheers!
> Is this a theoretical problem, or did you actually encounter binaries
> with old uid syscalls?
I hit it during an AArch32 LTP run which passes '-1' for some parameters
to the 16-bit flavours of setreuid etc. So I suppose it's theoretical in
the sense that I've only observed the issue within a testsuite as opposed
to a real application.
Will
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-02 12:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-02 10:47 [PATCH] arm64: uid16: fix __kernel_old_{gid,uid}_t definitions Will Deacon
2014-06-02 11:45 ` Arnd Bergmann
2014-06-02 12:35 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox