ima: Fix misuse of dereference of pointer in template_desc_init_fields()
stable inclusion from stable-v4.19.270 commit 9ca76b0b46fdb02e46558db5464988b4e18375eb category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6DPF8 CVE: NA -------------------------------- [ Upstream commit 25369175 ] The input parameter @fields is type of struct ima_template_field ***, so when allocates array memory for @fields, the size of element should be sizeof(**field) instead of sizeof(*field). Actually the original code would not cause any runtime error, but it's better to make it logically right. Fixes: adf53a77 ("ima: new templates management mechanism") Signed-off-by:Xiu Jianfeng <xiujianfeng@huawei.com> Reviewed-by:
Roberto Sassu <roberto.sassu@huawei.com> Signed-off-by:
Mimi Zohar <zohar@linux.ibm.com> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Yongqiang Liu <liuyongqiang13@huawei.com>
Loading
Please sign in to comment