From ad523ae767350f96407db84085c792c544327aa6 Mon Sep 17 00:00:00 2001 From: jhb Date: Mon, 15 Aug 2016 21:10:41 +0000 Subject: MFC 302900,302902,302921,303461,304009: Add a mask of optional ptrace() events. 302900: Add a test for user signal delivery. This test verifies we get the correct ptrace event details when a signal is posted to a traced process from userland. 302902: Add a mask of optional ptrace() events. ptrace() now stores a mask of optional events in p_ptevents. Currently this mask is a single integer, but it can be expanded into an array of integers in the future. Two new ptrace requests can be used to manipulate the event mask: PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK sets the current event mask. The current set of events include: - PTRACE_EXEC: trace calls to execve(). - PTRACE_SCE: trace system call entries. - PTRACE_SCX: trace syscam call exits. - PTRACE_FORK: trace forks and auto-attach to new child processes. - PTRACE_LWP: trace LWP events. The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have been replaced by PTRACE_SCE and PTRACE_SCX. PTRACE_FORK replaces P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS. The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for compatibility but now simply toggle corresponding flags in the event mask. While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both modify the event mask and continue the traced process. 302921: Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL. 303461: Note that not all optional ptrace events use SIGTRAP. New child processes attached due to PTRACE_FORK use SIGSTOP instead of SIGTRAP. All other ptrace events use SIGTRAP. 304009: Remove description of P_FOLLOWFORK as this flag was removed. --- sys/i386/linux/linux_ptrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/i386') diff --git a/sys/i386/linux/linux_ptrace.c b/sys/i386/linux/linux_ptrace.c index 2925e6b..fbe66b4 100644 --- a/sys/i386/linux/linux_ptrace.c +++ b/sys/i386/linux/linux_ptrace.c @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #define PTRACE_ATTACH 16 #define PTRACE_DETACH 17 -#define PTRACE_SYSCALL 24 +#define LINUX_PTRACE_SYSCALL 24 #define PTRACE_GETREGS 12 #define PTRACE_SETREGS 13 @@ -473,7 +473,7 @@ linux_ptrace(struct thread *td, struct linux_ptrace_args *uap) break; } - case PTRACE_SYSCALL: + case LINUX_PTRACE_SYSCALL: /* fall through */ default: printf("linux: ptrace(%u, ...) not implemented\n", -- cgit v1.1 From e07c03288156626bf033777c19c6a56a761ac58e Mon Sep 17 00:00:00 2001 From: kib Date: Wed, 17 Aug 2016 07:09:22 +0000 Subject: MFC r303913: Unconditionally perform checks that FPU region was entered, when #NM exception is caught in kernel mode. --- sys/i386/i386/trap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/i386') diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 2fcf690..a186ff5 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -534,8 +534,8 @@ trap(struct trapframe *frame) case T_DNA: #ifdef DEV_NPX - KASSERT(!PCB_USER_FPU(td->td_pcb), - ("Unregistered use of FPU in kernel")); + if (PCB_USER_FPU(td->td_pcb)) + panic("Unregistered use of FPU in kernel"); if (npxdna()) goto out; #endif -- cgit v1.1