diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-21 23:18:44 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-21 23:18:44 +0200 |
commit | 817de6b85914a3dda72b971c074d4d342965fba0 (patch) | |
tree | df0a4563a04aadb8f8595f72392d66d65797c455 /kernel/signal.c | |
parent | 7dc7967fc39af81191558f63eeaf3d2b83899b1c (diff) | |
parent | 085b7755808aa11f78ab9377257e1dad2e6fa4bb (diff) | |
download | talos-op-linux-817de6b85914a3dda72b971c074d4d342965fba0.tar.gz talos-op-linux-817de6b85914a3dda72b971c074d4d342965fba0.zip |
Merge 5.1-rc6 into staging-next
We want the fixes in here as well as this resolves an iio driver merge
issue.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r-- | kernel/signal.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index b7953934aa99..227ba170298e 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -3581,7 +3581,7 @@ SYSCALL_DEFINE4(pidfd_send_signal, int, pidfd, int, sig, if (flags) return -EINVAL; - f = fdget_raw(pidfd); + f = fdget(pidfd); if (!f.file) return -EBADF; @@ -3605,16 +3605,11 @@ SYSCALL_DEFINE4(pidfd_send_signal, int, pidfd, int, sig, if (unlikely(sig != kinfo.si_signo)) goto err; + /* Only allow sending arbitrary signals to yourself. */ + ret = -EPERM; if ((task_pid(current) != pid) && - (kinfo.si_code >= 0 || kinfo.si_code == SI_TKILL)) { - /* Only allow sending arbitrary signals to yourself. */ - ret = -EPERM; - if (kinfo.si_code != SI_USER) - goto err; - - /* Turn this into a regular kill signal. */ - prepare_kill_siginfo(sig, &kinfo); - } + (kinfo.si_code >= 0 || kinfo.si_code == SI_TKILL)) + goto err; } else { prepare_kill_siginfo(sig, &kinfo); } |