ima: Handle error code from security_audit_rule_match
Subsystems (4)
PATCH 1/1 ima: Handle error code from security_audit_rule_match
commit c7423dbdbc9e ("ima: Handle -ESTALE returned by ima_filter_rule_match()") introduced the handling of -ESTALE returned by security_audit_rule_match(). However, security_audit_rule_match() might return other error codes if some error occurred. We should handle those error codes as well.
--- security/integrity/ima/ima_policy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/integrity/ima/ima_policy.c +1 -1
@@ -663,7 +663,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule,break ; } -if (rc == -ESTALE && !rule_reinitialized) { +if (rc <0 && !rule_reinitialized) { lsm_rule =ima_lsm_copy_rule (rule);if (lsm_rule) { rule_reinitialized = true;
Signature · 1 line
2.17.1
Mimi Zohar
maintainerQuoted 17 lines · GUO Zihua
commit
c7423dbdbc9e("ima: Handle-ESTALEreturned byima_filter_rule_match()") introduced the handling of-ESTALEreturned bysecurity_audit_rule_match(). However,security_audit_rule_match()might return other error codes if some error occurred. We should handle those error codes as well.Fixes c7423dbdbc9e ("ima: Handle -ESTALE returned by ima_filter_rule_match()")Signed-off-by GUO Zihua <[email protected]>--- security/integrity/ima/ima_policy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)security/integrity/ima/ima_policy.c +0
-0
security/integrity/ima/ima_policy.c static bool ima_match_rules(struct ima_rule_entry *rule, · line 666
Quoted 5 lines
security/integrity/ima/ima_policy.c +1
-1@@ -663,7 +663,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule,break ; } -if (rc == -ESTALE && !rule_reinitialized) { +if (rc <0 && !rule_reinitialized) {
Which other error codes are resolved by retrying?
Quoted 3 lines
security/integrity/ima/ima_policy.c +0
-0lsm_rule =ima_lsm_copy_rule (rule);if (lsm_rule) { rule_reinitialized = true;
Signature · 3 lines
Thanks, Mimi
Quoted 21 lines · Mimi Zohar
Quoted 20 lines · GUO Zihua
commit
c7423dbdbc9e("ima: Handle-ESTALEreturned byima_filter_rule_match()") introduced the handling of-ESTALEreturned bysecurity_audit_rule_match(). However,security_audit_rule_match()might return other error codes if some error occurred. We should handle those error codes as well.Fixes c7423dbdbc9e ("ima: Handle -ESTALE returned by ima_filter_rule_match()")Signed-off-by GUO Zihua <[email protected]>--- security/integrity/ima/ima_policy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)security/integrity/ima/ima_policy.c +0
-0@@ -663,7 +663,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule,break ; }
Quoted 4 lines
security/integrity/ima/ima_policy.c static bool ima_match_rules(struct ima_rule_entry *rule, · line 666
Quoted 2 lines
security/integrity/ima/ima_policy.c +1
-1-if (rc == -ESTALE && !rule_reinitialized) { +if (rc <0 && !rule_reinitialized) {Which other error codes are resolved by retrying?
Well I re-checked security_audit_rule_match() and it seems that only -ESTALE can be handled. This patch could be ignored.
Quoted 5 lines
Quoted 4 lines
security/integrity/ima/ima_policy.c +0
-0lsm_rule =ima_lsm_copy_rule (rule);if (lsm_rule) { rule_reinitialized = true;
Signature · 2 lines
Best GUO Zihua