hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9KUX7
--------------------------------
Fixed "WARNING: suspicious RCU usage" warning on ima_update_policy_flag.
Fixes: bccda6c35b52 ("ima: fix deadlock when traversing "ima_default_rules".") Signed-off-by: GUO Zihua guozihua@huawei.com --- security/integrity/ima/ima_policy.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index a9dbfc7143b3..43a5c4754a66 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -759,11 +759,13 @@ void ima_update_policy_flag(void) struct ima_rule_entry *entry; struct list_head *ima_rules_tmp;
+ rcu_read_lock(); ima_rules_tmp = rcu_dereference(ima_rules); list_for_each_entry_rcu(entry, ima_rules_tmp, list) { if (entry->action & IMA_DO_MASK) ima_policy_flag |= entry->action; } + rcu_read_unlock();
ima_appraise |= (build_ima_appraise | temp_ima_appraise); if (!ima_appraise)
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,转换为PR失败! 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/6... 失败原因:应用补丁/补丁集失败,Patch failed at 0001 ima: Fix suspicious RCU usage 建议解决方法:请查看失败原因, 确认补丁是否可以应用在当前期望分支的最新代码上
FeedBack: The patch(es) which you have sent to kernel@openeuler.org has been converted to PR failed! Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/6... Failed Reason: apply patch(es) failed, Patch failed at 0001 ima: Fix suspicious RCU usage Suggest Solution: please checkout if the failed patch(es) can work on the newest codes in expected branch