Commit 11047ede authored by Krzysztof Struczynski's avatar Krzysztof Struczynski Committed by Zheng Zengkai
Browse files

ima: fix a potential crash owing to the compiler optimisation

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I49KW1


CVE: NA

--------------------------------

The build_appraise_rules may be a zero length array depends on the kernel
configuration. This is (vaguely) forbidden in a standard and leads to the
compiler optimisation where the address of the build_appraise_rules is the
same as the default_appraise_rules. That leads to the unexpected flow in
add_rules() where condition:
if (entries != build_appraise_rules)
is false for entries equal to default_appraise_rules.

Signed-off-by: default avatarKrzysztof Struczynski <krzysztof.struczynski@huawei.com>
Reviewed-by: default avatarZhang Tianxing <zhangtianxing3@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent e16e05db
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment