From db0fa933610c9d25fe28a3dd7aee1d0ce5e1fa1a Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Tue, 3 Jan 2012 14:23:07 -0500 Subject: [PATCH] --- yaml --- r: 286060 b: refs/heads/master c: efaffd6e4417860c67576ac760dd6e8bbd15f006 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/audit.h | 1 + trunk/kernel/auditfilter.c | 1 + trunk/kernel/auditsc.c | 12 ++++++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 6562507b0882..5870d3d0f42d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6422e78de6880c66a82af512d9bd0c85eb62e661 +refs/heads/master: efaffd6e4417860c67576ac760dd6e8bbd15f006 diff --git a/trunk/include/linux/audit.h b/trunk/include/linux/audit.h index 67b66c37a254..55cb3daaf474 100644 --- a/trunk/include/linux/audit.h +++ b/trunk/include/linux/audit.h @@ -223,6 +223,7 @@ #define AUDIT_PERM 106 #define AUDIT_DIR 107 #define AUDIT_FILETYPE 108 +#define AUDIT_OBJ_UID 109 #define AUDIT_ARG0 200 #define AUDIT_ARG1 (AUDIT_ARG0+1) diff --git a/trunk/kernel/auditfilter.c b/trunk/kernel/auditfilter.c index 903caa269b5c..13e997423dcd 100644 --- a/trunk/kernel/auditfilter.c +++ b/trunk/kernel/auditfilter.c @@ -461,6 +461,7 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data, case AUDIT_ARG1: case AUDIT_ARG2: case AUDIT_ARG3: + case AUDIT_OBJ_UID: break; case AUDIT_ARCH: entry->rule.arch_f = f; diff --git a/trunk/kernel/auditsc.c b/trunk/kernel/auditsc.c index 4d8920f5ab88..5cf3ecc01517 100644 --- a/trunk/kernel/auditsc.c +++ b/trunk/kernel/auditsc.c @@ -586,6 +586,18 @@ static int audit_filter_rules(struct task_struct *tsk, } } break; + case AUDIT_OBJ_UID: + if (name) { + result = audit_comparator(name->uid, f->op, f->val); + } else if (ctx) { + list_for_each_entry(n, &ctx->names_list, list) { + if (audit_comparator(n->uid, f->op, f->val)) { + ++result; + break; + } + } + } + break; case AUDIT_WATCH: if (name) result = audit_watch_compare(rule->watch, name->ino, name->dev);