From 1a60ba4e2af662d0cbd5cfe6204dfe5e29ec0fdc Mon Sep 17 00:00:00 2001 From: David Ng Date: Sun, 21 Dec 2014 12:53:22 -0800 Subject: [PATCH] arm64: Add 32-bit sigcontext definition to uapi signcontext.h The arm64 uapi sigcontext.h can be included by 32-bit userspace modules. Since arm and arm64 sigcontext definition are not compatible, add arm sigcontext definition to arm64 sigcontext.h. Signed-off-by: David Ng Signed-off-by: Divya Sharma Signed-off-by: Anh Nguyen Change-Id: Iaed58045fd345e4ca66e8a6981c6b4f80c4bdfca --- arch/arm64/include/uapi/asm/sigcontext.h | 32 ++++++++++++++++++++++++ scripts/headers_install.sh | 25 ++++++++++++++++-- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/uapi/asm/sigcontext.h b/arch/arm64/include/uapi/asm/sigcontext.h index e29bf3e2d0cc..e9b0a3337703 100644 --- a/arch/arm64/include/uapi/asm/sigcontext.h +++ b/arch/arm64/include/uapi/asm/sigcontext.h @@ -19,6 +19,7 @@ #ifndef __ASSEMBLER__ +#ifdef CONFIG_64BIT #include /* @@ -192,6 +193,37 @@ struct gcs_context { __u64 reserved; }; +#else /* CONFIG_64BIT */ + +/* + * Signal context structure - contains all info to do with the state + * before the signal handler was invoked. Note: only add new entries + * to the end of the structure. + */ +struct sigcontext { + unsigned long trap_no; + unsigned long error_code; + unsigned long oldmask; + unsigned long arm_r0; + unsigned long arm_r1; + unsigned long arm_r2; + unsigned long arm_r3; + unsigned long arm_r4; + unsigned long arm_r5; + unsigned long arm_r6; + unsigned long arm_r7; + unsigned long arm_r8; + unsigned long arm_r9; + unsigned long arm_r10; + unsigned long arm_fp; + unsigned long arm_ip; + unsigned long arm_sp; + unsigned long arm_lr; + unsigned long arm_pc; + unsigned long arm_cpsr; + unsigned long fault_address; +}; +#endif /* CONFIG_64BIT */ #endif /* !__ASSEMBLER__ */ #include diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index ff1890e96d5c..fa85e5ef4a02 100755 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh @@ -64,10 +64,31 @@ configs=$(sed -e ' d ' $OUTFILE) +# The entries in the following list do not result in an error. +# Please do not add a new entry. This list is only for existing ones. +# The list will be reduced gradually, and deleted eventually. (hopefully) +# +# The format is : in each line. +config_leak_ignores=" +arch/arm64/include/uapi/asm/sigcontext.h:CONFIG_64BIT +" + for c in $configs do - echo "error: $INFILE: leak $c to user-space" >&2 - exit 1 + leak_error=1 + + for ignore in $config_leak_ignores + do + if echo "$INFILE:$c" | grep -q "$ignore$"; then + leak_error= + break + fi + done + + if [ "$leak_error" = 1 ]; then + echo "error: $INFILE: leak $c to user-space" >&2 + exit 1 + fi done rm -f $TMPFILE