Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

James Bottomley and committed by
Linus Torvalds
1b364bf4 7d1d16e4

+2 -1
+2 -1
kernel/module.c
··· 2355 2355 if (err < 0) 2356 2356 goto unlink; 2357 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 2361 /* Get rid of temporary copy */ 2361 2362 vfree(hdr);