diff options
author | Mimi Zohar <zohar@linux.ibm.com> | 2018-12-17 19:14:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-17 19:31:28 -0500 |
commit | 1a9430db2835c0c00acc87d915b573496998c1bf (patch) | |
tree | f9d7f680597516bddc577f1fa9bfbc3a0243b007 | |
parent | 94c13f66e13ca0f3d5b7b9e7e385fe5db35abe3c (diff) |
ima: cleanup the match_token policy code
Start the policy_tokens and the associated enumeration from zero,
simplifying the pt macro.
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | security/integrity/ima/ima_policy.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index 8c9499867c91..7489cb7de6dc 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c | |||
@@ -580,9 +580,9 @@ void ima_update_policy(void) | |||
580 | ima_update_policy_flag(); | 580 | ima_update_policy_flag(); |
581 | } | 581 | } |
582 | 582 | ||
583 | /* Keep the enumeration in sync with the policy_tokens! */ | ||
583 | enum { | 584 | enum { |
584 | Opt_err = -1, | 585 | Opt_measure, Opt_dont_measure, |
585 | Opt_measure = 1, Opt_dont_measure, | ||
586 | Opt_appraise, Opt_dont_appraise, | 586 | Opt_appraise, Opt_dont_appraise, |
587 | Opt_audit, Opt_hash, Opt_dont_hash, | 587 | Opt_audit, Opt_hash, Opt_dont_hash, |
588 | Opt_obj_user, Opt_obj_role, Opt_obj_type, | 588 | Opt_obj_user, Opt_obj_role, Opt_obj_type, |
@@ -592,10 +592,10 @@ enum { | |||
592 | Opt_uid_gt, Opt_euid_gt, Opt_fowner_gt, | 592 | Opt_uid_gt, Opt_euid_gt, Opt_fowner_gt, |
593 | Opt_uid_lt, Opt_euid_lt, Opt_fowner_lt, | 593 | Opt_uid_lt, Opt_euid_lt, Opt_fowner_lt, |
594 | Opt_appraise_type, Opt_permit_directio, | 594 | Opt_appraise_type, Opt_permit_directio, |
595 | Opt_pcr | 595 | Opt_pcr, Opt_err |
596 | }; | 596 | }; |
597 | 597 | ||
598 | static match_table_t policy_tokens = { | 598 | static const match_table_t policy_tokens = { |
599 | {Opt_measure, "measure"}, | 599 | {Opt_measure, "measure"}, |
600 | {Opt_dont_measure, "dont_measure"}, | 600 | {Opt_dont_measure, "dont_measure"}, |
601 | {Opt_appraise, "appraise"}, | 601 | {Opt_appraise, "appraise"}, |
@@ -1103,7 +1103,7 @@ void ima_policy_stop(struct seq_file *m, void *v) | |||
1103 | { | 1103 | { |
1104 | } | 1104 | } |
1105 | 1105 | ||
1106 | #define pt(token) policy_tokens[token + Opt_err].pattern | 1106 | #define pt(token) policy_tokens[token].pattern |
1107 | #define mt(token) mask_tokens[token] | 1107 | #define mt(token) mask_tokens[token] |
1108 | 1108 | ||
1109 | /* | 1109 | /* |