The patch titled Subject: kernel: kexec_file: fix error return code of kexec_calculate_store_digests() has been added to the -mm tree. Its filename is kernel-kexec_file-fix-error-return-code-of-kexec_calculate_store_digests.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/kernel-kexec_file-fix-error-return-code-of-kexec_calculate_store_digests.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/kernel-kexec_file-fix-error-return-code-of-kexec_calculate_store_digests.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jia-Ju Bai <baijiaju1990@xxxxxxxxx> Subject: kernel: kexec_file: fix error return code of kexec_calculate_store_digests() 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@xxxxxxxxx Fixes: a43cac0d9dc2 ("kexec: split kexec_file syscall code to kexec_file.c") Signed-off-by: Jia-Ju Bai <baijiaju1990@xxxxxxxxx> Reported-by: TOTE Robot <oslab@xxxxxxxxxxxxxxx> Acked-by: Baoquan He <bhe@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/kexec_file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/kernel/kexec_file.c~kernel-kexec_file-fix-error-return-code-of-kexec_calculate_store_digests +++ a/kernel/kexec_file.c @@ -740,8 +740,10 @@ static int kexec_calculate_store_digests sha_region_sz = KEXEC_SEGMENT_MAX * sizeof(struct kexec_sha_region); sha_regions = vzalloc(sha_region_sz); - if (!sha_regions) + if (!sha_regions) { + ret = -ENOMEM; goto out_free_desc; + } desc->tfm = tfm; _ Patches currently in -mm which might be from baijiaju1990@xxxxxxxxx are kernel-kexec_file-fix-error-return-code-of-kexec_calculate_store_digests.patch