diff options
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | examples/taint/.gitignore | 1 | ||||
-rw-r--r-- | examples/taint/Makefile | 8 | ||||
-rw-r--r-- | examples/taint/taint.c | 21 | ||||
-rw-r--r-- | inc/crash_types.h | 1 | ||||
-rw-r--r-- | lib/Plugins/Bugzilla.cpp | 11 | ||||
-rw-r--r-- | lib/Plugins/KerneloopsScanner.cpp | 15 |
7 files changed, 59 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 34392bd0..68f87b58 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,7 @@ AC_INIT([abrt], [1.1.14], [crash-catcher@fedorahosted.org]) AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign silent-rules]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug], diff --git a/examples/taint/.gitignore b/examples/taint/.gitignore new file mode 100644 index 00000000..24600083 --- /dev/null +++ b/examples/taint/.gitignore @@ -0,0 +1 @@ +!Makefile diff --git a/examples/taint/Makefile b/examples/taint/Makefile new file mode 100644 index 00000000..a76c46b7 --- /dev/null +++ b/examples/taint/Makefile @@ -0,0 +1,8 @@ +obj-m += taint.o + +all: + make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules + +clean: + make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean + diff --git a/examples/taint/taint.c b/examples/taint/taint.c new file mode 100644 index 00000000..be6f0a20 --- /dev/null +++ b/examples/taint/taint.c @@ -0,0 +1,21 @@ +/* + * hello-1.c - The simplest kernel module. + */ +#include <linux/module.h> /* Needed by all modules */ +#include <linux/kernel.h> /* Needed for KERN_INFO */ + +int init_module(void) +{ + printk(KERN_INFO "Hello world\n"); + /* + * A non 0 return means init_module failed; module can't be loaded. + */ + return 0; +} + +void cleanup_module(void) +{ + printk(KERN_INFO "Goodbye world\n"); +} + +MODULE_LICENSE("TAINT"); diff --git a/inc/crash_types.h b/inc/crash_types.h index 25dbcd46..5eba6480 100644 --- a/inc/crash_types.h +++ b/inc/crash_types.h @@ -49,6 +49,7 @@ #define FILENAME_REPRODUCE "reproduce" #define FILENAME_RATING "rating" #define FILENAME_HOSTNAME "hostname" +#define FILENAME_TAINTED "tainted" // Optional. Set to "1" by abrt-handle-upload for every unpacked crashdump #define FILENAME_REMOTE "remote" // TODO: TicketUploader also has open-coded "TICKET", "CUSTOMER" files diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index f3967cdf..e4255d2e 100644 --- a/lib/Plugins/Bugzilla.cpp +++ b/lib/Plugins/Bugzilla.cpp @@ -396,6 +396,8 @@ xmlrpc_int32 ctx::new_bug(const map_crash_data_t& pCrashData, int depend_on_bugn const std::string& duphash = get_crash_data_item_content(pCrashData, CD_DUPHASH); const char *reason = get_crash_data_item_content_or_NULL(pCrashData, FILENAME_REASON); const char *function = get_crash_data_item_content_or_NULL(pCrashData, FILENAME_CRASH_FUNCTION); + const char *analyzer = get_crash_data_item_content_or_NULL(pCrashData, FILENAME_ANALYZER); + const char *tainted = get_crash_data_item_content_or_NULL(pCrashData, FILENAME_TAINTED); std::string summary = "[abrt] " + package; if (function != NULL && strlen(function) < 30) @@ -409,6 +411,15 @@ xmlrpc_int32 ctx::new_bug(const map_crash_data_t& pCrashData, int depend_on_bugn summary += ": "; summary += reason; } + + if (tainted && analyzer + && (tainted[0] == '1') + && (strcmp(analyzer, "Kerneloops") == 0) + ) { + summary += ": "; + summary += "TAINTED"; + } + std::string status_whiteboard = "abrt_hash:" + duphash; std::string description = "abrt version: "VERSION"\n"; diff --git a/lib/Plugins/KerneloopsScanner.cpp b/lib/Plugins/KerneloopsScanner.cpp index dc1f6d0a..8f2987be 100644 --- a/lib/Plugins/KerneloopsScanner.cpp +++ b/lib/Plugins/KerneloopsScanner.cpp @@ -122,6 +122,20 @@ void save_oops_to_debug_dump(const vector_string_t& oopsList) VERB1 log("Saving %u oopses as crash dump dirs", idx >= countdown ? countdown-1 : idx); + char tainted[1] = {'-1'}; + /* once tainted flag is set to 1, only restart can reset the flag to 0 */ + int tainted_fd = open("/proc/sys/kernel/tainted", O_RDONLY); + if (tainted_fd > 0) + { + /* contain only 0 or 1 */ + if (read(tainted_fd, &tainted, 1) != 1) + error_msg("Unable to read one byte from /proc/sys/kernel/tainted"); + + close(tainted_fd); + } + else + error_msg("/proc/sys/kernel/tainted does not exist"); + while (idx != 0 && --countdown != 0) { char path[sizeof(DEBUG_DUMPS_DIR"/kerneloops-%lu-%lu-%lu") + 3 * sizeof(long)*3]; @@ -143,6 +157,7 @@ void save_oops_to_debug_dump(const vector_string_t& oopsList) /* Optional, makes generated bz more informative */ strchrnul(second_line, '\n')[0] = '\0'; dd.SaveText(FILENAME_REASON, second_line); + dd.SaveText(FILENAME_TAINTED, tainted); } catch (CABRTException& e) { |