From: "J. Bruce Fields" <bfields@fieldses.org>
To: NeilBrown <neilb@suse.de>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] svcrpc: modifying positive sunrpc cache entries is racy
Date: Tue, 4 Jan 2011 16:21:47 -0500 [thread overview]
Message-ID: <20110104212147.GF7908@fieldses.org> (raw)
In-Reply-To: <20110105081538.0779659d@notabene.brown>
On Wed, Jan 05, 2011 at 08:15:38AM +1100, NeilBrown wrote:
> On Tue, 4 Jan 2011 13:43:14 -0500 "J. Bruce Fields" <bfields@fieldses.org>
> wrote:
> > Yep, applied.
> >
> > (When do we get to remove all this? Taking a stab at the 2.6.40 merge
> > window....
>
> That is what is says in feature-removal-schedule.txt (which no-one reads).
>
>
> > OK, party at my place in May!)
>
> Will there still be snow? I'm not coming if there is no snow!
If anyone attends from Australia, I'll find the snow. It may melt
rather quickly, though....
> (patch looks good)
Applied--thanks for the help!--b.
>
> NeilBrown
>
>
>
> >
> > --b.
> >
> > commit ab5c05c579b0b37b9bf2c79c9c8f0ef6045ee41d
> > Author: J. Bruce Fields <bfields@redhat.com>
> > Date: Fri Dec 24 14:03:38 2010 -0500
> >
> > svcrpc: modifying valid sunrpc cache entries is racy
> >
> > Once a sunrpc cache entry is VALID, we should be replacing it (and
> > allowing any concurrent users to destroy it on last put) instead of
> > trying to update it in place.
> >
> > Otherwise someone referencing the ip_map we're modifying here could try
> > to use the m_client just as we're putting the last reference.
> >
> > The bug should only be seen by users of the legacy nfsd interfaces.
> >
> > Signed-off-by: J. Bruce Fields <bfields@redhat.com>
> >
> > diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
> > index a04ac91..59a7c52 100644
> > --- a/net/sunrpc/svcauth_unix.c
> > +++ b/net/sunrpc/svcauth_unix.c
> > @@ -401,8 +401,7 @@ struct auth_domain *auth_unix_lookup(struct net *net, struct in6_addr *addr)
> > return NULL;
> >
> > if ((ipm->m_client->addr_changes - ipm->m_add_change) >0) {
> > - if (test_and_set_bit(CACHE_NEGATIVE, &ipm->h.flags) == 0)
> > - auth_domain_put(&ipm->m_client->h);
> > + sunrpc_invalidate(&ipm->h, sn->ip_map_cache);
> > rv = NULL;
> > } else {
> > rv = &ipm->m_client->h;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-01-04 21:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-29 20:47 [PATCH] svcrpc: modifying positive sunrpc cache entries is racy J. Bruce Fields
2010-12-29 20:59 ` J. Bruce Fields
2010-12-30 1:19 ` Neil Brown
2010-12-30 1:57 ` J. Bruce Fields
2011-01-03 20:55 ` J. Bruce Fields
2011-01-04 5:01 ` NeilBrown
2011-01-04 15:22 ` J. Bruce Fields
2011-01-04 19:23 ` J. Bruce Fields
2011-01-04 19:31 ` [PATCH 1/2] svcrpc: take lock on turning entry NEGATIVE in cache_check J. Bruce Fields
2011-01-04 19:31 ` [PATCH 2/2] svcrpc: ensure cache_check caller sees updated entry J. Bruce Fields
2011-01-04 21:10 ` [PATCH] svcrpc: modifying positive sunrpc cache entries is racy NeilBrown
[not found] ` <20110105081031.220bfbc9-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2011-01-04 21:15 ` J. Bruce Fields
2011-01-03 22:26 ` J. Bruce Fields
2011-01-04 3:08 ` J. Bruce Fields
2011-01-04 4:51 ` NeilBrown
2011-01-04 18:43 ` J. Bruce Fields
2011-01-04 21:15 ` NeilBrown
2011-01-04 21:21 ` J. Bruce Fields [this message]
2011-01-04 21:46 ` J. Bruce Fields
2011-01-04 23:05 ` NeilBrown
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=20110104212147.GF7908@fieldses.org \
--to=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).