Commit 783fe494 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Yang Yingliang
Browse files

kernel: kexec_file: fix error return code of kexec_calculate_store_digests()

stable inclusion
from linux-4.19.191
commit 71bafe8dfbd81558911e38376eefecbc26458b2c

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

[ Upstream commit 31d82c2c ]

When vzalloc() returns NULL to sha_regions, no error return code of
kexec_calculate_store_digests() is assigned.  To fix this bug, ret is
assigned with -ENOMEM in this case.

Link: https://lkml.kernel.org/r/20210309083904.24321-1-baijiaju1990@gmail.com


Fixes: a43cac0d ("kexec: split kexec_file syscall code to kexec_file.c")
Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Reported-by: default avatarTOTE Robot <oslab@tsinghua.edu.cn>
Acked-by: default avatarBaoquan He <bhe@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 909ad0a4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment