ima: ima/lsm policy rule loading logic bug fixes
mainline inclusion from mainline-v5.6-rc1 commit 483ec26e category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I692HU CVE: NA -------------------------------- Keep the ima policy rules around from the beginning even if they appear invalid at the time of loading, as they may become active after an lsm policy load. However, loading a custom IMA policy with unknown LSM labels is only safe after we have transitioned from the "built-in" policy rules to a custom IMA policy. Patch also fixes the rule re-use during the lsm policy reload and makes some prints a bit more human readable. Changelog: v4: - Do not allow the initial policy load refer to non-existing lsm rules. v3: - Fix too wide policy rule matching for non-initialized LSMs v2: - Fix log prints Fixes: b1694245 ("ima: use the lsm policy update notifier") Cc: Casey Schaufler <casey@schaufler-ca.com> Reported-by: NMimi Zohar <zohar@linux.ibm.com> Signed-off-by: NJanne Karhunen <janne.karhunen@gmail.com> Signed-off-by: NKonsta Karsisto <konsta.karsisto@gmail.com> Signed-off-by: NMimi Zohar <zohar@linux.ibm.com> Conflicts: security/integrity/ima/ima_policy.c Signed-off-by: NGUO Zihua <guozihua@huawei.com> Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com> Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
Showing
想要评论请 注册 或 登录