mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Adam J. Richter" <adam@yggdrasil.com>
To: rusty@rustcorp.com.au
Cc: linux-kernel@vger.kernel.org
Subject: 2.5.70-bk1[23]: load_module crashes when aborting module load
Date: Mon, 9 Jun 2003 03:14:49 -0700	[thread overview]
Message-ID: <200306091014.h59AEnU08591@adam.yggdrasil.com> (raw)

Hi Rusty,

	I thought I should report this problem to you now, as I'm
about to have to explore some code that I'm not too familiar with
(vfree) as I continue debugging it.  Also note I am running a
modified kernel/module.c, so it is remotely possible that this problem
is self-inflicted, but I don't think so.

	In 2.5.70-bk1[23], I get a kernel bad memory reference
when trying load a module with an undefined symbol that is not found.
The bad memory reference occurs in load_module after the call
to module_free(mod,mod->module_core), the next time that "mod" is
dereferenced.   Here is a commented excerpt from load_module
in kernel/module.c:

 cleanup:
        module_unload_free(mod);
        module_free(mod, mod->module_init);
 free_core:
        module_free(mod, mod->module_core);
	/* The following "if" statement generates a kernel bad memory
	   reference.  --Adam */
 free_percpu:
        if (mod->percpu)
                percpu_modfree(mod->percpu);

	For whatever reason, module->module_core (ee820000) points to
an address slightly before mod (mod = ee828780, the bad dereference
is to ee8298a4).  On x86, module_free() is vfree().  I suspect that
somehow vfree() has gotten confused.

	By the way, there also seems to be a bug in the
2.5.70-bk12/kernel/module.c changes where mod->percpu is left unitialized
if a module has no per-cpu data.  I've verified that there really is a
junk non-zero value in mod->percpu in that case.  However, fixing that
bug does not eliminate this problem.

Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Miplitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

             reply	other threads:[~2003-06-09 10:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-09 10:14 Adam J. Richter [this message]
2003-06-10  1:39 ` Rusty Russell
2003-06-10  8:48   ` Milton Miller
2003-06-11  5:47     ` Rusty Russell
2003-06-11  3:44 Randy.Dunlap
2003-06-11 23:43 Adam J. Richter

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=200306091014.h59AEnU08591@adam.yggdrasil.com \
    --to=adam@yggdrasil.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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

all inboxes | Powered by JetHome®