Return-Path: Received: from mx2.suse.de ([195.135.220.15]:60153 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753305AbcIVJK6 (ORCPT ); Thu, 22 Sep 2016 05:10:58 -0400 Date: Thu, 22 Sep 2016 11:10:55 +0200 From: Jan Kara To: Christoph Hellwig Cc: Jan Kara , Al Viro , Andrew Morton , linux-fsdevel@vger.kernel.org, Andreas Gruenbacher Subject: Re: [PATCH v2 RESEND] posix_acl: Clear SGID bit when setting file permissions Message-ID: <20160922091055.GI2834@quack2.suse.cz> References: <1474299768-15150-1-git-send-email-jack@suse.cz> <20160920161324.GA19802@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160920161324.GA19802@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue 20-09-16 09:13:24, Christoph Hellwig wrote: > 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. > > Looks good: > > Reviewed-by: Christoph Hellwig Thanks for review. > (although I would have split it into a refactor patch and the actual > fix for clearing the suid bit) Yeah, it would have been better but I don't think it would help to redo the patch at this point. Honza -- Jan Kara SUSE Labs, CR