]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
kernel: kexec_file: fix error return code of kexec_calculate_store_digests()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Fri, 7 May 2021 01:04:38 +0000 (18:04 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 18 Jun 2021 13:02:15 +0000 (15:02 +0200)
commitbcf717b2a4e50d017b703851bc7c4cac3264be8b
tree5eb9cb5f20cb8dce9636d9070b28447fcba04ad8
parentef7aca9cd6fa5033761e2e336722d2a087a872fb
kernel: kexec_file: fix error return code of kexec_calculate_store_digests()

BugLink: https://bugs.launchpad.net/bugs/1930474
[ Upstream commit 31d82c2c787d5cf65fedd35ebbc0c1bd95c1a679 ]

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: a43cac0d9dc2 ("kexec: split kexec_file syscall code to kexec_file.c")
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Acked-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
kernel/kexec_file.c