LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Paulo Marques <pmarques@grupopie.com>
To: Alexey Dobriyan <adobriyan@sw.ru>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, devel@openvz.org,
	rusty@rustcorp.com.au
Subject: Re: [PATCH v3] Race between cat /proc/kallsyms and rmmod
Date: Mon, 19 Mar 2007 15:20:43 +0000	[thread overview]
Message-ID: <45FEAA4B.4030302@grupopie.com> (raw)
In-Reply-To: <20070319143317.GB6805@localhost.sw.ru>

Alexey Dobriyan wrote:
> Iterating code of /proc/kallsyms calls module_get_kallsym() which grabs
> and drops module_mutex internally and returns "struct module *",
> module is removed, aforementioned "struct module *" is used in non-trivial
> way.
> 
> Steps to reproduce:
> 
> 	modprobe/rmmod loop
> 	cat /proc/kallsyms >/dev/null loop
> 
> Copy all needed info under module_mutex.
> 
> NOTE: this patch keeps module_mutex static.

Yes, this patch fixes the "cat /proc/kallsyms" race without changing any 
"external" interfaces, so I think it should go into mainline in any case.

Acked-by: Paulo Marques <pmarques@grupopie.com>

-- 
Paulo Marques - www.grupopie.com

"All I ask is a chance to prove that money can't make me happy."

  reply	other threads:[~2007-03-19 15:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-16 11:42 [PATCH RESEND 1/2] " Alexey Dobriyan
2007-03-19 14:33 ` [PATCH v3] " Alexey Dobriyan
2007-03-19 15:20   ` Paulo Marques [this message]
2007-03-19 23:35   ` 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=45FEAA4B.4030302@grupopie.com \
    --to=pmarques@grupopie.com \
    --cc=adobriyan@sw.ru \
    --cc=akpm@osdl.org \
    --cc=devel@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --subject='Re: [PATCH v3] Race between cat /proc/kallsyms and rmmod' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).