aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/auditsc.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 1a92d61ddd27..7c495147c3d9 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -540,12 +540,14 @@ static int audit_filter_rules(struct task_struct *tsk,
540 } 540 }
541 break; 541 break;
542 case AUDIT_DEVMAJOR: 542 case AUDIT_DEVMAJOR:
543 if (name) 543 if (name) {
544 result = audit_comparator(MAJOR(name->dev), 544 if (audit_comparator(MAJOR(name->dev), f->op, f->val) ||
545 f->op, f->val); 545 audit_comparator(MAJOR(name->rdev), f->op, f->val))
546 else if (ctx) { 546 ++result;
547 } else if (ctx) {
547 list_for_each_entry(n, &ctx->names_list, list) { 548 list_for_each_entry(n, &ctx->names_list, list) {
548 if (audit_comparator(MAJOR(n->dev), f->op, f->val)) { 549 if (audit_comparator(MAJOR(n->dev), f->op, f->val) ||
550 audit_comparator(MAJOR(n->rdev), f->op, f->val)) {
549 ++result; 551 ++result;
550 break; 552 break;
551 } 553 }
@@ -553,12 +555,14 @@ static int audit_filter_rules(struct task_struct *tsk,
553 } 555 }
554 break; 556 break;
555 case AUDIT_DEVMINOR: 557 case AUDIT_DEVMINOR:
556 if (name) 558 if (name) {
557 result = audit_comparator(MINOR(name->dev), 559 if (audit_comparator(MINOR(name->dev), f->op, f->val) ||
558 f->op, f->val); 560 audit_comparator(MINOR(name->rdev), f->op, f->val))
559 else if (ctx) { 561 ++result;
562 } else if (ctx) {
560 list_for_each_entry(n, &ctx->names_list, list) { 563 list_for_each_entry(n, &ctx->names_list, list) {
561 if (audit_comparator(MINOR(n->dev), f->op, f->val)) { 564 if (audit_comparator(MINOR(n->dev), f->op, f->val) ||
565 audit_comparator(MINOR(n->rdev), f->op, f->val)) {
562 ++result; 566 ++result;
563 break; 567 break;
564 } 568 }