Skip to content

Commit 3e16b5c

Browse files
Anisse Astiergregkh
authored andcommitted
arm64/sve: <uapi/asm/ptrace.h> should not depend on <uapi/linux/prctl.h>
commit 35341ca upstream. Pulling linux/prctl.h into asm/ptrace.h in the arm64 UAPI headers causes userspace build issues for any program (e.g. strace and qemu) that includes both <sys/prctl.h> and <linux/ptrace.h> when using musl libc: | error: redefinition of 'struct prctl_mm_map' | struct prctl_mm_map { See foundriesio/meta-lmp@6d4a106 for a public example of people working around this issue. Although it's a bit grotty, fix this breakage by duplicating the prctl constant definitions. Since these are part of the kernel ABI, they cannot be changed in future and so it's not the end of the world to have them open-coded. Fixes: 43d4da2 ("arm64/sve: ptrace and ELF coredump support") Cc: stable@vger.kernel.org Acked-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Anisse Astier <aastier@freebox.fr> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2296fd5 commit 3e16b5c

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

arch/arm64/include/uapi/asm/ptrace.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@
6464

6565
#ifndef __ASSEMBLY__
6666

67-
#include <linux/prctl.h>
68-
6967
/*
7068
* User structures for general purpose, floating point and debug registers.
7169
*/
@@ -112,10 +110,10 @@ struct user_sve_header {
112110

113111
/*
114112
* Common SVE_PT_* flags:
115-
* These must be kept in sync with prctl interface in <linux/ptrace.h>
113+
* These must be kept in sync with prctl interface in <linux/prctl.h>
116114
*/
117-
#define SVE_PT_VL_INHERIT (PR_SVE_VL_INHERIT >> 16)
118-
#define SVE_PT_VL_ONEXEC (PR_SVE_SET_VL_ONEXEC >> 16)
115+
#define SVE_PT_VL_INHERIT ((1 << 17) /* PR_SVE_VL_INHERIT */ >> 16)
116+
#define SVE_PT_VL_ONEXEC ((1 << 18) /* PR_SVE_SET_VL_ONEXEC */ >> 16)
119117

120118

121119
/*

0 commit comments

Comments
 (0)