lkml.org 
[lkml]   [2006]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectPatch 2.4 kernel / allow to read more than 2048 (1821) Symbols from /boot/System.map
Date
From
Problem:
The 2.4 kernel series uses sys32_get_kernel_syms(struct kernel_sym32 *table) for reading the kernel symbols (on sparc64). The size of struct kernel_sym is 64 byte on "normal" arches, but 72 byte on sparc64.
The memory for the table holding all the structs is currently kmalloc'd, giving a limitation of 2048*sizeof(struct kernel_sym) for "normal" and 1820*sizeof(struct kernel_sym) for "sparc64" arches, the latter being caused by different sizes of unsigned longs and the need for alingnment bytes. This causes an "error reading System.map" message for no reason.

Solution (significantly helped by Dave Miller):
replace kmalloc() by vmalloc() to circumvent the size limit of 2^17 for kmalloc.

Other arches:
ppc64 defines value in struct kernel_sym as u32 in contrast to sparc, so we have the 2048 units limit here, but this would profit from using vmalloc(), too, since the limitation to 2048 is neither helpful nor neccessary. I lack sufficient understanding of the details to predict the impact on other arches. This patch refers to sparc64 but someone with deeper insight might want to look into this for other arches, too.

Signed off by: Dieter Jurzitza <DJurzitza@HarmanBecker.com>

--- linux/arch/sparc64/kernel/sys_sparc32.c 2006-08-11 06:18:20.000000000 +
+++ linux/arch/sparc64/kernel/sys_sparc32.c 2006-08-25 12:37:42.000000000 +
@@ -3730,7 +3730,7 @@

len = sys_get_kernel_syms(NULL);
if (!table) return len;
- tbl = kmalloc (len * sizeof (struct kernel_sym), GFP_KERNEL);
+ tbl = vmalloc (len * sizeof (struct kernel_sym));
if (!tbl) return -ENOMEM;
old_fs = get_fs();
set_fs (KERNEL_DS);
@@ -3741,7 +3741,7 @@
copy_to_user (table->name, tbl[i].name, 60))
break;
}
- kfree (tbl);
+ vfree (tbl);
return i;
}

--
________________________________________________
HARMAN BECKER AUTOMOTIVE SYSTEMS

Dr.-Ing. Dieter Jurzitza
Manager Hardware Systems
System Development

Industriegebiet Ittersbach
Becker-Göring Str. 16
D-76307 Karlsbad / Germany

Phone: +49 (0)7248 71-1577
Fax: +49 (0)7248 71-1216
eMail: DJurzitza@harmanbecker.com
Internet: http://www.becker.de



*******************************************
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the contents in this e-mail is strictly forbidden.
*******************************************
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-09-18 07:27    [W:0.048 / U:0.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site