From mboxrd@z Thu Jan 1 00:00:00 1970 From: jjohansen@suse.de Subject: [AppArmor 03/41] Remove redundant check from proc_sys_setattr() Date: Thu, 12 Apr 2007 02:08:12 -0700 Message-ID: <20070412090836.943689000@suse.de> References: <20070412090809.917795000@suse.de> Cc: linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, chrisw@sous-sol.org, Steve Beattie , Andreas Gruenbacher , John Johansen To: linux-kernel@vger.kernel.org Return-path: Content-Disposition: inline; filename=proc_sys_setattr.diff Sender: linux-security-module-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org notify_change() already calls security_inode_setattr() before calling iop->setattr. Signed-off-by: Steve Beattie Signed-off-by: Andreas Gruenbacher Signed-off-by: John Johansen --- fs/proc/proc_sysctl.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -429,11 +429,8 @@ static int proc_sys_setattr(struct dentr return -EPERM; error = inode_change_ok(inode, attr); - if (!error) { - error = security_inode_setattr(dentry, attr); - if (!error) - error = inode_setattr(inode, attr); - } + if (!error) + error = inode_setattr(inode, attr); return error; } --