summaryrefslogtreecommitdiffstats
path: root/include/linux/sched
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-09 00:48:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-09 00:48:15 -0400
commit5ad18b2e60b75c7297a998dea702451d33a052ed (patch)
treec47fb503b4cfc8d3e99ad425aadede9832e96dc4 /include/linux/sched
parent92c1d6522135050cb377a18cc6e30d08dfb87efb (diff)
parent318759b4737c3b3789e2fd64d539f437d52386f5 (diff)
Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull force_sig() argument change from Eric Biederman: "A source of error over the years has been that force_sig has taken a task parameter when it is only safe to use force_sig with the current task. The force_sig function is built for delivering synchronous signals such as SIGSEGV where the userspace application caused a synchronous fault (such as a page fault) and the kernel responded with a signal. Because the name force_sig does not make this clear, and because the force_sig takes a task parameter the function force_sig has been abused for sending other kinds of signals over the years. Slowly those have been fixed when the oopses have been tracked down. This set of changes fixes the remaining abusers of force_sig and carefully rips out the task parameter from force_sig and friends making this kind of error almost impossible in the future" * 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (27 commits) signal/x86: Move tsk inside of CONFIG_MEMORY_FAILURE in do_sigbus signal: Remove the signal number and task parameters from force_sig_info signal: Factor force_sig_info_to_task out of force_sig_info signal: Generate the siginfo in force_sig signal: Move the computation of force into send_signal and correct it. signal: Properly set TRACE_SIGNAL_LOSE_INFO in __send_signal signal: Remove the task parameter from force_sig_fault signal: Use force_sig_fault_to_task for the two calls that don't deliver to current signal: Explicitly call force_sig_fault on current signal/unicore32: Remove tsk parameter from __do_user_fault signal/arm: Remove tsk parameter from __do_user_fault signal/arm: Remove tsk parameter from ptrace_break signal/nds32: Remove tsk parameter from send_sigtrap signal/riscv: Remove tsk parameter from do_trap signal/sh: Remove tsk parameter from force_sig_info_fault signal/um: Remove task parameter from send_sigtrap signal/x86: Remove task parameter from send_sigtrap signal: Remove task parameter from force_sig_mceerr signal: Remove task parameter from force_sig signal: Remove task parameter from force_sigsegv ...
Diffstat (limited to 'include/linux/sched')
-rw-r--r--include/linux/sched/signal.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h
index 38a0f0785323..532458698bde 100644
--- a/include/linux/sched/signal.h
+++ b/include/linux/sched/signal.h
@@ -307,16 +307,19 @@ static inline void kernel_signal_stop(void)
307# define ___ARCH_SI_IA64(_a1, _a2, _a3) 307# define ___ARCH_SI_IA64(_a1, _a2, _a3)
308#endif 308#endif
309 309
310int force_sig_fault(int sig, int code, void __user *addr 310int force_sig_fault_to_task(int sig, int code, void __user *addr
311 ___ARCH_SI_TRAPNO(int trapno) 311 ___ARCH_SI_TRAPNO(int trapno)
312 ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr) 312 ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
313 , struct task_struct *t); 313 , struct task_struct *t);
314int force_sig_fault(int sig, int code, void __user *addr
315 ___ARCH_SI_TRAPNO(int trapno)
316 ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr));
314int send_sig_fault(int sig, int code, void __user *addr 317int send_sig_fault(int sig, int code, void __user *addr
315 ___ARCH_SI_TRAPNO(int trapno) 318 ___ARCH_SI_TRAPNO(int trapno)
316 ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr) 319 ___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
317 , struct task_struct *t); 320 , struct task_struct *t);
318 321
319int force_sig_mceerr(int code, void __user *, short, struct task_struct *); 322int force_sig_mceerr(int code, void __user *, short);
320int send_sig_mceerr(int code, void __user *, short, struct task_struct *); 323int send_sig_mceerr(int code, void __user *, short, struct task_struct *);
321 324
322int force_sig_bnderr(void __user *addr, void __user *lower, void __user *upper); 325int force_sig_bnderr(void __user *addr, void __user *lower, void __user *upper);
@@ -325,17 +328,17 @@ int force_sig_pkuerr(void __user *addr, u32 pkey);
325int force_sig_ptrace_errno_trap(int errno, void __user *addr); 328int force_sig_ptrace_errno_trap(int errno, void __user *addr);
326 329
327extern int send_sig_info(int, struct kernel_siginfo *, struct task_struct *); 330extern int send_sig_info(int, struct kernel_siginfo *, struct task_struct *);
328extern void force_sigsegv(int sig, struct task_struct *p); 331extern void force_sigsegv(int sig);
329extern int force_sig_info(int, struct kernel_siginfo *, struct task_struct *); 332extern int force_sig_info(struct kernel_siginfo *);
330extern int __kill_pgrp_info(int sig, struct kernel_siginfo *info, struct pid *pgrp); 333extern int __kill_pgrp_info(int sig, struct kernel_siginfo *info, struct pid *pgrp);
331extern int kill_pid_info(int sig, struct kernel_siginfo *info, struct pid *pid); 334extern int kill_pid_info(int sig, struct kernel_siginfo *info, struct pid *pid);
332extern int kill_pid_info_as_cred(int, struct kernel_siginfo *, struct pid *, 335extern int kill_pid_usb_asyncio(int sig, int errno, sigval_t addr, struct pid *,
333 const struct cred *); 336 const struct cred *);
334extern int kill_pgrp(struct pid *pid, int sig, int priv); 337extern int kill_pgrp(struct pid *pid, int sig, int priv);
335extern int kill_pid(struct pid *pid, int sig, int priv); 338extern int kill_pid(struct pid *pid, int sig, int priv);
336extern __must_check bool do_notify_parent(struct task_struct *, int); 339extern __must_check bool do_notify_parent(struct task_struct *, int);
337extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); 340extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
338extern void force_sig(int, struct task_struct *); 341extern void force_sig(int);
339extern int send_sig(int, struct task_struct *, int); 342extern int send_sig(int, struct task_struct *, int);
340extern int zap_other_threads(struct task_struct *p); 343extern int zap_other_threads(struct task_struct *p);
341extern struct sigqueue *sigqueue_alloc(void); 344extern struct sigqueue *sigqueue_alloc(void);