mii module broken under new scheme
Linus, this is a better fix, until the module post-link patch goes in (rth and I are working on it, Kai likes the idea for other reasons).
Once again, fix up my assumptions so we err on the side of not breaking anything.
Untested (on plane home and low on battery), but trivial.
Hope this helps,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
kernel/module.c +11 -8
@@ -895,12 +895,6 @@ static struct module *load_module(void *#endif } -if (!modnameindex) { -DEBUGP ("Module has no name!\n" ); - err = -ENOEXEC ; - goto free_hdr; - } -/* Now allocate space for the module proper, and copy name and args. */ err =strlen_user (uargs);if (err <0 )
@@ -917,8 +911,17 @@ static struct module *load_module(void * err = -EFAULT ; goto free_mod; } -strncpy (mod->name, (char *)hdr + sechdrs[modnameindex].sh_offset, -sizeof (mod->name)-1 ); + +if (modnameindex) +strncpy (mod->name, + (char *)hdr + sechdrs[modnameindex].sh_offset, +sizeof (mod->name)-1 ); +else { +/* FIXME: With module post-link phase, always insert +.modname section. --RR */ +static unsigned int num_unknown; +sprintf (mod->name,"unknown%u" , num_unknown++); + }if (find_module (mod->name)) { err = -EEXIST ;