+ posix-timers-use-sigqueue_cancelled-when-the-timer-is-destroyed.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     posix timers: use SIGQUEUE_CANCELLED when the timer is destroyed
has been added to the -mm tree.  Its filename is
     posix-timers-use-sigqueue_cancelled-when-the-timer-is-destroyed.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: posix timers: use SIGQUEUE_CANCELLED when the timer is destroyed
From: Oleg Nesterov <oleg@xxxxxxxxxx>

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@xxxxxxxxxx>
Cc: Roland McGrath <roland@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 kernel/signal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN kernel/signal.c~posix-timers-use-sigqueue_cancelled-when-the-timer-is-destroyed kernel/signal.c
--- a/kernel/signal.c~posix-timers-use-sigqueue_cancelled-when-the-timer-is-destroyed
+++ a/kernel/signal.c
@@ -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.
_

Patches currently in -mm which might be from oleg@xxxxxxxxxx are

signals-fix-sigqueue_free-vs-__exit_signal-race.patch
posix-timers-timer_delete-remove-the-bogus-it_process-=-null-check.patch
posix-timers-release_posix_timer-kill-the-bogus-put_task_struct-it_process.patch
signals-sigqueue_free-dont-free-sigqueue-if-it-is-queued.patch
signals-introduce-sigqueue_cancelled.patch
posix-timers-use-sigqueue_cancelled-when-the-timer-is-destroyed.patch
put_pid-make-sure-we-dont-free-the-live-pid.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux