path: root/kernel/auditsc.c
diff options
authorRichard Guy Briggs <>2015-08-05 16:29:37 -0400
committerPaul Moore <>2015-08-06 16:17:25 -0400
commit34d99af52ad40bd498ba66970579a5bc1fb1a3bc (patch)
treefcab34928eb893eff68506685675420f0afba08e /kernel/auditsc.c
parent7f49294282c49ef426ed05eb4959728524ba140c (diff)
audit: implement audit by executable
This adds the ability audit the actions of a not-yet-running process. This patch implements the ability to filter on the executable path. Instead of just hard coding the ino and dev of the executable we care about at the moment the rule is inserted into the kernel, use the new audit_fsnotify infrastructure to manage this dynamically. This means that if the filename does not yet exist but the containing directory does, or if the inode in question is unlinked and creat'd (aka updated) the rule will just continue to work. If the containing directory is moved or deleted or the filesystem is unmounted, the rule is deleted automatically. A future enhancement would be to have the rule survive across directory disruptions. This is a heavily modified version of a patch originally submitted by Eric Paris with some ideas from Peter Moody. Cc: Peter Moody <> Cc: Eric Paris <> Signed-off-by: Richard Guy Briggs <> [PM: minor whitespace clean to satisfy ./scripts/checkpatch] Signed-off-by: Paul Moore <>
Diffstat (limited to 'kernel/auditsc.c')
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index ea3fe2b748a8..9b56b7ae053f 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -466,6 +466,9 @@ static int audit_filter_rules(struct task_struct *tsk,
result = audit_comparator(ctx->ppid, f->op, f->val);
+ case AUDIT_EXE:
+ result = audit_exe_compare(tsk, rule->exe);
+ break;
result = audit_uid_comparator(cred->uid, f->op, f->uid);