aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r--kernel/auditsc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index fc0f928167e7..3828ad5fb8f1 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -49,6 +49,7 @@
49#include <linux/namei.h> 49#include <linux/namei.h>
50#include <linux/mm.h> 50#include <linux/mm.h>
51#include <linux/module.h> 51#include <linux/module.h>
52#include <linux/slab.h>
52#include <linux/mount.h> 53#include <linux/mount.h>
53#include <linux/socket.h> 54#include <linux/socket.h>
54#include <linux/mqueue.h> 55#include <linux/mqueue.h>
@@ -1893,7 +1894,7 @@ static int audit_inc_name_count(struct audit_context *context,
1893{ 1894{
1894 if (context->name_count >= AUDIT_NAMES) { 1895 if (context->name_count >= AUDIT_NAMES) {
1895 if (inode) 1896 if (inode)
1896 printk(KERN_DEBUG "name_count maxed, losing inode data: " 1897 printk(KERN_DEBUG "audit: name_count maxed, losing inode data: "
1897 "dev=%02x:%02x, inode=%lu\n", 1898 "dev=%02x:%02x, inode=%lu\n",
1898 MAJOR(inode->i_sb->s_dev), 1899 MAJOR(inode->i_sb->s_dev),
1899 MINOR(inode->i_sb->s_dev), 1900 MINOR(inode->i_sb->s_dev),
@@ -1988,7 +1989,6 @@ void __audit_inode(const char *name, const struct dentry *dentry)
1988 1989
1989/** 1990/**
1990 * audit_inode_child - collect inode info for created/removed objects 1991 * audit_inode_child - collect inode info for created/removed objects
1991 * @dname: inode's dentry name
1992 * @dentry: dentry being audited 1992 * @dentry: dentry being audited
1993 * @parent: inode of dentry parent 1993 * @parent: inode of dentry parent
1994 * 1994 *
@@ -2000,13 +2000,14 @@ void __audit_inode(const char *name, const struct dentry *dentry)
2000 * must be hooked prior, in order to capture the target inode during 2000 * must be hooked prior, in order to capture the target inode during
2001 * unsuccessful attempts. 2001 * unsuccessful attempts.
2002 */ 2002 */
2003void __audit_inode_child(const char *dname, const struct dentry *dentry, 2003void __audit_inode_child(const struct dentry *dentry,
2004 const struct inode *parent) 2004 const struct inode *parent)
2005{ 2005{
2006 int idx; 2006 int idx;
2007 struct audit_context *context = current->audit_context; 2007 struct audit_context *context = current->audit_context;
2008 const char *found_parent = NULL, *found_child = NULL; 2008 const char *found_parent = NULL, *found_child = NULL;
2009 const struct inode *inode = dentry->d_inode; 2009 const struct inode *inode = dentry->d_inode;
2010 const char *dname = dentry->d_name.name;
2010 int dirlen = 0; 2011 int dirlen = 0;
2011 2012
2012 if (!context->in_syscall) 2013 if (!context->in_syscall)
@@ -2014,9 +2015,6 @@ void __audit_inode_child(const char *dname, const struct dentry *dentry,
2014 2015
2015 if (inode) 2016 if (inode)
2016 handle_one(inode); 2017 handle_one(inode);
2017 /* determine matching parent */
2018 if (!dname)
2019 goto add_names;
2020 2018
2021 /* parent is more likely, look for it first */ 2019 /* parent is more likely, look for it first */
2022 for (idx = 0; idx < context->name_count; idx++) { 2020 for (idx = 0; idx < context->name_count; idx++) {