[kernel] Attempt to fix rhbz #736815 by printing spaces before the brackets

Chuck Ebbert cebbert at fedoraproject.org
Wed Dec 7 15:14:57 UTC 2011


commit ede16e85795fd0c469622fcc6eb0273aed3f798d
Author: Chuck Ebbert <cebbert at redhat.com>
Date:   Wed Dec 7 10:13:53 2011 -0500

    Attempt to fix rhbz #736815 by printing spaces before the brackets

 kernel.spec                        |    9 +++++
 x86-code-dump-fix-truncation.patch |   70 ++++++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+), 0 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index a8dfdcb..0606120 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -728,6 +728,9 @@ Patch21029: nfsv4-include-bitmap-in-nfsv4_get_acl_data.patch
 #rhbz 590880
 Patch21030: alps.patch
 
+# rhbz 736815
+Patch21040: x86-code-dump-fix-truncation.patch
+
 # compat-wireless patches
 Patch50000: compat-wireless-config-fixups.patch
 Patch50001: compat-add-module_usb_driver-and-module_platform_driver.patch
@@ -1405,6 +1408,9 @@ ApplyPatch nfsv4-include-bitmap-in-nfsv4_get_acl_data.patch
 #rhbz 590880
 ApplyPatch alps.patch
 
+# rhbz 736815
+ApplyPatch x86-code-dump-fix-truncation.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2213,6 +2219,9 @@ fi
 #                 ||----w |
 #                 ||     ||
 %changelog
+* Wed Dec 07 2011 Chuck Ebbert <cebbert at redhat.com>
+- Attempt to fix rhbz #736815 by printing spaces before the brackets
+
 * Tue Dec 06 2011 Dave Jones <davej at redhat.com> 3.2.0-0.rc4.git4.2.fc17
 - Linux 3.2-rc4-git2 (b835c0f47f725d864bf2545f10c733b754bb6d51)
 
diff --git a/x86-code-dump-fix-truncation.patch b/x86-code-dump-fix-truncation.patch
new file mode 100644
index 0000000..a20f181
--- /dev/null
+++ b/x86-code-dump-fix-truncation.patch
@@ -0,0 +1,70 @@
+After this patch, kernel code dumps have been sometimes truncated
+in the system log:
+
+ commit 9d90c8d9cde929cbc575098e825d7c29d9f45054
+ "printk: do not mangle valid userspace syslog prefixes"
+
+The new code is interpreting the bracketed code byte as a loglevel
+when it happens to have a legal value for that. Fix it by prefixing
+the output with a space.
+
+Signed-off-by: Chuck Ebbert <cebbert at redhat.com>
+---
+RHBZ #736815
+
+--- a/arch/x86/kernel/dumpstack_32.c
++++ b/arch/x86/kernel/dumpstack_32.c
+@@ -105,7 +105,7 @@ void show_registers(struct pt_regs *regs
+ 		printk(KERN_EMERG "Stack:\n");
+ 		show_stack_log_lvl(NULL, regs, &regs->sp, 0, KERN_EMERG);
+ 
+-		printk(KERN_EMERG "Code: ");
++		printk(KERN_EMERG "Code:");
+ 
+ 		ip = (u8 *)regs->ip - code_prologue;
+ 		if (ip < (u8 *)PAGE_OFFSET || probe_kernel_address(ip, c)) {
+@@ -116,13 +116,13 @@ void show_registers(struct pt_regs *regs
+ 		for (i = 0; i < code_len; i++, ip++) {
+ 			if (ip < (u8 *)PAGE_OFFSET ||
+ 					probe_kernel_address(ip, c)) {
+-				printk(" Bad EIP value.");
++				printk("  Bad EIP value.");
+ 				break;
+ 			}
+ 			if (ip == (u8 *)regs->ip)
+-				printk("<%02x> ", c);
++				printk(" <%02x>", c);
+ 			else
+-				printk("%02x ", c);
++				printk(" %02x", c);
+ 		}
+ 	}
+ 	printk("\n");
+--- a/arch/x86/kernel/dumpstack_64.c
++++ b/arch/x86/kernel/dumpstack_64.c
+@@ -273,7 +273,7 @@ void show_registers(struct pt_regs *regs
+ 		show_stack_log_lvl(NULL, regs, (unsigned long *)sp,
+ 				   0, KERN_EMERG);
+ 
+-		printk(KERN_EMERG "Code: ");
++		printk(KERN_EMERG "Code:");
+ 
+ 		ip = (u8 *)regs->ip - code_prologue;
+ 		if (ip < (u8 *)PAGE_OFFSET || probe_kernel_address(ip, c)) {
+@@ -284,13 +284,13 @@ void show_registers(struct pt_regs *regs
+ 		for (i = 0; i < code_len; i++, ip++) {
+ 			if (ip < (u8 *)PAGE_OFFSET ||
+ 					probe_kernel_address(ip, c)) {
+-				printk(" Bad RIP value.");
++				printk("  Bad RIP value.");
+ 				break;
+ 			}
+ 			if (ip == (u8 *)regs->ip)
+-				printk("<%02x> ", c);
++				printk(" <%02x>", c);
+ 			else
+-				printk("%02x ", c);
++				printk(" %02x", c);
+ 		}
+ 	}
+ 	printk("\n");


More information about the scm-commits mailing list