diff options
| author | Richard Guy Briggs <rgb@redhat.com> | 2013-11-25 21:57:51 -0500 |
|---|---|---|
| committer | Eric Paris <eparis@redhat.com> | 2014-01-13 22:32:31 -0500 |
| commit | 724e4fcc8d80c63c7e56873b41987533db2a04c2 (patch) | |
| tree | 2227b9c065ce771308c2f28456b2a9cde559d5af /kernel | |
| parent | 6dd80aba90639d1765396aa5e5f55e34dc3356e5 (diff) | |
audit: log on errors from filter user rules
An error on an AUDIT_NEVER rule disabled logging on that rule.
On error on AUDIT_NEVER rules, log.
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/audit.c | 2 | ||||
| -rw-r--r-- | kernel/auditfilter.c | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 9c4ec29a707b..15661ef8bece 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
| @@ -869,7 +869,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
| 869 | return 0; | 869 | return 0; |
| 870 | 870 | ||
| 871 | err = audit_filter_user(msg_type); | 871 | err = audit_filter_user(msg_type); |
| 872 | if (err == 1) { | 872 | if (err == 1) { /* match or error */ |
| 873 | err = 0; | 873 | err = 0; |
| 874 | if (msg_type == AUDIT_USER_TTY) { | 874 | if (msg_type == AUDIT_USER_TTY) { |
| 875 | err = tty_audit_push_current(); | 875 | err = tty_audit_push_current(); |
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index 629834aa4ca4..14a78cca384e 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c | |||
| @@ -1290,19 +1290,22 @@ int audit_filter_user(int type) | |||
| 1290 | { | 1290 | { |
| 1291 | enum audit_state state = AUDIT_DISABLED; | 1291 | enum audit_state state = AUDIT_DISABLED; |
| 1292 | struct audit_entry *e; | 1292 | struct audit_entry *e; |
| 1293 | int ret = 1; | 1293 | int rc, ret; |
| 1294 | |||
| 1295 | ret = 1; /* Audit by default */ | ||
| 1294 | 1296 | ||
| 1295 | rcu_read_lock(); | 1297 | rcu_read_lock(); |
| 1296 | list_for_each_entry_rcu(e, &audit_filter_list[AUDIT_FILTER_USER], list) { | 1298 | list_for_each_entry_rcu(e, &audit_filter_list[AUDIT_FILTER_USER], list) { |
| 1297 | if (audit_filter_user_rules(&e->rule, type, &state)) { | 1299 | rc = audit_filter_user_rules(&e->rule, type, &state); |
| 1298 | if (state == AUDIT_DISABLED) | 1300 | if (rc) { |
| 1301 | if (rc > 0 && state == AUDIT_DISABLED) | ||
| 1299 | ret = 0; | 1302 | ret = 0; |
| 1300 | break; | 1303 | break; |
| 1301 | } | 1304 | } |
| 1302 | } | 1305 | } |
| 1303 | rcu_read_unlock(); | 1306 | rcu_read_unlock(); |
| 1304 | 1307 | ||
| 1305 | return ret; /* Audit by default */ | 1308 | return ret; |
| 1306 | } | 1309 | } |
| 1307 | 1310 | ||
| 1308 | int audit_filter_type(int type) | 1311 | int audit_filter_type(int type) |
