diff options
Diffstat (limited to 'kernel/auditsc.c')
| -rw-r--r-- | kernel/auditsc.c | 35 | 
1 files changed, 22 insertions, 13 deletions
| diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 3828ad5fb8f..f49a0318c2e 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -65,7 +65,6 @@  #include <linux/binfmts.h>  #include <linux/highmem.h>  #include <linux/syscalls.h> -#include <linux/inotify.h>  #include <linux/capability.h>  #include <linux/fs_struct.h> @@ -242,6 +241,10 @@ struct audit_context {  			pid_t			pid;  			struct audit_cap_data	cap;  		} capset; +		struct { +			int			fd; +			int			flags; +		} mmap;  	};  	int fds[2]; @@ -549,9 +552,8 @@ static int audit_filter_rules(struct task_struct *tsk,  			}  			break;  		case AUDIT_WATCH: -			if (name && audit_watch_inode(rule->watch) != (unsigned long)-1) -				result = (name->dev == audit_watch_dev(rule->watch) && -					  name->ino == audit_watch_inode(rule->watch)); +			if (name) +				result = audit_watch_compare(rule->watch, name->ino, name->dev);  			break;  		case AUDIT_DIR:  			if (ctx) @@ -1307,6 +1309,10 @@ static void show_special(struct audit_context *context, int *call_panic)  		audit_log_cap(ab, "cap_pp", &context->capset.cap.permitted);  		audit_log_cap(ab, "cap_pe", &context->capset.cap.effective);  		break; } +	case AUDIT_MMAP: { +		audit_log_format(ab, "fd=%d flags=0x%x", context->mmap.fd, +				 context->mmap.flags); +		break; }  	}  	audit_log_end(ab);  } @@ -1726,7 +1732,7 @@ static inline void handle_one(const struct inode *inode)  	struct audit_tree_refs *p;  	struct audit_chunk *chunk;  	int count; -	if (likely(list_empty(&inode->inotify_watches))) +	if (likely(hlist_empty(&inode->i_fsnotify_marks)))  		return;  	context = current->audit_context;  	p = context->trees; @@ -1769,7 +1775,7 @@ retry:  	seq = read_seqbegin(&rename_lock);  	for(;;) {  		struct inode *inode = d->d_inode; -		if (inode && unlikely(!list_empty(&inode->inotify_watches))) { +		if (inode && unlikely(!hlist_empty(&inode->i_fsnotify_marks))) {  			struct audit_chunk *chunk;  			chunk = audit_tree_lookup(inode);  			if (chunk) { @@ -1837,13 +1843,8 @@ void __audit_getname(const char *name)  	context->names[context->name_count].ino  = (unsigned long)-1;  	context->names[context->name_count].osid = 0;  	++context->name_count; -	if (!context->pwd.dentry) { -		read_lock(¤t->fs->lock); -		context->pwd = current->fs->pwd; -		path_get(¤t->fs->pwd); -		read_unlock(¤t->fs->lock); -	} - +	if (!context->pwd.dentry) +		get_fs_pwd(current->fs, &context->pwd);  }  /* audit_putname - intercept a putname request @@ -2483,6 +2484,14 @@ void __audit_log_capset(pid_t pid,  	context->type = AUDIT_CAPSET;  } +void __audit_mmap_fd(int fd, int flags) +{ +	struct audit_context *context = current->audit_context; +	context->mmap.fd = fd; +	context->mmap.flags = flags; +	context->type = AUDIT_MMAP; +} +  /**   * audit_core_dumps - record information about processes that end abnormally   * @signr: signal value | 
