LKML Archive on
help / color / mirror / Atom feed
From: Jeff Layton <>
Subject: [PATCH 0/4] Intro: convert lockd to kthread and fix use-after-free (try #8)
Date: Mon, 14 Jan 2008 09:05:14 -0500	[thread overview]
Message-ID: <> (raw)

This is the eighth patchset to fix the use-after-free problem in lockd
which we originally discussed back in October. Along the way, Christoph
Hellwig mentioned that it would be advantageous to convert lockd to use
the kthread API. This patch set first makes that change and then patches
it to actually fix the use after free problem. 

The main changes from the last patchset are:

- dropped the try_to_freeze() patch. svc_recv calls try_to_freeze() too,
  so that wasn't really necessary. I added a comment to clarify that for
  future reference.

- fixed a race whereby make_socks() could get called with a null
  nlmsvc_serv pointer and cause an oops. Thanks to Christoph Hellwig for
  the original patch.

- moved lock_kernel() down slightly in the lockd() function, and
  unlock_kernel() up. It's not much of a change, but it's a start. I
  also added a FIXME comment that we should fix lockd to not run under
  the BKL. Perhaps someone can clarify why lockd() does this.

I've done some very basic testing and everything seems to work as
expected.  I've also tested this against the reproducer that I have for
the use-after-free problem and this does fix it. I've tried to make this
cleanly bisectable, but have only really tested the final result.

Many thanks to Trond Myklebust, Chuck Lever, Neil Brown and Christoph
Hellwig for their guidance on this.

Signed-off-by: Jeff Layton <>

             reply	other threads:[~2008-01-14 14:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-14 14:05 Jeff Layton [this message]
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
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 0/4] Intro: convert lockd to kthread and fix use-after-free (try #8)' \

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