summaryrefslogtreecommitdiffstats
path: root/kernel/ptrace.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2019-04-15 07:51:49 +0200
committerDave Airlie <airlied@redhat.com>2019-04-15 07:51:49 +0200
commitf06ddb53096b4cddad2c530125a78a3c2a1d28a4 (patch)
tree36a05922af22272dc82357ce82be21a3a9214bd0 /kernel/ptrace.c
parentMerge branch 'drm-next-5.2' of git://people.freedesktop.org/~agd5f/linux into... (diff)
parentLinux 5.1-rc5 (diff)
downloadlinux-f06ddb53096b4cddad2c530125a78a3c2a1d28a4.tar.xz
linux-f06ddb53096b4cddad2c530125a78a3c2a1d28a4.zip
BackMerge v5.1-rc5 into drm-next
Need rc5 for udl fix to add udl cleanups on top. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'kernel/ptrace.c')
-rw-r--r--kernel/ptrace.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 771e93f9c43f..6f357f4fc859 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -29,6 +29,7 @@
#include <linux/hw_breakpoint.h>
#include <linux/cn_proc.h>
#include <linux/compat.h>
+#include <linux/sched/signal.h>
/*
* Access another process' address space via ptrace.
@@ -924,18 +925,26 @@ int ptrace_request(struct task_struct *child, long request,
ret = ptrace_setsiginfo(child, &siginfo);
break;
- case PTRACE_GETSIGMASK:
+ case PTRACE_GETSIGMASK: {
+ sigset_t *mask;
+
if (addr != sizeof(sigset_t)) {
ret = -EINVAL;
break;
}
- if (copy_to_user(datavp, &child->blocked, sizeof(sigset_t)))
+ if (test_tsk_restore_sigmask(child))
+ mask = &child->saved_sigmask;
+ else
+ mask = &child->blocked;
+
+ if (copy_to_user(datavp, mask, sizeof(sigset_t)))
ret = -EFAULT;
else
ret = 0;
break;
+ }
case PTRACE_SETSIGMASK: {
sigset_t new_set;
@@ -961,6 +970,8 @@ int ptrace_request(struct task_struct *child, long request,
child->blocked = new_set;
spin_unlock_irq(&child->sighand->siglock);
+ clear_tsk_restore_sigmask(child);
+
ret = 0;
break;
}