Include <sys/ptrace.h> early

Include "ptrace.h" before any header that can include <signal.h>
because on some architectures the latter may include <asm/sigcontext.h>
which in turn may include <asm/ptrace.h> with potentially devastating
effect on <sys/ptrace.h>.

* 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 <sys/wait.h>.
* strace.c: Include "ptrace.h" before <signal.h>.
* tests/ptrace.c: Likewise.
* tests/test_ucopy.c: Include <sys/ptrace.h> before <signal.h>.
This commit is contained in:
Дмитрий Левин 2018-02-11 00:26:09 +00:00
parent f2bb704a92
commit 5a6dff3fe8
8 changed files with 10 additions and 10 deletions

View File

@ -41,10 +41,10 @@
# include <elf.h>
#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"

View File

@ -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)

View File

@ -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 <asm/sigcontext.h>

View File

@ -33,6 +33,7 @@
#include <stdarg.h>
#include <limits.h>
#include <fcntl.h>
#include "ptrace.h"
#include <signal.h>
#include <sys/resource.h>
#include <sys/wait.h>
@ -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"

View File

@ -34,6 +34,7 @@
#include "defs.h"
#include "native_defs.h"
#include "ptrace.h"
#include "nsig.h"
#include "number_set.h"
#include <limits.h>
@ -45,7 +46,6 @@
#include <asm/unistd.h>
#include "regs.h"
#include "ptrace.h"
#if defined(SPARC64)
# undef PTRACE_GETREGS

View File

@ -32,12 +32,12 @@
#include <asm/unistd.h>
#include <errno.h>
#include "ptrace.h"
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
#include "ptrace.h"
#include <linux/audit.h>
static const char *errstr;

View File

@ -30,10 +30,10 @@
#include "tests.h"
#include <errno.h>
#include <sys/ptrace.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ptrace.h>
#include <sys/uio.h>
#include <sys/wait.h>

2
wait.c
View File

@ -34,6 +34,7 @@
*/
#include "defs.h"
#include "ptrace.h"
#include <sys/wait.h>
@ -58,7 +59,6 @@
# define W_CONTINUED 0xffff
#endif
#include "ptrace.h"
#include "xlat/ptrace_events.h"
static int