Skip to content

pstore/platform: Add check for kstrdup

Steve Best requested to merge sfbest/centos-stream-9:38128 into main

JIRA: https://issues.redhat.com/browse/RHEL-38128
CVE: CVE-2023-52869

Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=61487181
Tested: Did sanity boot testing Intel (intel-arrowlake-s-02) system.

commit a19d48f7c5d57c0f0405a7d4334d1d38fe9d3c1c
Author: Jiasheng Jiang jiasheng@iscas.ac.cn
Date: Fri Jun 23 10:27:06 2023 +0800

pstore/platform: Add check for kstrdup  

Add check for the return value of kstrdup() and return the error  
if it fails in order to avoid NULL pointer dereference.  

Fixes: 563ca40ddf40 ("pstore/platform: Switch pstore_info::name to const")  
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>  
Link: https://lore.kernel.org/r/20230623022706.32125-1-jiasheng@iscas.ac.cn  
Signed-off-by: Kees Cook <keescook@chromium.org>  

Signed-off-by: Steve Best sbest@redhat.com

Merge request reports