public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paulo Marques <pmarques@grupopie.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: /proc/kallsyms race vs module unload
Date: Tue, 13 Mar 2007 18:49:50 +0000	[thread overview]
Message-ID: <45F6F24E.4080600@grupopie.com> (raw)
In-Reply-To: <20070313181815.GA5580@martell.zuzino.mipt.ru>

Alexey Dobriyan wrote:
> [...]
> What happens is that module_get_kallsym() drops module_mutex,
> returns "struct module *", module unloaded, "struct module *"
> used.

The only use for the "struct module *" is to display the name of the 
module.

This can be solved by adding a "char mod_name[MODULE_NAME_LEN];" field 
to "kallsym_iter" and copy the name of the module over, while still 
holding module_mutex. It would be slightly slower, but safer.

We can even change the function's interface, so that it doesn't return a 
"struct module *" at all, since AFAICS kallsyms is the only user of that 
function.

It will still produce strange artifacts, though. If the iterator is 
already past the removed module symbols, it will skip as many symbols as 
the module symbol count, failing to show some symbols from unrelated 
modules. It won't oops, though.

I'll try to cook up a patch, if no one objects to this approach,

-- 
Paulo Marques - www.grupopie.com

"There cannot be a crisis today; my schedule is already full."

  reply	other threads:[~2007-03-13 18:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-13 18:18 /proc/kallsyms race vs module unload Alexey Dobriyan
2007-03-13 18:49 ` Paulo Marques [this message]
2007-03-13 23:07   ` Alexey Dobriyan
2007-03-14 12:17     ` Paulo Marques

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=45F6F24E.4080600@grupopie.com \
    --to=pmarques@grupopie.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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