Add TIF_FD_SLOTS and test it on the untraced return from a system call. A task that reserved descriptors takes the tracesys_exit path, where syscall_trace_exit() commits them before the ptrace exit stop. The traced path already ends up there. Signed-off-by: Christian Brauner (Amutable) --- arch/arc/include/asm/thread_info.h | 2 ++ arch/arc/kernel/entry.S | 5 +++++ arch/arc/kernel/ptrace.c | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/arch/arc/include/asm/thread_info.h b/arch/arc/include/asm/thread_info.h index 255d2c774219..4c67d4eb434b 100644 --- a/arch/arc/include/asm/thread_info.h +++ b/arch/arc/include/asm/thread_info.h @@ -77,6 +77,7 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void) #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ #define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ #define TIF_NOTIFY_SIGNAL 5 /* signal notifications exist */ +#define TIF_FD_SLOTS 6 /* syscall prepared descriptors */ #define TIF_SYSCALL_TRACE 15 /* syscall trace active */ /* true if poll_idle() is polling TIF_NEED_RESCHED */ #define TIF_MEMDIE 16 @@ -88,6 +89,7 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void) #define _TIF_NEED_RESCHED (1< #include #include #include @@ -355,6 +356,9 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs) asmlinkage void syscall_trace_exit(struct pt_regs *regs) { + if (test_thread_flag(TIF_FD_SLOTS)) + fd_slots_commit(regs); + if (test_thread_flag(TIF_SYSCALL_TRACE)) ptrace_report_syscall_exit(regs, 0); -- 2.53.0