All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] posix timers: use SIGQUEUE_CANCELLED when the timer is destroyed
@ 2008-05-17 15:14 Oleg Nesterov
  2008-05-17 15:31 ` Oleg Nesterov
  0 siblings, 1 reply; 8+ messages in thread
From: Oleg Nesterov @ 2008-05-17 15:14 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Austin Clements, Ingo Molnar, john stultz, Linus Torvalds,
	Michael Kerrisk, Roland McGrath, Thomas Gleixner, linux-kernel

This change goes as a separate patch for documentation purposes.

Suggested by Linus Torvalds.

Fixes the problem pointed out by Austin Clements. Currently, when the task
execs it could be killed by the fatal signal sent by the posix timer, because
exec flushes the signal handlers.
See http://bugzilla.kernel.org/show_bug.cgi?id=10460

This is a user visible change. With this patch sys_timer_delete() discards
the pending signal which was generated by the timer.

This change goes as a separate patch for documentation purposes. We have many
options how to set SIGQUEUE_CANCELLED while detroying the timer. We could set
this flag in release_posix_timer() before calling sigqueue_free(), or add the
new "int cancel" argument to sigqueue_free(), but since sigqueue_free() plays
with q->flags anyway and nobody else uses this function, this patch changes
sigqueue_free() to set SIGQUEUE_CANCELLED unconditionally.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 25/kernel/signal.c~6_USE_CANCELLED	2008-05-17 17:40:09.000000000 +0400
+++ 25/kernel/signal.c	2008-05-17 18:07:10.000000000 +0400
@@ -1246,7 +1246,7 @@ void sigqueue_free(struct sigqueue *q)
 	 * __exit_signal()->flush_sigqueue().
 	 */
 	spin_lock_irqsave(lock, flags);
-	q->flags &= ~SIGQUEUE_PREALLOC;
+	q->flags = SIGQUEUE_CANCELLED; /* clears SIGQUEUE_PREALLOC */
 	/*
 	 * If it is queued it will be freed when dequeued,
 	 * like the "regular" sigqueue.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-05-21  2:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-17 15:14 [PATCH 3/3] posix timers: use SIGQUEUE_CANCELLED when the timer is destroyed Oleg Nesterov
2008-05-17 15:31 ` Oleg Nesterov
2008-05-17 17:11   ` Linus Torvalds
2008-05-18 17:15     ` Oleg Nesterov
2008-05-18 17:24       ` Linus Torvalds
2008-05-18 17:40         ` Linus Torvalds
2008-05-18 17:46         ` Oleg Nesterov
2008-05-21  2:27       ` Roland McGrath

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.