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 104310 - prctl(PR_SET_DUMPABLE, 1) is ignored
prctl(PR_SET_DUMPABLE, 1) is ignored
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Dave Jones
Brian Brock
: 98825 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2003-09-12 09:27 EDT by Hrunting Johnson
Modified: 2015-01-04 17:03 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-01-04 22:44:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2003:394 normal SHIPPED_LIVE Updated 2.4 kernel fixes various bugs 2003-12-23 00:00:00 EST

  None (edit)
Description Hrunting Johnson 2003-09-12 09:27:21 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b)
Gecko/20030910 Firebird/0.6.1+

Description of problem:
Normally, setuid() programs can't dump core.  However, a setuid() program should
be able to use prctl() (man prctl) to enable coredumps.  Under this kernel, that
doesn't seem to be the case.  

Basically, the end result is one cannot do any debugging of setuid programs,
which is a serious hinderance to the use of Linux as a development platform.

Here is a test script:

#include <stdio.h>
#include <sys/prctl.h>

int main(int argc, char* argv[]) {
  prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
  printf("sleeping for 20 seconds; kill me now\n");

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

How reproducible:

Steps to Reproduce:
1. ulimit -c unlimited
2. gcc t.c
3. ./a.out &
3. kill -SEGV <pid>

Actual Results:  Program dies, no core file is left

Expected Results:  Program dies, core file is left

Additional info:

Possibly related to this problem:
Comment 1 Joe Orton 2003-12-02 05:15:46 EST
*** Bug 98825 has been marked as a duplicate of this bug. ***
Comment 2 Joe Orton 2003-12-02 05:34:48 EST
This affects current 7.3 through 9 kernels.  Simple repro case:

#include <sys/types.h>
#include <sys/prctl.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>

int main(int argc, char **argv)
    if (prctl(PR_SET_DUMPABLE, 0) || prctl(PR_SET_DUMPABLE, 1)) {
        return 1;
    if (prctl(PR_GET_DUMPABLE) != 1) {
        fprintf(stderr, "prctl(PR_SET_DUMPABLE, 1) was ignored.\n");
        return 1;

    return 0;
Comment 3 Joe Orton 2003-12-02 05:38:16 EST
The fix is as simple as below IIRC:

--- kernel/sys.c.orig   Tue Dec  2 10:30:02 2003
+++ kernel/sys.c        Tue Dec  2 10:30:29 2003
@@ -1242,7 +1242,6 @@
                                error = -EINVAL;
-                       if (is_dumpable(current))
                                current->mm->dumpable = arg2;
                case PR_SET_UNALIGN:

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