diff options
author | Ondrej Mosnáček <omosnace@redhat.com> | 2018-04-09 10:00:06 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-03 07:50:39 +0200 |
commit | 06d6d1ad241d9df531e1d8af4be6c468cb830d8b (patch) | |
tree | e7ce91161fbf80694eb3fbf608a6462b9cc1326c /kernel/auditsc.c | |
parent | e7cb8f11f6e2341a167c1b23c58716171f3fcfb9 (diff) | |
download | linux-stable-06d6d1ad241d9df531e1d8af4be6c468cb830d8b.tar.gz linux-stable-06d6d1ad241d9df531e1d8af4be6c468cb830d8b.tar.bz2 linux-stable-06d6d1ad241d9df531e1d8af4be6c468cb830d8b.zip |
audit: allow not equal op for audit by executable
[ Upstream commit 23bcc480dac204c7dbdf49d96b2c918ed98223c2 ]
Current implementation of auditing by executable name only implements
the 'equal' operator. This patch extends it to also support the 'not
equal' operator.
See: https://github.com/linux-audit/audit-kernel/issues/53
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r-- | kernel/auditsc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index ecc23e25c9eb..677053a2fb57 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -471,6 +471,8 @@ static int audit_filter_rules(struct task_struct *tsk, break; case AUDIT_EXE: result = audit_exe_compare(tsk, rule->exe); + if (f->op == Audit_not_equal) + result = !result; break; case AUDIT_UID: result = audit_uid_comparator(cred->uid, f->op, f->uid); |