From: Greg Kroah-Hartman Date: Mon, 4 Apr 2022 07:45:29 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v5.17.2~92 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d48f8051790bd1e93e77f163cb09073e6981fcb9;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: proc-bootconfig-add-null-pointer-check.patch --- diff --git a/queue-5.10/proc-bootconfig-add-null-pointer-check.patch b/queue-5.10/proc-bootconfig-add-null-pointer-check.patch new file mode 100644 index 00000000000..f15e0eb518a --- /dev/null +++ b/queue-5.10/proc-bootconfig-add-null-pointer-check.patch @@ -0,0 +1,36 @@ +From bed5b60bf67ccd8957b8c0558fead30c4a3f5d3f Mon Sep 17 00:00:00 2001 +From: Lv Ruyi +Date: Tue, 29 Mar 2022 10:40:04 +0000 +Subject: proc: bootconfig: Add null pointer check + +From: Lv Ruyi + +commit bed5b60bf67ccd8957b8c0558fead30c4a3f5d3f upstream. + +kzalloc is a memory allocation function which can return NULL when some +internal memory errors happen. It is safer to add null pointer check. + +Link: https://lkml.kernel.org/r/20220329104004.2376879-1-lv.ruyi@zte.com.cn + +Cc: stable@vger.kernel.org +Fixes: c1a3c36017d4 ("proc: bootconfig: Add /proc/bootconfig to show boot config list") +Acked-by: Masami Hiramatsu +Reported-by: Zeal Robot +Signed-off-by: Lv Ruyi +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Greg Kroah-Hartman +--- + fs/proc/bootconfig.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/proc/bootconfig.c ++++ b/fs/proc/bootconfig.c +@@ -32,6 +32,8 @@ static int __init copy_xbc_key_value_lis + int ret = 0; + + key = kzalloc(XBC_KEYLEN_MAX, GFP_KERNEL); ++ if (!key) ++ return -ENOMEM; + + xbc_for_each_key_value(leaf, val) { + ret = xbc_node_compose_key(leaf, key, XBC_KEYLEN_MAX); diff --git a/queue-5.10/series b/queue-5.10/series index 708b99b9755..2a959a4cb9e 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -569,3 +569,4 @@ riscv-module-remove-noload.patch acpi-cppc-avoid-out-of-bounds-access-when-parsing-_cpc-data.patch platform-chrome-cros_ec_typec-check-for-ec-device.patch can-isotp-restore-accidentally-removed-msg_peek-feat.patch +proc-bootconfig-add-null-pointer-check.patch