All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thiago Rafael Becker <thiago.becker@gmail.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Thiago Rafael Becker <thiago.becker@gmail.com>,
	linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] sunrpc: sort groups on unix_gid_parse
Date: Thu, 30 Nov 2017 10:03:42 -0200 (-02)	[thread overview]
Message-ID: <alpine.LFD.2.21.1711300958380.10495@tbecker-rhat> (raw)
In-Reply-To: <20171127201003.GA25662@fieldses.org>



On Mon, 27 Nov 2017, J. Bruce Fields wrote:

> Thanks for the patch:
>
> On Mon, Nov 27, 2017 at 05:25:08PM -0200, Thiago Rafael Becker wrote:
>> In cases were mountd is managing the group membership for nfsd,
>> if a user has several groups, multiple nfsd threads may call
>> sort_groups for the same freshly created unix_gid_cache entry
>> simultaneously, causing entries to be overwritten and the cache
>> entry to get corrupted.
>
> The groups_sort call is in set_groups, called from
> fs/nfsd/auth.c:nfsd_setuser():
>
> 	set_groups(new, gi);
>
> where "gi" is usually (in the absence of id squashing) a pointer to
> rqstp->rq_cred.cr_group_info, which can be in use by other threads.
>
> To me it's pretty unintuitive that set_groups() would modify the group
> info passed in the second argument.  While we're here, I wonder if we
> should make that the caller's responsibility?  There are basically only
> three callers outside this one.
>
> But I'm OK with this patch.  I probably need an OK from a vfs person to
> take it through the nfsd tree?
>
> --b.

I tend to agree. I have an updated version of the patches that I'll be 
sending to a broader audience to see if they have any inputs.

      reply	other threads:[~2017-11-30 12:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 19:25 [PATCH] sunrpc: sort groups on unix_gid_parse Thiago Rafael Becker
2017-11-27 20:10 ` J. Bruce Fields
2017-11-30 12:03   ` Thiago Rafael Becker [this message]

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=alpine.LFD.2.21.1711300958380.10495@tbecker-rhat \
    --to=thiago.becker@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.