Skip to content

Commit 69f032c

Browse files
committed
signal: Provide ignored_posix_timers list
To prepare for handling posix timer signals on sigaction(SIG_IGN) properly, add a list to task::signal. This list will be used to queue posix timers so their signal can be requeued when SIG_IGN is lifted later. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Frederic Weisbecker <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 647da5f commit 69f032c

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

include/linux/sched/signal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ struct signal_struct {
138138
/* POSIX.1b Interval Timers */
139139
unsigned int next_posix_timer_id;
140140
struct hlist_head posix_timers;
141+
struct hlist_head ignored_posix_timers;
141142

142143
/* ITIMER_REAL timer for the process */
143144
struct hrtimer real_timer;

init/init_task.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ static struct signal_struct init_signals = {
3030
.cred_guard_mutex = __MUTEX_INITIALIZER(init_signals.cred_guard_mutex),
3131
.exec_update_lock = __RWSEM_INITIALIZER(init_signals.exec_update_lock),
3232
#ifdef CONFIG_POSIX_TIMERS
33-
.posix_timers = HLIST_HEAD_INIT,
34-
.cputimer = {
33+
.posix_timers = HLIST_HEAD_INIT,
34+
.ignored_posix_timers = HLIST_HEAD_INIT,
35+
.cputimer = {
3536
.cputime_atomic = INIT_CPUTIME_ATOMIC,
3637
},
3738
#endif

kernel/fork.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,6 +1864,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
18641864

18651865
#ifdef CONFIG_POSIX_TIMERS
18661866
INIT_HLIST_HEAD(&sig->posix_timers);
1867+
INIT_HLIST_HEAD(&sig->ignored_posix_timers);
18671868
hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
18681869
sig->real_timer.function = it_real_fn;
18691870
#endif

0 commit comments

Comments
 (0)