2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 09:13:55 +08:00
linux-next/include/linux/sched
Andrei Vagin fcfc2aa018 ptrace: take into account saved_sigmask in PTRACE{GET,SET}SIGMASK
There are a few system calls (pselect, ppoll, etc) which replace a task
sigmask while they are running in a kernel-space

When a task calls one of these syscalls, the kernel saves a current
sigmask in task->saved_sigmask and sets a syscall sigmask.

On syscall-exit-stop, ptrace traps a task before restoring the
saved_sigmask, so PTRACE_GETSIGMASK returns the syscall sigmask and
PTRACE_SETSIGMASK does nothing, because its sigmask is replaced by
saved_sigmask, when the task returns to user-space.

This patch fixes this problem.  PTRACE_GETSIGMASK returns saved_sigmask
if it's set.  PTRACE_SETSIGMASK drops the TIF_RESTORE_SIGMASK flag.

Link: http://lkml.kernel.org/r/20181120060616.6043-1-avagin@gmail.com
Fixes: 29000caecb ("ptrace: add ability to get/set signal-blocked mask")
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-03-29 10:01:37 -07:00
..
autogroup.h
clock.h
coredump.h oom, oom_reaper: do not enqueue same task twice 2019-02-01 15:46:23 -08:00
cpufreq.h sched/cpufreq: Prepare schedutil for Energy Aware Scheduling 2018-12-11 15:16:58 +01:00
cputime.h
deadline.h
debug.h
hotplug.h
idle.h
init.h
isolation.h sched: Fix various typos in comments 2018-12-03 11:55:42 +01:00
jobctl.h
loadavg.h sched: loadavg: make calc_load_n() public 2018-10-26 16:26:32 -07:00
mm.h mm/cma: add PF flag to force non cma alloc 2019-03-05 21:07:19 -08:00
nohz.h
numa_balancing.h
prio.h
rt.h
signal.h ptrace: take into account saved_sigmask in PTRACE{GET,SET}SIGMASK 2019-03-29 10:01:37 -07:00
smt.h x86/speculation: Rework SMT state change 2018-11-28 11:57:07 +01:00
stat.h sched: Fix various typos in comments 2018-12-03 11:55:42 +01:00
sysctl.h sched/topology: Introduce a sysctl for Energy Aware Scheduling 2019-01-27 12:29:37 +01:00
task_stack.h sched/core: Convert task_struct.stack_refcount to refcount_t 2019-02-04 08:53:56 +01:00
task.h sched/core: Convert task_struct.usage to refcount_t 2019-02-04 08:53:55 +01:00
topology.h sched/topology: Fix percpu data types in struct sd_data & struct s_data 2019-02-11 08:02:15 +01:00
user.h Add io_uring IO interface 2019-02-28 08:24:23 -07:00
wake_q.h sched/wake_q: Reduce reference counting for special users 2019-02-04 09:03:28 +01:00
xacct.h