From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amy Griffis Subject: [PATCH 2/4] audit inode for all xattr syscalls Date: Tue, 13 Feb 2007 14:14:41 -0500 Message-ID: <20070213191441.GC7536@fc.hp.com> References: <20070213191308.GA7536@fc.hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Received: from mx2.redhat.com (mx2.redhat.com [10.255.15.25]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l1DJHtxm030309 for ; Tue, 13 Feb 2007 14:17:55 -0500 Received: from atlrel6.hp.com (atlrel6.hp.com [156.153.255.205]) by mx2.redhat.com (8.13.1/8.13.1) with ESMTP id l1DJHnP2016555 for ; Tue, 13 Feb 2007 14:17:49 -0500 Received: from smtp2.fc.hp.com (smtp2.fc.hp.com [15.11.136.114]) by atlrel6.hp.com (Postfix) with ESMTP id E4ED83518D for ; Tue, 13 Feb 2007 14:17:43 -0500 (EST) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by smtp2.fc.hp.com (Postfix) with ESMTP id BD3DD170333 for ; Tue, 13 Feb 2007 19:17:43 +0000 (UTC) Received: from localhost (ldl.lart [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 84FFF39C062 for ; Tue, 13 Feb 2007 12:17:42 -0700 (MST) Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31561-10 for ; Tue, 13 Feb 2007 12:17:37 -0700 (MST) Content-Disposition: inline In-Reply-To: <20070213191308.GA7536@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