From 5a6dff3fe886c275d3efe6a81e1ba5b949f1d52c Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sun, 11 Feb 2018 00:26:09 +0000 Subject: [PATCH] Include early Include "ptrace.h" before any header that can include because on some architectures the latter may include which in turn may include with potentially devastating effect on . * process.c: Include "ptrace.h" before "regs.h". * rt_sigframe.c: Likewise. * sigreturn.c: Include "ptrace.h" before "nsig.h". * syscall.c: Likewise. * wait.c: Include "ptrace.h" before . * strace.c: Include "ptrace.h" before . * tests/ptrace.c: Likewise. * tests/test_ucopy.c: Include before . --- process.c | 6 +++--- rt_sigframe.c | 2 +- sigreturn.c | 2 +- strace.c | 2 +- syscall.c | 2 +- tests/ptrace.c | 2 +- tests/test_ucopy.c | 2 +- wait.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/process.c b/process.c index b36cd4bc..5690e13e 100644 --- a/process.c +++ b/process.c @@ -41,10 +41,10 @@ # include #endif -#include "xlat/nt_descriptor_types.h" - -#include "regs.h" #include "ptrace.h" +#include "regs.h" + +#include "xlat/nt_descriptor_types.h" #include "xlat/ptrace_cmds.h" #include "xlat/ptrace_setoptions_flags.h" #include "xlat/ptrace_peeksiginfo_flags.h" diff --git a/rt_sigframe.c b/rt_sigframe.c index d9bcb4ff..6093043b 100644 --- a/rt_sigframe.c +++ b/rt_sigframe.c @@ -26,8 +26,8 @@ */ #include "defs.h" -#include "regs.h" #include "ptrace.h" +#include "regs.h" #define DEF_FUNC_GET_RT_SIGFRAME_ADDR \ kernel_ulong_t get_rt_sigframe_addr(struct tcb *tcp) diff --git a/sigreturn.c b/sigreturn.c index b2eeb7a4..bfc6f17b 100644 --- a/sigreturn.c +++ b/sigreturn.c @@ -1,7 +1,7 @@ #include "defs.h" +#include "ptrace.h" #include "nsig.h" #include "regs.h" -#include "ptrace.h" #if defined HAVE_ASM_SIGCONTEXT_H && !defined HAVE_STRUCT_SIGCONTEXT # include diff --git a/strace.c b/strace.c index 042c2eea..d2a1bca5 100644 --- a/strace.c +++ b/strace.c @@ -33,6 +33,7 @@ #include #include #include +#include "ptrace.h" #include #include #include @@ -52,7 +53,6 @@ #include "largefile_wrappers.h" #include "number_set.h" #include "scno.h" -#include "ptrace.h" #include "printsiginfo.h" #include "trace_event.h" #include "xstring.h" diff --git a/syscall.c b/syscall.c index df169259..e5963f94 100644 --- a/syscall.c +++ b/syscall.c @@ -34,6 +34,7 @@ #include "defs.h" #include "native_defs.h" +#include "ptrace.h" #include "nsig.h" #include "number_set.h" #include @@ -45,7 +46,6 @@ #include #include "regs.h" -#include "ptrace.h" #if defined(SPARC64) # undef PTRACE_GETREGS diff --git a/tests/ptrace.c b/tests/ptrace.c index d776dcdd..0f008d93 100644 --- a/tests/ptrace.c +++ b/tests/ptrace.c @@ -32,12 +32,12 @@ #include #include +#include "ptrace.h" #include #include #include #include #include -#include "ptrace.h" #include static const char *errstr; diff --git a/tests/test_ucopy.c b/tests/test_ucopy.c index 9ddffbca..f4507e9a 100644 --- a/tests/test_ucopy.c +++ b/tests/test_ucopy.c @@ -30,10 +30,10 @@ #include "tests.h" #include +#include #include #include #include -#include #include #include diff --git a/wait.c b/wait.c index 0f1aa001..b117390f 100644 --- a/wait.c +++ b/wait.c @@ -34,6 +34,7 @@ */ #include "defs.h" +#include "ptrace.h" #include @@ -58,7 +59,6 @@ # define W_CONTINUED 0xffff #endif -#include "ptrace.h" #include "xlat/ptrace_events.h" static int -- 2.40.0