LKML Archive on
help / color / mirror / Atom feed
From: Jeff Layton <>
To: "J. Bruce Fields" <>
Subject: Re: [PATCH 4/4] NLM: have nlm_shutdown_hosts kill off all NLM RPC tasks
Date: Fri, 18 Jan 2008 17:07:27 -0500	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Fri, 18 Jan 2008 16:43:45 -0500
"J. Bruce Fields" <> wrote:

> On Mon, Jan 14, 2008 at 09:05:18AM -0500, Jeff Layton wrote:
> > If we're shutting down all the nlm_hosts anyway, then it doesn't
> > make sense to allow RPC calls to linger. Allowing them to do so can
> > mean that the RPC calls can outlive the currently running lockd and
> > can lead to a use after free situation.
> I assume that all new rpc calls are created by the lockd thread itself
> (which also calls nlm_shutdown_hosts(), which guarantees that there
> can't be someone about to make an rpc call using the clnt we're
> destroying here?

I believe that's correct.

> By the way, any idea what the nlm_shutdown_hosts() call in exit_nlm()
> is doing?

Before this patchset, it was possible for more than one lockd
to be up at a time, and I suppose there could have been races that
would cause both to exit without ever calling nlm_shutdown_hosts.

With this patchset, we may be able to remove that. I suspect that it's
probably a noop now. That said, even after spending a fair bit of time
in this code, I'm not entirely comfortable with it. I suggest that we
take the incremental approach to lockd changes unless someone here is
sure :-).

Jeff Layton <>

  reply	other threads:[~2008-01-18 22:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-14 14:05 [PATCH 0/4] Intro: convert lockd to kthread and fix use-after-free (try #8) Jeff Layton
2008-01-14 14:05 ` [PATCH 1/4] SUNRPC: spin svc_rqst initialization to its own function Jeff Layton
2008-01-14 14:05   ` [PATCH 2/4] SUNRPC: export svc_sock_update_bufs Jeff Layton
2008-01-14 14:05     ` [PATCH 3/4] NLM: Convert lockd to use kthreads Jeff Layton
2008-01-14 14:05       ` [PATCH 4/4] NLM: have nlm_shutdown_hosts kill off all NLM RPC tasks Jeff Layton
2008-01-18 21:43         ` J. Bruce Fields
2008-01-18 22:07           ` Jeff Layton [this message]
2008-01-18 20:59   ` [PATCH 1/4] SUNRPC: spin svc_rqst initialization to its own function J. Bruce Fields
2008-01-18 21:48     ` Jeff Layton
2008-01-18 21:51       ` J. Bruce Fields

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH 4/4] NLM: have nlm_shutdown_hosts kill off all NLM RPC tasks' \

* 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).