mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Bruce Allan <bwa@us.ibm.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>,
	Neil Brown <neilb@cse.unsw.edu.au>,
	linux-nfs <nfs@lists.sourceforge.net>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sunrpc: cache_register can use wrong module reference
Date: Tue, 2 Aug 2005 22:51:00 +0100	[thread overview]
Message-ID: <20050802215100.GA19079@infradead.org> (raw)
In-Reply-To: <1123018176.3954.118.camel@w-bwa3.beaverton.ibm.com>

On Tue, Aug 02, 2005 at 02:29:36PM -0700, Bruce Allan wrote:
> [resending to Neil, Trond and linux-nfs list; initial copy to lkml]
> 
> When registering an RPC cache, cache_register() always sets the owner as
> the sunrpc module.  However, there are RPC caches owned by other modules. 
> With the incorrect owner setting, the real owning module can be removed
> potentially with an open reference to the cache from userspace.
> 
> For example, if one were to stop the nfs server and unmount the nfsd
> filesystem, the nfsd module could be removed eventhough rpc.idmapd had
> references to the idtoname and nametoid caches (i.e.
> /proc/net/rpc/nfs4.<cachename>/channel is still open).  This resulted in
> a system panic on one of our machines when attempting to restart the nfs
> services after reloading the nfsd module.
> 
> The following patch fixes this by passing the address of the owning
> struct module to cache_register().  In addition, printk's were added to
> functions calling cache_unregister() to dump an error message on
> failure.
> 
> Signed-off-by: Bruce Allan <bwa@us.ibm.com>

Please put a

	struct module	*owner;

field into struct cache_detail instead, that's how it works for other
methods tables like that.

And while we're at it, cache_detail is an awfully generic name for a sunrpc
data structure.


  reply	other threads:[~2005-08-02 21:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-02 21:29 Bruce Allan
2005-08-02 21:51 ` Christoph Hellwig [this message]
2005-08-03  0:19   ` Bruce Allan

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=20050802215100.GA19079@infradead.org \
    --to=hch@infradead.org \
    --cc=bwa@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    --cc=nfs@lists.sourceforge.net \
    --cc=trond.myklebust@fys.uio.no \
    /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®