diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h index 07d97def7dcb..299f13c78a6f 100644 --- a/include/linux/entry-common.h +++ b/include/linux/entry-common.h @@ -97,6 +97,9 @@ static __always_inline long syscall_trace_enter(struct pt_regs *regs, unsigned l if (!arch_ptrace_report_syscall_permit_entry(regs) || (work & SYSCALL_WORK_SYSCALL_EMU)) return -1L; + + /* ptrace might have changed work flags */ + work = READ_ONCE(current_thread_info()->syscall_work); } /* Do seccomp after ptrace, to catch any tracer changes. */