Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 91569 - sigprocmask sets mask with invalid how
sigprocmask sets mask with invalid how
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
i586 Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2003-05-24 11:33 EDT by Steve Grubb
Modified: 2007-04-18 12:53 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-08-20 10:07:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to fix the problem (409 bytes, patch)
2003-05-25 07:44 EDT, Steve Grubb
no flags Details | Diff

  None (edit)
Description Steve Grubb 2003-05-24 11:33:58 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.2.1) Gecko/20030225

Description of problem:
sigprocmask is setting the signal mask even though an invalid how is sent to the
kernel. Most programs do not use invalid how parameters, but setting the mask is
unexpected. I read through the glibc code and it looks like a straight pass
through to the kernel.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Compile and run the following program:

#include <stdio.h>
#include <signal.h>
int main(void)
        sigset_t actl, oactl;
        sigaddset(&actl, SIGABRT);
        sigprocmask(SIG_SETMASK, &actl, NULL); // init mask to just SIGABRT
        sigaddset(&actl, SIGALRM);
        if (sigprocmask(20000, &actl, NULL) != -1) {
                perror("sigprocmask() did not fail even though invalid how
parameter was passed to it.\n");
                return 1;
        sigprocmask(SIG_SETMASK, NULL, &oactl); // read mask
        if (sigismember(&oactl, SIGALRM) == 1) {
                printf("FAIL: SIGALRM was set even though how is bad. \n");
                return 1;
        return 0;

Actual Results:  FAIL: SIGALRM was set even though how is bad.

Expected Results:  No printout from program
Comment 1 Arjan van de Ven 2003-05-24 12:21:50 EDT
indeed the SUS spec says it needs to return -EINVAL; investigating
Comment 2 Steve Grubb 2003-05-25 07:44:20 EDT
Created attachment 91956 [details]
Patch to fix the problem

I also sent this patch to Linus.

Note You need to log in before you can comment on or make changes to this bug.