Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

signal: Provide posixtimer_sigqueue_init()

To cure the SIG_IGN handling for posix interval timers, the preallocated
sigqueue needs to be embedded into struct k_itimer to prevent life time
races of all sorts.

Provide a new function to initialize the embedded sigqueue to prepare for
that.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/all/20241105064213.450427515@linutronix.de

+13
+2
include/linux/posix-timers.h
··· 12 12 13 13 struct kernel_siginfo; 14 14 struct task_struct; 15 + struct sigqueue; 15 16 struct k_itimer; 16 17 17 18 static inline clockid_t make_process_cpuclock(const unsigned int pid, ··· 107 106 } 108 107 109 108 void posixtimer_rearm_itimer(struct task_struct *p); 109 + bool posixtimer_init_sigqueue(struct sigqueue *q); 110 110 bool posixtimer_deliver_signal(struct kernel_siginfo *info); 111 111 void posixtimer_free_timer(struct k_itimer *timer); 112 112
+11
kernel/signal.c
··· 1905 1905 __flush_itimer_signals(&tsk->signal->shared_pending); 1906 1906 } 1907 1907 1908 + bool posixtimer_init_sigqueue(struct sigqueue *q) 1909 + { 1910 + struct ucounts *ucounts = sig_get_ucounts(current, -1, 0); 1911 + 1912 + if (!ucounts) 1913 + return false; 1914 + clear_siginfo(&q->info); 1915 + __sigqueue_init(q, ucounts, SIGQUEUE_PREALLOC); 1916 + return true; 1917 + } 1918 + 1908 1919 struct sigqueue *sigqueue_alloc(void) 1909 1920 { 1910 1921 return __sigqueue_alloc(-1, current, GFP_KERNEL, 0, SIGQUEUE_PREALLOC);