common.c (1796829d9169a7a113c0b74aec04bd5c3ee9d70f) common.c (6342adcaa683c2b705c24ed201dc11b35854c88d)
1// SPDX-License-Identifier: GPL-2.0
2
3#include <linux/context_tracking.h>
4#include <linux/entry-common.h>
5#include <linux/highmem.h>
6#include <linux/livepatch.h>
7#include <linux/audit.h>
8

--- 195 unchanged lines hidden (view full) ---

204
205 /* Ensure that the address limit is intact and no locks are held */
206 addr_limit_user_check();
207 kmap_assert_nomap();
208 lockdep_assert_irqs_disabled();
209 lockdep_sys_exit();
210}
211
1// SPDX-License-Identifier: GPL-2.0
2
3#include <linux/context_tracking.h>
4#include <linux/entry-common.h>
5#include <linux/highmem.h>
6#include <linux/livepatch.h>
7#include <linux/audit.h>
8

--- 195 unchanged lines hidden (view full) ---

204
205 /* Ensure that the address limit is intact and no locks are held */
206 addr_limit_user_check();
207 kmap_assert_nomap();
208 lockdep_assert_irqs_disabled();
209 lockdep_sys_exit();
210}
211
212#ifndef _TIF_SINGLESTEP
213static inline bool report_single_step(unsigned long work)
214{
215 return false;
216}
217#else
218/*
219 * If SYSCALL_EMU is set, then the only reason to report is when
212/*
213 * If SYSCALL_EMU is set, then the only reason to report is when
220 * TIF_SINGLESTEP is set (i.e. PTRACE_SYSEMU_SINGLESTEP). This syscall
214 * SINGLESTEP is set (i.e. PTRACE_SYSEMU_SINGLESTEP). This syscall
221 * instruction has been already reported in syscall_enter_from_user_mode().
222 */
223static inline bool report_single_step(unsigned long work)
224{
225 if (work & SYSCALL_WORK_SYSCALL_EMU)
226 return false;
227
215 * instruction has been already reported in syscall_enter_from_user_mode().
216 */
217static inline bool report_single_step(unsigned long work)
218{
219 if (work & SYSCALL_WORK_SYSCALL_EMU)
220 return false;
221
228 return !!(current_thread_info()->flags & _TIF_SINGLESTEP);
222 return work & SYSCALL_WORK_SYSCALL_EXIT_TRAP;
229}
223}
230#endif
231
224
232
233static void syscall_exit_work(struct pt_regs *regs, unsigned long work)
234{
235 bool step;
236
237 /*
238 * If the syscall was rolled back due to syscall user dispatching,
239 * then the tracers below are not invoked for the same reason as
240 * the entry side was not invoked in syscall_trace_enter(): The ABI

--- 231 unchanged lines hidden ---
225static void syscall_exit_work(struct pt_regs *regs, unsigned long work)
226{
227 bool step;
228
229 /*
230 * If the syscall was rolled back due to syscall user dispatching,
231 * then the tracers below are not invoked for the same reason as
232 * the entry side was not invoked in syscall_trace_enter(): The ABI

--- 231 unchanged lines hidden ---