All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@google.com>
To: Jan Kara <jack@suse.cz>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org,
	Andreas Gruenbacher <agruenba@redhat.com>
Subject: Re: [PATCH v2 RESEND] posix_acl: Clear SGID bit when setting file permissions
Date: Tue, 11 Oct 2016 16:11:01 -0700	[thread overview]
Message-ID: <20161011231101.GB126173@google.com> (raw)
In-Reply-To: <1474299768-15150-1-git-send-email-jack@suse.cz>

On Mon, Sep 19, 2016 at 05:42:48PM +0200, Jan Kara wrote:
> When file permissions are modified via chmod(2) and the user is not in
> the owning group or capable of CAP_FSETID, the setgid bit is cleared in
> inode_change_ok().  Setting a POSIX ACL via setxattr(2) sets the file
> permissions as well as the new ACL, but doesn't clear the setgid bit in
> a similar way; this allows to bypass the check in chmod(2).  Fix that.
> 

Hi Jan,

This patch is causing xfstests generic/314 to fail.  This test is supposed to
test "SGID inheritance on subdirectories", and the failure is because subdir2
unexpectedly ends up without a SGID bit.  This happens because the following
commands now result in the SGID bit on the parent directory "$TEST_DIR/$seq-dir"
being cleared rather than set:

	mkdir $TEST_DIR/$seq-dir
	chown $qa_user:12345 $TEST_DIR/$seq-dir
	chmod 2775 $TEST_DIR/$seq-dir
	su $qa_user -c "setfacl -m u:$qa_user:rwx,d:u:$qa_user:rwx $TEST_DIR/$seq-dir"

Is this the expected behavior now?

Thanks,

Eric

  parent reply	other threads:[~2016-10-11 23:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-19 15:42 [PATCH v2 RESEND] posix_acl: Clear SGID bit when setting file permissions Jan Kara
2016-09-20 16:13 ` Christoph Hellwig
2016-09-22  9:10   ` Jan Kara
2016-09-20 16:54 ` Jeff Layton
2016-10-11 23:11 ` Eric Biggers [this message]
2016-10-12  7:16   ` Jan Kara
2016-10-12 17:35     ` Eric Biggers
2016-10-12 21:16       ` Dave Chinner
2016-10-12 21:30         ` Eric Biggers

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=20161011231101.GB126173@google.com \
    --to=ebiggers@google.com \
    --cc=agruenba@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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.