Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934290AbZLKWcF (ORCPT ); Fri, 11 Dec 2009 17:32:05 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934197AbZLKWbY (ORCPT ); Fri, 11 Dec 2009 17:31:24 -0500 Received: from kroah.org ([198.145.64.141]:32840 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762760AbZLKWZQ (ORCPT ); Fri, 11 Dec 2009 17:25:16 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: "Eric W. Biederman" , "Eric W. Biederman" , Greg Kroah-Hartman Subject: [PATCH 25/27] sysfs: sysfs_setattr remove unnecessary permission check. Date: Fri, 11 Dec 2009 14:24:47 -0800 Message-Id: <1260570289-6997-25-git-send-email-gregkh@suse.de> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: <20091211212642.GA6624@kroah.com> References: <20091211212642.GA6624@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1333 Lines: 39 From: Eric W. Biederman inode_change_ok already clears the SGID bit when necessary so there is no reason for sysfs_setattr to carry code to do the same, and it is good to kill the extra copy because when I moved the code last in certain corner cases the code will look at the wrong gid. Acked-by: Serge Hallyn Acked-by: Tejun Heo Signed-off-by: Eric W. Biederman Signed-off-by: Greg Kroah-Hartman --- fs/sysfs/inode.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 9f783d4..220b758 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c @@ -117,10 +117,6 @@ int sysfs_setattr(struct dentry *dentry, struct iattr *iattr) return error; iattr->ia_valid &= ~ATTR_SIZE; /* ignore size changes */ - if (iattr->ia_valid & ATTR_MODE) { - if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID)) - iattr->ia_mode &= ~S_ISGID; - } error = inode_setattr(inode, iattr); if (error) -- 1.6.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/