summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/signal.c12
-rw-r--r--kernel/sys_ni.c3
2 files changed, 9 insertions, 6 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index f98448cf2def..1581140f2d99 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -3513,7 +3513,6 @@ SYSCALL_DEFINE2(kill, pid_t, pid, int, sig)
3513 return kill_something_info(sig, &info, pid); 3513 return kill_something_info(sig, &info, pid);
3514} 3514}
3515 3515
3516#ifdef CONFIG_PROC_FS
3517/* 3516/*
3518 * Verify that the signaler and signalee either are in the same pid namespace 3517 * Verify that the signaler and signalee either are in the same pid namespace
3519 * or that the signaler's pid namespace is an ancestor of the signalee's pid 3518 * or that the signaler's pid namespace is an ancestor of the signalee's pid
@@ -3550,6 +3549,14 @@ static int copy_siginfo_from_user_any(kernel_siginfo_t *kinfo, siginfo_t *info)
3550 return copy_siginfo_from_user(kinfo, info); 3549 return copy_siginfo_from_user(kinfo, info);
3551} 3550}
3552 3551
3552static struct pid *pidfd_to_pid(const struct file *file)
3553{
3554 if (file->f_op == &pidfd_fops)
3555 return file->private_data;
3556
3557 return tgid_pidfd_to_pid(file);
3558}
3559
3553/** 3560/**
3554 * sys_pidfd_send_signal - send a signal to a process through a task file 3561 * sys_pidfd_send_signal - send a signal to a process through a task file
3555 * descriptor 3562 * descriptor
@@ -3586,7 +3593,7 @@ SYSCALL_DEFINE4(pidfd_send_signal, int, pidfd, int, sig,
3586 return -EBADF; 3593 return -EBADF;
3587 3594
3588 /* Is this a pidfd? */ 3595 /* Is this a pidfd? */
3589 pid = tgid_pidfd_to_pid(f.file); 3596 pid = pidfd_to_pid(f.file);
3590 if (IS_ERR(pid)) { 3597 if (IS_ERR(pid)) {
3591 ret = PTR_ERR(pid); 3598 ret = PTR_ERR(pid);
3592 goto err; 3599 goto err;
@@ -3620,7 +3627,6 @@ err:
3620 fdput(f); 3627 fdput(f);
3621 return ret; 3628 return ret;
3622} 3629}
3623#endif /* CONFIG_PROC_FS */
3624 3630
3625static int 3631static int
3626do_send_specific(pid_t tgid, pid_t pid, int sig, struct kernel_siginfo *info) 3632do_send_specific(pid_t tgid, pid_t pid, int sig, struct kernel_siginfo *info)
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index d21f4befaea4..4d9ae5ea6caf 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -167,9 +167,6 @@ COND_SYSCALL(syslog);
167 167
168/* kernel/sched/core.c */ 168/* kernel/sched/core.c */
169 169
170/* kernel/signal.c */
171COND_SYSCALL(pidfd_send_signal);
172
173/* kernel/sys.c */ 170/* kernel/sys.c */
174COND_SYSCALL(setregid); 171COND_SYSCALL(setregid);
175COND_SYSCALL(setgid); 172COND_SYSCALL(setgid);