Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-06-10 19:03:59 +0200
committerMichal Suchanek <msuchanek@suse.de>2019-06-10 19:04:02 +0200
commita33e8021f8423b3d072c161beb266162043c7d2f (patch)
treedfe57b3625d96d81aa830f24bd9456348887f300
parent7faf413bc16963cc27735751075dd4d4fdd234a2 (diff)
powerpc: Always initialize input array when calling
epapr_hypercall() (bsc#1065729).
-rw-r--r--patches.arch/powerpc-Always-initialize-input-array-when-calling-e.patch90
-rw-r--r--series.conf1
2 files changed, 91 insertions, 0 deletions
diff --git a/patches.arch/powerpc-Always-initialize-input-array-when-calling-e.patch b/patches.arch/powerpc-Always-initialize-input-array-when-calling-e.patch
new file mode 100644
index 0000000000..1ed3619e19
--- /dev/null
+++ b/patches.arch/powerpc-Always-initialize-input-array-when-calling-e.patch
@@ -0,0 +1,90 @@
+From 186b8f1587c79c2fa04bfa392fdf084443e398c1 Mon Sep 17 00:00:00 2001
+From: Seth Forshee <seth.forshee@canonical.com>
+Date: Thu, 28 Sep 2017 09:33:39 -0400
+Subject: [PATCH] powerpc: Always initialize input array when calling
+ epapr_hypercall()
+
+References: bsc#1065729
+Patch-mainline: v4.15-rc1
+Git-commit: 186b8f1587c79c2fa04bfa392fdf084443e398c1
+
+Several callers to epapr_hypercall() pass an uninitialized stack
+allocated array for the input arguments, presumably because they
+have no input arguments. However this can produce errors like
+this one
+
+ arch/powerpc/include/asm/epapr_hcalls.h:470:42: error: 'in' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ unsigned long register r3 asm("r3") = in[0];
+ ~~^~~
+
+Fix callers to this function to always zero-initialize the input
+arguments array to prevent this.
+
+Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/include/asm/epapr_hcalls.h | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h
+index 334459ad145b..90863245df53 100644
+--- a/arch/powerpc/include/asm/epapr_hcalls.h
++++ b/arch/powerpc/include/asm/epapr_hcalls.h
+@@ -508,7 +508,7 @@ static unsigned long epapr_hypercall(unsigned long *in,
+
+ static inline long epapr_hypercall0_1(unsigned int nr, unsigned long *r2)
+ {
+- unsigned long in[8];
++ unsigned long in[8] = {0};
+ unsigned long out[8];
+ unsigned long r;
+
+@@ -520,7 +520,7 @@ static inline long epapr_hypercall0_1(unsigned int nr, unsigned long *r2)
+
+ static inline long epapr_hypercall0(unsigned int nr)
+ {
+- unsigned long in[8];
++ unsigned long in[8] = {0};
+ unsigned long out[8];
+
+ return epapr_hypercall(in, out, nr);
+@@ -528,7 +528,7 @@ static inline long epapr_hypercall0(unsigned int nr)
+
+ static inline long epapr_hypercall1(unsigned int nr, unsigned long p1)
+ {
+- unsigned long in[8];
++ unsigned long in[8] = {0};
+ unsigned long out[8];
+
+ in[0] = p1;
+@@ -538,7 +538,7 @@ static inline long epapr_hypercall1(unsigned int nr, unsigned long p1)
+ static inline long epapr_hypercall2(unsigned int nr, unsigned long p1,
+ unsigned long p2)
+ {
+- unsigned long in[8];
++ unsigned long in[8] = {0};
+ unsigned long out[8];
+
+ in[0] = p1;
+@@ -549,7 +549,7 @@ static inline long epapr_hypercall2(unsigned int nr, unsigned long p1,
+ static inline long epapr_hypercall3(unsigned int nr, unsigned long p1,
+ unsigned long p2, unsigned long p3)
+ {
+- unsigned long in[8];
++ unsigned long in[8] = {0};
+ unsigned long out[8];
+
+ in[0] = p1;
+@@ -562,7 +562,7 @@ static inline long epapr_hypercall4(unsigned int nr, unsigned long p1,
+ unsigned long p2, unsigned long p3,
+ unsigned long p4)
+ {
+- unsigned long in[8];
++ unsigned long in[8] = {0};
+ unsigned long out[8];
+
+ in[0] = p1;
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 569a3efae5..e7032d44bf 100644
--- a/series.conf
+++ b/series.conf
@@ -10078,6 +10078,7 @@
patches.arch/powerpc-kprobes-Fix-warnings-from-__this_cpu_read-on-preempt-kernels
patches.arch/powerpc-jprobes-Disable-preemption-when-triggered-th.patch
patches.arch/powerpc-powernv-Make-opal_event_shutdown-callable-fr.patch
+ patches.arch/powerpc-Always-initialize-input-array-when-calling-e.patch
patches.arch/selftests-powerpc-Use-snprintf-to-construct-DSCR-sys.patch
patches.arch/cxl-Add-support-for-POWER9-DD2.patch
patches.arch/cxl-Rename-register-PSL9_FIR2-to-PSL9_FIR_MASK.patch