linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Cc: andrew.morton@digeo.com
Subject: [PATCH] Fix kallsyms crashes in 2.5.54
Date: Thu, 2 Jan 2003 10:13:25 +0100	[thread overview]
Message-ID: <20030102091325.GA24352@averell> (raw)


The kernel symbol stem compression patch included in 2.5.54 unfortunately
had a few problems, triggered by various circumstances.

On some gas \x... in string constants seems to randomly eat any following
hex like character.

Hardens it more against bogus symbol table entries.

This should fix the reported crashes. No need anymore for akpm to 
back it out.

Please apply.

-Andi



--- linux-vanilla/kernel/kallsyms.c	2003-01-02 06:55:55.000000000 +0100
+++ linux/kernel/kallsyms.c	2003-01-02 11:06:30.000000000 +0100
@@ -32,6 +32,7 @@
 		BUG();
 
 	namebuf[127] = 0;
+	namebuf[0] = 0;
 
 	if (addr >= (unsigned long)_stext && addr <= (unsigned long)_etext) {
 		unsigned long symbol_end;
@@ -46,9 +47,9 @@
 
 		/* Grab name */
 		for (i = 0; i < best; i++) { 
-			++name;
-			strncpy(namebuf + name[-1], name, 127); 
-			name += strlen(name)+1;
+			unsigned prefix = *name++;
+			strncpy(namebuf + prefix, name, 127); 
+			name += strlen(name) + 1; 
 		} 
 
 		/* Base symbol size on next symbol. */
--- linux-vanilla/scripts/kallsyms.c	2003-01-02 06:55:56.000000000 +0100
+++ linux/scripts/kallsyms.c	2003-01-02 11:02:18.000000000 +0100
@@ -144,7 +144,7 @@
 		for (k = 0; table[i].sym[k] && table[i].sym[k] == prev[k]; ++k)
 			; 
 
-		printf("\t.asciz\t\"\\x%02x%s\"\n", k, table[i].sym + k);
+		printf("\t.byte 0x%02x ; .asciz\t\"%s\"\n", k, table[i].sym + k);
 		last_addr = table[i].addr;
 		prev = table[i].sym;
 	}

             reply	other threads:[~2003-01-02  9:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-02  9:13 Andi Kleen [this message]
2003-01-02 11:52 ` [PATCH] Fix kallsyms crashes in 2.5.54 Andrew Morton
2003-01-02 12:00   ` Andi Kleen
2003-01-02 12:16     ` Andrew Morton
2003-01-02 13:06       ` One-way Gigabit Ethernet TCP performance with Jumbo frames Steffen Persvold
2003-01-03 13:25         ` Robert Olsson
2003-01-02 18:02     ` [PATCH] Fix kallsyms crashes in 2.5.54 Rudmer van Dijk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030102091325.GA24352@averell \
    --to=ak@muc.de \
    --cc=andrew.morton@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).