lkml.org 
[lkml]   [1998]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectBug in kernel/signal.c
From
Date
Hi,

From linux-2.1.108/kernel/signal.c, line 812:
> && (sig == SIGCONT ||
> sig == SIGCHLD ||
> sig != SIGWINCH))) {

This test above is equivalent to (sig != SIGWINCH), which must be
wrong. IMHO, it should match the test at line 281, as in the patch
below.

Here's a demonstration of the kind of problem caused. This code should
be killed when it unblocks the signal, but instead the signal gets
discarded:


#include <signal.h>
#include <stdlib.h>
#include <unistd.h>

#define SIG SIGINT

int main(void)
{
sigset_t ss;
sigemptyset(&ss);
sigaddset(&ss, SIG);
sigprocmask(SIG_BLOCK, &ss, NULL);
kill(getpid(), SIG);
signal(SIG, SIG_DFL);
sigprocmask(SIG_UNBLOCK, &ss, NULL);
return 0;
}


--
Dave Wragg.

diff -ru linux-2.1.108/kernel/signal.c linux-2.1.108.mod/kernel/signal.c
--- linux-2.1.108/kernel/signal.c Fri Jun 26 23:36:03 1998
+++ linux-2.1.108.mod/kernel/signal.c Sun Jul 12 22:46:58 1998
@@ -809,9 +809,8 @@

if (k->sa.sa_handler == SIG_IGN
|| (k->sa.sa_handler == SIG_DFL
- && (sig == SIGCONT ||
- sig == SIGCHLD ||
- sig != SIGWINCH))) {
+ && (sig == SIGCONT || sig == SIGCHLD
+ || sig == SIGWINCH || sig == SIGURG))) {
/* So dequeue any that might be pending.
XXX: process-wide signals? */
if (sig >= SIGRTMIN &&

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.046 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site