Blame 0180-ccpp-ignore-crashes-of-ABRT-binaries-if-DebugLevel-0.patch

69165ba
From ab4351808352e00d72a7fd948e3e923d08e1a0fc Mon Sep 17 00:00:00 2001
69165ba
From: Jakub Filak <jfilak@redhat.com>
69165ba
Date: Wed, 30 Sep 2015 12:19:48 +0200
69165ba
Subject: [PATCH] ccpp: ignore crashes of ABRT binaries if DebugLevel == 0
69165ba
69165ba
Prior this commit abrt-hook-ccpp was saved core file of any
69165ba
crashed process executing program whose name starts with "abrt" in
69165ba
DUMP_LOCATION.
69165ba
69165ba
ABRT does not check size constraints of these core files, so the files
69165ba
could consume an uncontrolled amount of disk space.
69165ba
69165ba
Related to CVE-2015-5287
69165ba
Related: #1262252
69165ba
69165ba
Signed-off-by: Jakub Filak <jfilak@redhat.com>
69165ba
---
69165ba
 src/hooks/abrt-hook-ccpp.c | 7 +++++++
69165ba
 1 file changed, 7 insertions(+)
69165ba
69165ba
diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c
69165ba
index 12b3f118..7a19cc2 100644
69165ba
--- a/src/hooks/abrt-hook-ccpp.c
69165ba
+++ b/src/hooks/abrt-hook-ccpp.c
69165ba
@@ -842,6 +842,13 @@ int main(int argc, char** argv)
69165ba
     const char *last_slash = strrchr(executable, '/');
69165ba
     if (last_slash && strncmp(++last_slash, "abrt", 4) == 0)
69165ba
     {
69165ba
+        if (g_settings_debug_level == 0)
69165ba
+        {
69165ba
+            log_warning("Ignoring crash of %s (SIG%s).",
69165ba
+                        executable, signame ? signame : signal_str);
69165ba
+            goto finito;
69165ba
+        }
69165ba
+
69165ba
         /* If abrtd/abrt-foo crashes, we don't want to create a _directory_,
69165ba
          * since that can make new copy of abrtd to process it,
69165ba
          * and maybe crash again...
69165ba
-- 
69165ba
1.8.3.1
69165ba