signal.c

linux

5.5.9

Brick

Function codeFunction name
sig_handlerstatic void __user *sig_handler(struct task_struct *t, int sig)
sig_handler_ignoredstatic inline bool sig_handler_ignored(void __user *handler, int sig)
sig_task_ignoredstatic bool sig_task_ignored(struct task_struct *t, int sig, bool force)
sig_ignoredstatic bool sig_ignored(struct task_struct *t, int sig, bool force)
has_pending_signalsRe-calculate pending state from the set of locally pending * signals, globally pending signals, and blocked signals.
recalc_sigpending_tskstatic bool recalc_sigpending_tsk(struct task_struct *t)
recalc_sigpending_and_wakeAfter recalculating TIF_SIGPENDING, we need to make sure the task wakes up
recalc_sigpendingvoid recalc_sigpending(void)
calculate_sigpendingvoid calculate_sigpending(void)
next_signalint next_signal(struct sigpending *pending, sigset_t *mask)
print_dropped_signalstatic inline void print_dropped_signal(int sig)
task_set_jobctl_pendingset jobctl pending bits
task_clear_jobctl_trappingclear jobctl trapping bit
task_clear_jobctl_pendingclear jobctl pending bits
task_participate_group_stopparticipate in a group stop
task_join_group_stopvoid task_join_group_stop(struct task_struct *task)
__sigqueue_allocallocate a new signal queue record * - this may be called without locks if and only if t == current, otherwise an * appropriate lock must be held to stop the target task from exiting
__sigqueue_freestatic void __sigqueue_free(struct sigqueue *q)
flush_sigqueuevoid flush_sigqueue(struct sigpending *queue)
flush_signalsFlush all pending signals for this kthread.
ignore_signalsvoid ignore_signals(struct task_struct *t)
flush_signal_handlersFlush all handlers for a task.
unhandled_signalbool unhandled_signal(struct task_struct *tsk, int sig)
collect_signalstatic void collect_signal(int sig, struct sigpending *list, kernel_siginfo_t *info, bool *resched_timer)
__dequeue_signalstatic int __dequeue_signal(struct sigpending *pending, sigset_t *mask, kernel_siginfo_t *info, bool *resched_timer)
dequeue_signalDequeue a signal and return the element to the caller, which is * expected to free it
dequeue_synchronous_signalstatic int dequeue_synchronous_signal(kernel_siginfo_t *info)
signal_wake_up_stateTell a process that it has a new active signal.
flush_sigqueue_maskRemove signals in mask from the pending set and queue
is_si_specialstatic inline int is_si_special(const struct kernel_siginfo *info)
si_fromuserstatic inline bool si_fromuser(const struct kernel_siginfo *info)
kill_ok_by_credcalled with RCU read lock from check_kill_permission()
check_kill_permissionBad permissions for sending the signal * - the caller must hold the RCU read lock
ptrace_trap_notifyschedule trap to notify ptracer
prepare_signalHandle magic process-wide effects of stop/continue signals. Unlike * the signal actions, these happen immediately at signal-generation * time regardless of blocking, ignoring, or handling. This does the * actual continuing for SIGCONT, but not the actual stopping for stop * signals. The process stop is done as a signal action for SIG_DFL
wants_signalTest if P wants to take SIG
complete_signalstatic void complete_signal(int sig, struct task_struct *p, enum pid_type type)
legacy_queuestatic inline bool legacy_queue(struct sigpending *signals, int sig)
__send_signalstatic int __send_signal(int sig, struct kernel_siginfo *info, struct task_struct *t, enum pid_type type, bool force)
has_si_pid_and_uidstatic inline bool has_si_pid_and_uid(struct kernel_siginfo *info)
send_signalstatic int send_signal(int sig, struct kernel_siginfo *info, struct task_struct *t, enum pid_type type)
print_fatal_signalstatic void print_fatal_signal(int signr)
setup_print_fatal_signalsstatic int __attribute__((__section__(".init.text"))) __attribute__((__cold__))setup_print_fatal_signals(char *str)
__group_send_sig_infoint __group_send_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *p)
do_send_sig_infoint do_send_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *p, enum pid_type type)
force_sig_info_to_taskForce a signal that the process can't ignore: if necessary * we unblock the signal and change any SIG_IGN to SIG_DFL
force_sig_infoint force_sig_info(struct kernel_siginfo *info)
zap_other_threadsNuke all other threads in the group.
__lock_task_sighandstruct sighand_struct *__lock_task_sighand(struct task_struct *tsk, unsigned long *flags)
group_send_sig_infosend signal info to all the members of a group
__kill_pgrp_infosends a signal to a process group: this is what the tty * control characters do (^C, ^Z etc) * - the caller must hold at least a readlock on tasklist_lock
kill_pid_infoint kill_pid_info(int sig, struct kernel_siginfo *info, struct pid *pid)
kill_proc_infostatic int kill_proc_info(int sig, struct kernel_siginfo *info, pid_t pid)
kill_as_cred_permstatic inline bool kill_as_cred_perm(const struct cred *cred, struct task_struct *target)
kill_pid_usb_asyncioThe usb asyncio usage of siginfo is wrong. The glibc support * for asyncio which uses SI_ASYNCIO assumes the layout is SIL_RT
kill_something_infointerprets pid in interesting ways just like kill(2)
send_sig_infoThese are for backward compatibility with the rest of the kernel source.
send_sigint send_sig(int sig, struct task_struct *p, int priv)
force_sigvoid force_sig(int sig)
force_sigsegvWhen things go south during signal handling, we * will force a SIGSEGV
force_sig_fault_to_taskint force_sig_fault_to_task(int sig, int code, void __user *addr___ARCH_SI_TRAPNO(int trapno)___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr), struct task_struct *t)
force_sig_faultint force_sig_fault(int sig, int code, void __user *addr___ARCH_SI_TRAPNO(int trapno)___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr))
send_sig_faultint send_sig_fault(int sig, int code, void __user *addr___ARCH_SI_TRAPNO(int trapno)___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr), struct task_struct *t)
force_sig_mceerrint force_sig_mceerr(int code, void __user *addr, short lsb)
send_sig_mceerrint send_sig_mceerr(int code, void __user *addr, short lsb, struct task_struct *t)
force_sig_bnderrint force_sig_bnderr(void __user *addr, void __user *lower, void __user *upper)
force_sig_pkuerrint force_sig_pkuerr(void __user *addr, unsigned int pkey)
force_sig_ptrace_errno_trapFor the crazy architectures that include trap information in * the errno field, instead of an actual errno value.
kill_pgrpint kill_pgrp(struct pid *pid, int sig, int priv)
kill_pidint kill_pid(struct pid *pid, int sig, int priv)
sigqueue_allocThese functions support sending signals using preallocated sigqueue * structures
sigqueue_freevoid sigqueue_free(struct sigqueue *q)
send_sigqueueint send_sigqueue(struct sigqueue *q, struct pid *pid, enum pid_type type)
do_notify_pidfdstatic void do_notify_pidfd(struct task_struct *task)
do_notify_parentLet a parent know about the death of a child
do_notify_parent_cldstopnotify parent of stopped/continued state change
may_ptrace_stopstatic inline bool may_ptrace_stop(void)
sigkill_pendingReturn non-zero if there is a SIGKILL that should be waking us up
ptrace_stopThis must be called with current->sighand->siglock held
ptrace_do_notifystatic void ptrace_do_notify(int signr, int exit_code, int why)
ptrace_notifyvoid ptrace_notify(int exit_code)
do_signal_stophandle group stop for SIGSTOP and other stop signals
do_jobctl_traptake care of ptrace jobctl traps * When PT_SEIZED, it's used for both group stop and explicit * SEIZE/INTERRUPT traps. Both generate PTRACE_EVENT_STOP trap with * accompanying siginfo. If stopped, lower eight bits of exit_code contain * the stop signal; otherwise, %SIGTRAP
do_freezer_traphandle the freezer jobctl trap * Puts the task into frozen state, if only the task is not about to quit
ptrace_signalstatic int ptrace_signal(int signr, kernel_siginfo_t *info)
get_signalbool get_signal(struct ksignal *ksig)
signal_deliveredstatic void signal_delivered(struct ksignal *ksig, int stepping)
signal_setup_donevoid signal_setup_done(int failed, struct ksignal *ksig, int stepping)
retarget_shared_pendingIt could be that complete_signal() picked us to notify about the * group-wide signal
exit_signalsvoid exit_signals(struct task_struct *tsk)
sys_restart_syscall__attribute__((regparm(0)))long sys_restart_syscall(void)
do_no_restart_syscalllong do_no_restart_syscall(struct restart_block *param)
__set_task_blockedstatic void __set_task_blocked(struct task_struct *tsk, const sigset_t *newset)
set_current_blockedchange current->blocked mask
__set_current_blockedvoid __set_current_blocked(const sigset_t *newset)
sigprocmaskThis is also useful for kernel threads that want to temporarily * (or permanently) block certain signals
set_user_sigmaskThe api helps set app-provided sigmasks
set_compat_user_sigmaskint set_compat_user_sigmask(const compat_sigset_t *umask, size_t sigsetsize)
SYSCALL_DEFINE4sys_rt_sigprocmask - change the list of currently blocked signals
COMPAT_SYSCALL_DEFINE4COMPAT_SYSCALL_DEFINE4(rt_sigprocmask, int, how, compat_sigset_t *, nset, compat_sigset_t *, oset, compat_size_t, sigsetsize)
do_sigpendingstatic void do_sigpending(sigset_t *set)
SYSCALL_DEFINE2sys_rt_sigpending - examine a pending signal that has been raised * while blocked
COMPAT_SYSCALL_DEFINE2COMPAT_SYSCALL_DEFINE2(rt_sigpending, compat_sigset_t *, uset, compat_size_t, sigsetsize)
known_siginfo_layoutstatic bool known_siginfo_layout(unsigned sig, int si_code)
siginfo_layoutenum siginfo_layout siginfo_layout(unsigned sig, int si_code)
si_expansionstatic inline char __user *si_expansion(const siginfo_t *info)
copy_siginfo_to_userint copy_siginfo_to_user(siginfo_t *to, const kernel_siginfo_t *from)
post_copy_siginfo_from_userstatic int post_copy_siginfo_from_user(kernel_siginfo_t *info, const siginfo_t *from)
__copy_siginfo_from_userstatic int __copy_siginfo_from_user(int signo, kernel_siginfo_t *to, const siginfo_t *from)
copy_siginfo_from_userint copy_siginfo_from_user(kernel_siginfo_t *to, const siginfo_t *from)
copy_siginfo_to_user32int copy_siginfo_to_user32(struct compat_siginfo *to, const struct kernel_siginfo *from)
post_copy_siginfo_from_user32static int post_copy_siginfo_from_user32(kernel_siginfo_t *to, const struct compat_siginfo *from)
__copy_siginfo_from_user32static int __copy_siginfo_from_user32(int signo, struct kernel_siginfo *to, const struct compat_siginfo *ufrom)
copy_siginfo_from_user32int copy_siginfo_from_user32(struct kernel_siginfo *to, const struct compat_siginfo *ufrom)
do_sigtimedwaitwait for queued signals specified in @which
SYSCALL_DEFINE4sys_rt_sigtimedwait - synchronously wait for queued signals specified * in @uthese
COMPAT_SYSCALL_DEFINE4COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait_time64, compat_sigset_t *, uthese, struct compat_siginfo *, uinfo, struct __kernel_timespec *, uts, compat_size_t, sigsetsize)
prepare_kill_siginfostatic inline void prepare_kill_siginfo(int sig, struct kernel_siginfo *info)
SYSCALL_DEFINE2sys_kill - send a signal to a process
access_pidfd_pidnsVerify that the signaler and signalee either are in the same pid namespace * or that the signaler's pid namespace is an ancestor of the signalee's pid * namespace.
copy_siginfo_from_user_anystatic int copy_siginfo_from_user_any(kernel_siginfo_t *kinfo, siginfo_t *info)
pidfd_to_pidstatic struct pid *pidfd_to_pid(const struct file *file)
SYSCALL_DEFINE4sys_pidfd_send_signal - Signal a process through a pidfd
do_send_specificstatic int do_send_specific(pid_t tgid, pid_t pid, int sig, struct kernel_siginfo *info)
do_tkillstatic int do_tkill(pid_t tgid, pid_t pid, int sig)
SYSCALL_DEFINE3sys_tgkill - send signal to one specific thread
SYSCALL_DEFINE2sys_tkill - send signal to one specific task
do_rt_sigqueueinfostatic int do_rt_sigqueueinfo(pid_t pid, int sig, kernel_siginfo_t *info)
SYSCALL_DEFINE3sys_rt_sigqueueinfo - send signal information to a signal
COMPAT_SYSCALL_DEFINE3COMPAT_SYSCALL_DEFINE3(rt_sigqueueinfo, compat_pid_t, pid, int, sig, struct compat_siginfo *, uinfo)
do_rt_tgsigqueueinfostatic int do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, kernel_siginfo_t *info)
SYSCALL_DEFINE4SYSCALL_DEFINE4(rt_tgsigqueueinfo, pid_t, tgid, pid_t, pid, int, sig, siginfo_t *, uinfo)
COMPAT_SYSCALL_DEFINE4COMPAT_SYSCALL_DEFINE4(rt_tgsigqueueinfo, compat_pid_t, tgid, compat_pid_t, pid, int, sig, struct compat_siginfo *, uinfo)
kernel_sigactionFor kthreads only, must not be used if cloned with CLONE_SIGHAND
sigaction_compat_abivoid __attribute__((__weak__))sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact)
do_sigactionint do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
do_sigaltstackstatic int do_sigaltstack(const stack_t *ss, stack_t *oss, unsigned long sp, size_t min_ss_size)
SYSCALL_DEFINE2SYSCALL_DEFINE2(sigaltstack, const stack_t *, uss, stack_t *, uoss)
restore_altstackint restore_altstack(const stack_t *uss)
__save_altstackint __save_altstack(stack_t *uss, unsigned long sp)
do_compat_sigaltstackstatic int do_compat_sigaltstack(const compat_stack_t *uss_ptr, compat_stack_t *uoss_ptr)
COMPAT_SYSCALL_DEFINE2COMPAT_SYSCALL_DEFINE2(sigaltstack, const compat_stack_t *, uss_ptr, compat_stack_t *, uoss_ptr)
compat_restore_altstackint compat_restore_altstack(const compat_stack_t *uss)
__compat_save_altstackint __compat_save_altstack(compat_stack_t *uss, unsigned long sp)
SYSCALL_DEFINE1sys_sigpending - examine pending signals
COMPAT_SYSCALL_DEFINE1COMPAT_SYSCALL_DEFINE1(sigpending, compat_old_sigset_t *, set32)
SYSCALL_DEFINE3sys_sigprocmask - examine and change blocked signals
SYSCALL_DEFINE4sys_rt_sigaction - alter an action taken by a process
COMPAT_SYSCALL_DEFINE4COMPAT_SYSCALL_DEFINE4(rt_sigaction, int, sig, const struct compat_sigaction *, act, struct compat_sigaction *, oact, compat_size_t, sigsetsize)
SYSCALL_DEFINE2For backwards compatibility
sys_pause__attribute__((regparm(0)))long sys_pause(void)
sigsuspendstatic int sigsuspend(sigset_t *set)
SYSCALL_DEFINE2sys_rt_sigsuspend - replace the signal mask for a value with the
COMPAT_SYSCALL_DEFINE2COMPAT_SYSCALL_DEFINE2(rt_sigsuspend, compat_sigset_t *, unewset, compat_size_t, sigsetsize)
arch_vma_name__attribute__((__weak__)) const char *arch_vma_name(struct vm_area_struct *vma)
siginfo_buildtime_checksstatic inline void siginfo_buildtime_checks(void)
signals_initvoid __attribute__((__section__(".init.text"))) __attribute__((__cold__))signals_init(void)
kdb_send_sigAllows kdb to send signals without exposing * signal internals