Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-06-19 20:32:20 +0200
committerMichal Suchanek <msuchanek@suse.de>2019-06-19 20:32:20 +0200
commit0a4b38d7b1a1bad3c39c07516bbd2ad76004a64c (patch)
tree387c1e40359c665598e94ed2cdaea521910d3e4e
parent20dd9ba7c58bd357bd99bf53d6bbd6adac2d9a19 (diff)
powerpc/pseries/dlpar: Fix a missing check in
dlpar_parse_cc_property() (bsc#1137194, CVE-2019-12614).
-rw-r--r--patches.arch/powerpc-pseries-dlpar-Fix-a-missing-check-in-dlpar_p.patch40
-rw-r--r--series.conf1
2 files changed, 41 insertions, 0 deletions
diff --git a/patches.arch/powerpc-pseries-dlpar-Fix-a-missing-check-in-dlpar_p.patch b/patches.arch/powerpc-pseries-dlpar-Fix-a-missing-check-in-dlpar_p.patch
new file mode 100644
index 0000000000..412f1cfa75
--- /dev/null
+++ b/patches.arch/powerpc-pseries-dlpar-Fix-a-missing-check-in-dlpar_p.patch
@@ -0,0 +1,40 @@
+From efa9ace68e487ddd29c2b4d6dd23242158f1f607 Mon Sep 17 00:00:00 2001
+From: Gen Zhang <blackgod016574@gmail.com>
+Date: Sun, 26 May 2019 10:42:40 +0800
+Subject: [PATCH] powerpc/pseries/dlpar: Fix a missing check in
+ dlpar_parse_cc_property()
+
+References: bsc#1137194, CVE-2019-12614
+Patch-mainline: queued
+Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git
+Git-commit: efa9ace68e487ddd29c2b4d6dd23242158f1f607
+
+In dlpar_parse_cc_property(), 'prop->name' is allocated by kstrdup().
+kstrdup() may return NULL, so it should be checked and handle error.
+And prop should be freed if 'prop->name' is NULL.
+
+Signed-off-by: Gen Zhang <blackgod016574@gmail.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/platforms/pseries/dlpar.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
+index 17958043e7f7..c852024044bb 100644
+--- a/arch/powerpc/platforms/pseries/dlpar.c
++++ b/arch/powerpc/platforms/pseries/dlpar.c
+@@ -61,6 +61,10 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa)
+
+ name = (char *)ccwa + be32_to_cpu(ccwa->name_offset);
+ prop->name = kstrdup(name, GFP_KERNEL);
++ if (!prop->name) {
++ dlpar_free_cc_property(prop);
++ return NULL;
++ }
+
+ prop->length = be32_to_cpu(ccwa->prop_length);
+ value = (char *)ccwa + be32_to_cpu(ccwa->prop_offset);
+--
+2.21.0
+
diff --git a/series.conf b/series.conf
index d40dcb5d0b..00d8a8da60 100644
--- a/series.conf
+++ b/series.conf
@@ -22605,6 +22605,7 @@
patches.drivers/ibmvnic-Fix-unchecked-return-codes-of-memory-allocat.patch
# powerpc/linux next
+ patches.arch/powerpc-pseries-dlpar-Fix-a-missing-check-in-dlpar_p.patch
patches.arch/powerpc-pseries-Fix-oops-in-hotplug-memory-notifier.patch
patches.arch/powerpc-cacheinfo-add-cacheinfo_teardown-cacheinfo_r.patch
patches.arch/powerpc-pseries-mobility-prevent-cpu-hotplug-during-.patch