dont send tainted kernel and broken bios
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
This commit is contained in:
parent
5dda991bbb
commit
926a045f87
2 changed files with 152 additions and 1 deletions
143
0001-not-send-tainted-kernel-and-broken-bios.patch
Normal file
143
0001-not-send-tainted-kernel-and-broken-bios.patch
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
From 446bc2d3798d34a4b552deea2ada35589286b2da Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <446bc2d3798d34a4b552deea2ada35589286b2da.1317997521.git.npajkovs@redhat.com>
|
||||
From: Nikola Pajkovsky <npajkovs@redhat.com>
|
||||
Date: Fri, 7 Oct 2011 16:25:10 +0200
|
||||
Subject: [PATCH] not send tainted kernel and broken bios
|
||||
|
||||
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
|
||||
---
|
||||
src/gui-gtk/main.c | 12 +++++++-
|
||||
src/plugins/abrt-dump-oops.c | 57 ++++++++++++++++++++---------------------
|
||||
2 files changed, 38 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c
|
||||
index 2e45090..02a9cfc 100644
|
||||
--- a/src/gui-gtk/main.c
|
||||
+++ b/src/gui-gtk/main.c
|
||||
@@ -73,13 +73,20 @@ static void add_directory_to_dirlist(const char *dirname)
|
||||
);
|
||||
const char *reported = (msg ? GTK_STOCK_YES : GTK_STOCK_NO);
|
||||
free(msg);
|
||||
- char *reason = dd_load_text(dd, FILENAME_REASON);
|
||||
+
|
||||
+ char *not_reportable_reason = dd_load_text_ext(dd, FILENAME_NOT_REPORTABLE, 0
|
||||
+ | DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE
|
||||
+ | DD_FAIL_QUIETLY_ENOENT
|
||||
+ | DD_FAIL_QUIETLY_EACCES);
|
||||
+ char *reason = NULL;
|
||||
+ if (!not_reportable_reason)
|
||||
+ reason = dd_load_text(dd, FILENAME_REASON);
|
||||
|
||||
GtkTreeIter iter;
|
||||
gtk_list_store_append(s_dumps_list_store, &iter);
|
||||
gtk_list_store_set(s_dumps_list_store, &iter,
|
||||
COLUMN_REPORTED, reported,
|
||||
- COLUMN_REASON, reason,
|
||||
+ COLUMN_REASON, not_reportable_reason? :reason,
|
||||
COLUMN_DIRNAME, dd->dd_dirname,
|
||||
//OPTION: time format
|
||||
COLUMN_LATEST_CRASH_STR, time_buf,
|
||||
@@ -87,6 +94,7 @@ static void add_directory_to_dirlist(const char *dirname)
|
||||
COLUMN_DUMP_DIR, dirname,
|
||||
-1);
|
||||
free(reason);
|
||||
+ free(not_reportable_reason);
|
||||
|
||||
dd_close(dd);
|
||||
VERB1 log("added: %s", dirname);
|
||||
diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c
|
||||
index b43d507..05c62b0 100644
|
||||
--- a/src/plugins/abrt-dump-oops.c
|
||||
+++ b/src/plugins/abrt-dump-oops.c
|
||||
@@ -480,16 +480,6 @@ static unsigned save_oops_to_dump_dir(GList *oops_list, unsigned oops_cnt)
|
||||
|
||||
VERB1 log("Saving %u oopses as dump dirs", idx >= countdown ? countdown-1 : idx);
|
||||
|
||||
- char *tainted_str = NULL;
|
||||
- FILE *tainted_fp = fopen("/proc/sys/kernel/tainted", "r");
|
||||
- if (tainted_fp)
|
||||
- {
|
||||
- tainted_str = xmalloc_fgetline(tainted_fp);
|
||||
- fclose(tainted_fp);
|
||||
- }
|
||||
- else
|
||||
- perror_msg("Can't open '%s'", "/proc/sys/kernel/tainted");
|
||||
-
|
||||
char *cmdline_str = NULL;
|
||||
FILE *cmdline_fp = fopen("/proc/cmdline", "r");
|
||||
if (cmdline_fp)
|
||||
@@ -535,27 +525,29 @@ static unsigned save_oops_to_dump_dir(GList *oops_list, unsigned oops_cnt)
|
||||
if (cmdline_str)
|
||||
dd_save_text(dd, FILENAME_CMDLINE, cmdline_str);
|
||||
dd_save_text(dd, FILENAME_BACKTRACE, second_line);
|
||||
-// TODO: add "Kernel oops: " prefix, so that all oopses have recognizable FILENAME_REASON?
|
||||
-// kernel oops 1st line may look quite puzzling otherwise...
|
||||
- strchrnul(second_line, '\n')[0] = '\0';
|
||||
- dd_save_text(dd, FILENAME_REASON, second_line);
|
||||
-
|
||||
- if (tainted_str && tainted_str[0] != '0')
|
||||
- {
|
||||
- unsigned long tainted = xatoi_positive(tainted_str);
|
||||
- char *tainted_short = kernel_tainted_short(tainted);
|
||||
- GList *tainted_long = kernel_tainted_long(tainted);
|
||||
|
||||
- struct strbuf *tnt_long = strbuf_new();
|
||||
- for (GList *li = tainted_long; li; li = li->next)
|
||||
- strbuf_append_strf(tnt_long, "%s\n", (char*) li->data);
|
||||
+ /* check if trace doesn't have line: 'Your BIOS is broken' */
|
||||
+ char *broken_bios = strstr(second_line, "Your BIOS is broken");
|
||||
+ if (broken_bios)
|
||||
+ dd_save_text(dd, FILENAME_NOT_REPORTABLE, "Your BIOS is broken");
|
||||
|
||||
- dd_save_text(dd, FILENAME_TAINTED, tainted_str);
|
||||
+ char *tainted_short = kernel_tainted_short(second_line);
|
||||
+ if (tainted_short)
|
||||
+ {
|
||||
+ VERB1 log("Kernel is tainted '%s'", tainted_short);
|
||||
dd_save_text(dd, FILENAME_TAINTED_SHORT, tainted_short);
|
||||
- dd_save_text(dd, FILENAME_TAINTED_LONG, tnt_long->buf);
|
||||
- strbuf_free(tnt_long);
|
||||
- list_free_with_free(tainted_long);
|
||||
+ char *reason = xasprintf("Your kernel is tainted by flags '%s'. "
|
||||
+ "Kernel maintainers are not interesting about "
|
||||
+ "tainted kernel, because the trace might not be showing "
|
||||
+ "the root problem."
|
||||
+ , tainted_short);
|
||||
+ dd_save_text(dd, FILENAME_NOT_REPORTABLE, reason);
|
||||
+ free(reason);
|
||||
}
|
||||
+// TODO: add "Kernel oops: " prefix, so that all oopses have recognizable FILENAME_REASON?
|
||||
+// kernel oops 1st line may look quite puzzling otherwise...
|
||||
+ strchrnul(second_line, '\n')[0] = '\0';
|
||||
+ dd_save_text(dd, FILENAME_REASON, second_line);
|
||||
|
||||
dd_close(dd);
|
||||
}
|
||||
@@ -563,7 +555,6 @@ static unsigned save_oops_to_dump_dir(GList *oops_list, unsigned oops_cnt)
|
||||
errors++;
|
||||
}
|
||||
|
||||
- free(tainted_str);
|
||||
free(cmdline_str);
|
||||
|
||||
return errors;
|
||||
@@ -711,7 +702,15 @@ int main(int argc, char **argv)
|
||||
{
|
||||
int i = 0;
|
||||
while (i < oops_cnt)
|
||||
- printf("\nVersion: %s", (char*)g_list_nth_data(oops_list, i++));
|
||||
+ {
|
||||
+ char *kernel_bt = (char*)g_list_nth_data(oops_list, i++);
|
||||
+ char *tainted_short = kernel_tainted_short(kernel_bt);
|
||||
+ if (tainted_short)
|
||||
+ log("Kernel is tainted '%s'", tainted_short);
|
||||
+
|
||||
+ free(tainted_short);
|
||||
+ printf("\nVersion: %s", kernel_bt);
|
||||
+ }
|
||||
}
|
||||
if (opts & OPT_d)
|
||||
{
|
||||
--
|
||||
1.7.7.rc0.70.g82660
|
||||
|
||||
10
abrt.spec
10
abrt.spec
|
|
@ -10,7 +10,7 @@
|
|||
Summary: Automatic bug detection and reporting tool
|
||||
Name: abrt
|
||||
Version: 2.0.3
|
||||
Release: 4%{?dist}
|
||||
Release: 5%{?dist}
|
||||
License: GPLv2+
|
||||
Group: Applications/System
|
||||
URL: https://fedorahosted.org/abrt/
|
||||
|
|
@ -27,6 +27,7 @@ Patch7: 0006-rhbz-671354-RFE-Configurable-core-dump-location.patch
|
|||
Patch8: 0007-abrtd-pipe-post-create-output-to-log.-Closes-bz-6991.patch
|
||||
Patch9: 0001-a-a-save-package-data-Fix-NULL-dereference.patch
|
||||
Patch10: 0001-Fix-free-space-checking.patch
|
||||
Patch11: 0001-not-send-tainted-kernel-and-broken-bios.patch
|
||||
BuildRequires: dbus-devel
|
||||
BuildRequires: gtk2-devel
|
||||
BuildRequires: curl-devel
|
||||
|
|
@ -226,6 +227,7 @@ Virtual package to make easy default installation on desktop environments.
|
|||
%patch8 -p1 -b .abrtd-pipe-post-create-output-to-log.-Closes-bz-6991.patch
|
||||
%patch9 -p1 -b .a-a-save-package-data-Fix-NULL-dereference.patch
|
||||
%patch10 -p1 -b .Fix-free-space-checking.patch
|
||||
%patch11 -p1
|
||||
|
||||
%build
|
||||
autoconf
|
||||
|
|
@ -527,6 +529,12 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
|||
%defattr(-,root,root,-)
|
||||
|
||||
%changelog
|
||||
* Fri Oct 07 2011 Nikola Pajkovsky <npajkovs@redhat.com> - 2.0.3-5
|
||||
- don't file kernel bugs if "tainted: B" is set.
|
||||
- don't file bugs about BIOS bugs.
|
||||
- incorrect TAINTED description in bugs.
|
||||
- Resoves: #718097 #708534 724838
|
||||
|
||||
* Tue Sep 13 2011 Nikola Pajkovsky <npajkovs@redhat.com> 2.0.3-4
|
||||
- fixed sigsegv in a-a-save-package-data rhbz#737961
|
||||
- fixed privs for /var/run/abrt rhbz#725974
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue