]> www.infradead.org Git - users/jedix/linux-maple.git/commit
posix-timers: Cure si_sys_private race
authorThomas Gleixner <tglx@linutronix.de>
Tue, 1 Oct 2024 08:42:03 +0000 (10:42 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 29 Oct 2024 10:43:18 +0000 (11:43 +0100)
commit4febce44cfebcb490b196d5d10ae9f403ca4c956
treea1ac7f9b10ba6c4e62b24bf21350aedc16f81f76
parenta76e1bbe879cf39952ec4b43ed653b0905635f24
posix-timers: Cure si_sys_private race

The si_sys_private member of the siginfo which is embedded in the
preallocated sigqueue is used by the posix timer code to decide whether a
timer must be reprogrammed on signal delivery.

The handling of this is racy as a long standing comment in that code
documents. It is modified with the timer lock held, but without sighand
lock being held. The actual signal delivery code checks for it under
sighand lock without holding the timer lock.

Hand the new value to send_sigqueue() as argument and store it with sighand
lock held. This is an intermediate change to address this issue.

The arguments to this function will be cleanup in subsequent changes.

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