linux-sg2042/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 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
clock.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
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 Merge branch 'for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup 2017-11-15 14:29:44 -08:00
deadline.h sched/headers: Simplify and clean up header usage in the scheduler 2018-03-04 12:39:29 +01:00
debug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hotplug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
idle.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
init.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
isolation.h sched: Fix various typos in comments 2018-12-03 11:55:42 +01:00
jobctl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
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 sched/nohz: Clean up nohz enter/exit 2018-03-09 07:59:19 +01:00
numa_balancing.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
prio.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rt.h Merge branch 'linus' into sched/core, to pick up fixes 2017-11-08 10:17:15 +01:00
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.h sched/core: Convert task_struct.usage to refcount_t 2019-02-04 08:53:55 +01:00
task_stack.h sched/core: Convert task_struct.stack_refcount to refcount_t 2019-02-04 08:53:56 +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 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00