aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2009-08-26 08:34:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-08-27 15:33:19 -0400
commit1b364bf438cf337a3818aee77d68c0713f3e1fc4 (patch)
tree878d30319bd3721c6075eef8f3341c6fa9a5afd6 /kernel/module.c
parent7d1d16e416e61aeef8655d542f8e4a4fc6e808e4 (diff)
module: workaround duplicate section names
The root cause is a duplicate section name (.text); is this legal? [ Amerigo Wang: "AFAIK, yes." ] However, there's a problem with commit 6d76013381ed28979cd122eb4b249a88b5e384fa in that if you fail to allocate a mod->sect_attrs (in this case it's null because of the duplication), it still gets used without checking in add_notes_attrs() This should fix it [ This patch leaves other problems, particularly the sections directory, but recent parisc toolchains seem to produce these modules and this prevents a crash and is a minimal change -- RR ] Signed-off-by: James Bottomley <James.Bottomley@suse.de> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Tested-by: Helge Deller <deller@gmx.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 07c80e68a6c4..eccb561dd8a3 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2355,7 +2355,8 @@ static noinline struct module *load_module(void __user *umod,
2355 if (err < 0) 2355 if (err < 0)
2356 goto unlink; 2356 goto unlink;
2357 add_sect_attrs(mod, hdr->e_shnum, secstrings, sechdrs); 2357 add_sect_attrs(mod, hdr->e_shnum, secstrings, sechdrs);
2358 add_notes_attrs(mod, hdr->e_shnum, secstrings, sechdrs); 2358 if (mod->sect_attrs)
2359 add_notes_attrs(mod, hdr->e_shnum, secstrings, sechdrs);
2359 2360
2360 /* Get rid of temporary copy */ 2361 /* Get rid of temporary copy */
2361 vfree(hdr); 2362 vfree(hdr);