]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
signals: sys_ssetmask() uses uninitialized newmask
authorOleg Nesterov <oleg@redhat.com>
Sat, 5 Jan 2013 18:13:13 +0000 (19:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Jan 2013 17:18:53 +0000 (09:18 -0800)
commit 5ba53ff648e785445a32ba39112ed07e4cf588d0 upstream.

Commit 77097ae503b1 ("most of set_current_blocked() callers want
SIGKILL/SIGSTOP removed from set") removed the initialization of newmask
by accident, causing ltp to complain like this:

  ssetmask01    1  TFAIL  :  sgetmask() failed: TEST_ERRNO=???(0): Success

Restore the proper initialization.

Reported-and-tested-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/signal.c

index 0af8868525d6d1853acfa77eb9f224566ccfb313..e4d40140a49c461d526c6ce150c53a3d889184de 100644 (file)
@@ -3221,6 +3221,7 @@ SYSCALL_DEFINE1(ssetmask, int, newmask)
        int old = current->blocked.sig[0];
        sigset_t newset;
 
+       siginitset(&newset, newmask);
        set_current_blocked(&newset);
 
        return old;