From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amy Griffis Subject: [PATCH 2/4] audit inode for all xattr syscalls Date: Mon, 19 Mar 2007 16:43:24 -0400 Message-ID: <20070319204324.GC13931@fc.hp.com> References: <20070319204234.GA13931@fc.hp.com> <20070319204305.GB13931@fc.hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l2JKqTxc026382 for ; Mon, 19 Mar 2007 16:52:30 -0400 Received: from atlrel9.hp.com (atlrel9.hp.com [156.153.255.214]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l2JKqSnb008467 for ; Mon, 19 Mar 2007 16:52:29 -0400 Received: from smtp2.fc.hp.com (smtp.fc.hp.com [15.11.136.114]) by atlrel9.hp.com (Postfix) with ESMTP id 6A9D134A30 for ; Mon, 19 Mar 2007 16:52:20 -0400 (EDT) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by smtp2.fc.hp.com (Postfix) with ESMTP id B65741779B5 for ; Mon, 19 Mar 2007 20:52:20 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20070319204234.GA13931@fc.hp.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com List-Id: linux-audit@redhat.com Collect inode info for the remaining xattr syscalls that operate on a file descriptor. These don't call a path_lookup variant, so they aren't covered by the general audit hook. Signed-off-by: Amy Griffis --- fs/xattr.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/fs/xattr.c b/fs/xattr.c index 3864613..4f21fc9 100644 --- a/fs/xattr.c +++ b/fs/xattr.c @@ -346,11 +346,14 @@ asmlinkage ssize_t sys_fgetxattr(int fd, char __user *name, void __user *value, size_t size) { struct file *f; + struct dentry *dentry; ssize_t error = -EBADF; f = fget(fd); if (!f) return error; + dentry = f->f_path.dentry; + audit_inode(NULL, dentry->d_inode); error = getxattr(f->f_path.dentry, name, value, size); fput(f); return error; @@ -418,11 +421,14 @@ asmlinkage ssize_t sys_flistxattr(int fd, char __user *list, size_t size) { struct file *f; + struct dentry *dentry; ssize_t error = -EBADF; f = fget(fd); if (!f) return error; + dentry = f->f_path.dentry; + audit_inode(NULL, dentry->d_inode); error = listxattr(f->f_path.dentry, list, size); fput(f); return error; -- 1.4.4.4