lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 17 May 2008 19:14:22 +0400
From:	Oleg Nesterov <oleg@...sign.ru>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Austin Clements <amdragon+kernelbugzilla@....edu>,
	Ingo Molnar <mingo@...e.hu>, john stultz <johnstul@...ibm.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Michael Kerrisk <mtk.manpages@...glemail.com>,
	Roland McGrath <roland@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] posix timers: use SIGQUEUE_CANCELLED when the timer is destroyed

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@...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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ