]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
LoongArch: vDSO: Check kcalloc() result in init_vdso()
authorGuangshuo Li <202321181@mail.sdu.edu.cn>
Thu, 18 Sep 2025 11:44:10 +0000 (19:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Sep 2025 09:16:47 +0000 (11:16 +0200)
commita417571950f93af945792f24577c14071fb2314c
tree331776c441e74be029ef73f12b308234b5b0750f
parent2feeecd7c68500e66b307d83f8d0aeb25c1a4961
LoongArch: vDSO: Check kcalloc() result in init_vdso()

commit ac398f570724c41e5e039d54e4075519f6af7408 upstream.

Add a NULL-pointer check after the kcalloc() call in init_vdso(). If
allocation fails, return -ENOMEM to prevent a possible dereference of
vdso_info.code_mapping.pages when it is NULL.

Cc: stable@vger.kernel.org
Fixes: 2ed119aef60d ("LoongArch: Set correct size for vDSO code mapping")
Signed-off-by: Guangshuo Li <202321181@mail.sdu.edu.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/loongarch/kernel/vdso.c