mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Petr Vandrovec <VANDROVE@vc.cvut.cz>
Cc: linux-kernel@vger.kernel.org, rusty@rustcorp.com.au,
	arashi@arashi.yi.org, Linus Torvalds <torvalds@transmeta.com>
Subject: Re: [PATCH] mii module broken under new scheme
Date: Wed, 20 Nov 2002 09:23:01 +1100	[thread overview]
Message-ID: <20021120072653.BFDC42C056@lists.samba.org> (raw)

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.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5-bk/kernel/module.c working-2.5-bk-modname/kernel/module.c
--- linux-2.5-bk/kernel/module.c	2002-11-20 05:58:00.000000000 +1100
+++ working-2.5-bk-modname/kernel/module.c	2002-11-20 09:18:04.000000000 +1100
@@ -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;

             reply	other threads:[~2002-11-20  7:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-19 22:23 Rusty Russell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-11-19 18:21 Petr Vandrovec
2002-11-19 18:44 ` Jeff Garzik
2002-11-19 22:07   ` Rusty Russell
2002-11-19 21:49 ` Rusty Russell
2002-11-19 18:14 Petr Vandrovec
2002-11-19 18:42 ` Jeff Garzik
2002-11-19 19:46 ` David Woodhouse
2002-11-19 17:50 Matt Reppert
2002-11-19 17:51 ` Jeff Garzik
2002-11-19 18:15   ` Matt Reppert
2002-11-19 18:37     ` Jeff Garzik
2002-11-21 21:34       ` Bill Davidsen
2002-11-19 21:38   ` Rusty Russell
2002-11-19 19:29 ` Alan Cox
2002-12-02  4:51 ` Rusty Russell

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=20021120072653.BFDC42C056@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=VANDROVE@vc.cvut.cz \
    --cc=arashi@arashi.yi.org \
    --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

Powered by JetHome