]> www.infradead.org Git - users/jedix/linux-maple.git/commit
posix-timers: Add a refcount to struct k_itimer
authorThomas Gleixner <tglx@linutronix.de>
Tue, 5 Nov 2024 08:14:36 +0000 (09:14 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 7 Nov 2024 01:14:43 +0000 (02:14 +0100)
commit5d916a0988eed5217c103932ff4887c9ae83c89c
tree0b5c34dca31f6f7b191dd579cb60580ecc8421f3
parent4cf7bf2a2f1a8ace4a49a1138c8123fdb5990093
posix-timers: Add a refcount to struct k_itimer

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.

To make that work correctly it needs reference counting so that timer
deletion does not free the timer prematuraly when there is a signal queued
or delivered concurrently.

Add a rcuref to the posix timer part.

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.304756440@linutronix.de
include/linux/posix-timers.h
kernel/time/posix-timers.c