Skip to content

powerpc/mm: Fix null-pointer dereference in pgtable_cache_add

Mamatha Inamdar requested to merge mainamdar/centos-stream-9:RHEL-29120 into main

Description: powerpc/mm: Fix null-pointer dereference in pgtable_cache_add

JIRA: https://issues.redhat.com/browse/RHEL-29120
CVE: CVE-2023-52607

Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=59823723

Tested: Verified Brew build test kernel RPMs and confirmed issue is resovled

Signed-off-by: Mamatha Inamdar minamdar@redhat.com

powerpc/mm: Fix null-pointer dereference in pgtable_cache_add

commit f46c8a75263f97bda13c739ba1c90aced0d3b071 Author: Kunwu Chan chentao@kylinos.cn Date: Mon Dec 4 10:32:23 2023 +0800

powerpc/mm: Fix null-pointer dereference in pgtable_cache_add

kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure. Ensure the allocation was successful
by checking the pointer validity.

Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231204023223.2447523-1-chentao@kylinos.cn

Signed-off-by: Mamatha Inamdar minamdar@redhat.com

Edited by Mamatha Inamdar

Merge request reports