All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kinglong Mee <kinglongmee@gmail.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] NFSD: Checking whether kill_suid by should_remove_suid()
Date: Sat, 19 Apr 2014 00:25:21 +0800	[thread overview]
Message-ID: <535151F1.1070102@gmail.com> (raw)
In-Reply-To: <20140418130220.GF18612@fieldses.org>



On 2014/4/18 21:02, J. Bruce Fields wrote:
> On Sun, Apr 13, 2014 at 11:11:39PM +0800, Kinglong Mee wrote:
>> As local filesystem, writing data to the file by non-owner will
>> clears the SUID+SGID, owner will not.
>
> Are you sure about this?  (Do you have a test case that fails?)
>
> I don't see an owner check in should_remove_suid.
>
> And I think that an nfsd thread will always have CAP_FSETID set (see
> cap_raise_nfsd_set and the definition of CAP_NFSD_SET), so that
> should_remove_suid() will always return 0.

You are right, should_remove_suid always return 0, nfsd will never call
kill_suid(). Coincidentally, that's the fix for bug of root clears the
SUID/SGID after writing data.

The right fix should drops the kill_suid(), because vfs_writev() have
do it correctly. I have push a new patch.

thanks,
Kinglong Mee

      parent reply	other threads:[~2014-04-18 16:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-13 15:11 [PATCH] NFSD: Checking whether kill_suid by should_remove_suid() Kinglong Mee
2014-04-18 13:02 ` J. Bruce Fields
2014-04-18 13:51   ` Kinglong Mee
2014-04-18 16:17     ` [PATCH v2] NFSD: Don't clear SUID/SGID after root writing data Kinglong Mee
2014-05-08 16:12       ` J. Bruce Fields
2014-05-09  7:55         ` Kinglong Mee
2014-05-09 21:40           ` J. Bruce Fields
2014-05-10  5:10             ` Christoph Hellwig
2014-05-16  7:31               ` Kinglong Mee
2014-05-16 15:12                 ` Christoph Hellwig
2014-04-18 16:25   ` Kinglong Mee [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=535151F1.1070102@gmail.com \
    --to=kinglongmee@gmail.com \
    --cc=bfields@fieldses.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.