Stop setting the PR_SET_DUMPABLE flag for crash-manager processes 97/176597/2
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Fri, 20 Apr 2018 06:35:39 +0000 (08:35 +0200)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 29 May 2018 08:15:56 +0000 (08:15 +0000)
prctl(PR_SET_DUMPABLE, 0) is not neccessary. Kernel runs the
crash-manager and sets RLIMIT_CORE to 1 for the process. This is special
value that prevents from running crash-manager recursively.

Change-Id: I33df7c28c6ce939f2903d02af673734d473b649e

src/crash-manager/crash-manager.c
src/crash-pipe/crash-pipe.c
src/crash-stack/crash-stack.c

index cc409d41d837aa3ebe53308a7163794b56dbffa3..d1fe227f4f6c43e94407caea6ac7011fee314697 100644 (file)
@@ -807,9 +807,14 @@ int main(int argc, char *argv[])
        int debug_mode = access(DEBUGMODE_PATH, F_OK) == 0;
 #endif
 
-       prctl(PR_SET_DUMPABLE, 0);
+       /*
+        * prctl(PR_SET_DUMPABLE, 0) is not neccessary. Kernel runs the
+        * crash-manager and sets RLIMIT_CORE to 1 for the process. This is special
+        * value that prevents from running crash-manager recursively.
+        */
 
        /* Get Configuration */
+
        get_config();
 
        /* Create crash directories */
index 0a8cb4d102f05d7ec730d7f51f93092cb3bd3304..e6759c391dc2dafd708547cc3ec12061f386336b 100644 (file)
@@ -127,8 +127,6 @@ int main(int argc, char *argv[])
        char *opt_save_core = NULL;
        int ret = 1;
 
-       prctl(PR_SET_DUMPABLE, 0);
-
        argv0 = argv[0];
 
        while ((c = getopt_long_only(argc, argv, "", opts, NULL)) != -1) {
index add619b2dae9e4b90e194e520352d922c8e0f46e..73d6bd26e521ce036a01257657c4712f501bf209 100644 (file)
@@ -934,8 +934,6 @@ int main(int argc, char **argv)
        pid_t tid = 0;
        char bufferfile_path[20] = "/tmp/crash.XXXXXX";
 
-       prctl(PR_SET_DUMPABLE, 0);
-
        while ((c = getopt_long_only(argc, argv, "", opts, NULL)) != -1) {
                switch (c) {
                case OPT_PID: