Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-06-19 15:14:46 +0200
committerTakashi Iwai <tiwai@suse.de>2019-06-19 15:14:48 +0200
commit6591dfa86d3fe86481a606d5d58b9a8a20b92255 (patch)
tree065201a1e77447190566ee0b21d8480070796c46
parent50161e71cc5afe7454c7da840a0962b6b61707ac (diff)
soc: mediatek: pwrap: Zero initialize rdata in pwrap_init_cipher
(bsc#1051510).
-rw-r--r--patches.drivers/soc-mediatek-pwrap-Zero-initialize-rdata-in-pwrap_in.patch46
-rw-r--r--series.conf1
2 files changed, 47 insertions, 0 deletions
diff --git a/patches.drivers/soc-mediatek-pwrap-Zero-initialize-rdata-in-pwrap_in.patch b/patches.drivers/soc-mediatek-pwrap-Zero-initialize-rdata-in-pwrap_in.patch
new file mode 100644
index 0000000000..1702aba2ed
--- /dev/null
+++ b/patches.drivers/soc-mediatek-pwrap-Zero-initialize-rdata-in-pwrap_in.patch
@@ -0,0 +1,46 @@
+From 89e28da82836530f1ac7a3a32fecc31f22d79b3e Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <natechancellor@gmail.com>
+Date: Thu, 7 Mar 2019 15:56:51 -0700
+Subject: [PATCH] soc: mediatek: pwrap: Zero initialize rdata in pwrap_init_cipher
+Git-commit: 89e28da82836530f1ac7a3a32fecc31f22d79b3e
+Patch-mainline: v5.2-rc1
+References: bsc#1051510
+
+When building with -Wsometimes-uninitialized, Clang warns:
+
+drivers/soc/mediatek/mtk-pmic-wrap.c:1358:6: error: variable 'rdata' is
+used uninitialized whenever '||' condition is true
+[-Werror,-Wsometimes-uninitialized]
+
+If pwrap_write returns non-zero, pwrap_read will not be called to
+initialize rdata, meaning that we will use some random uninitialized
+stack value in our print statement. Zero initialize rdata in case this
+happens.
+
+Link: https://github.com/ClangBuiltLinux/linux/issues/401
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
+Reviewed-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/soc/mediatek/mtk-pmic-wrap.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
+index 73f0be0567bd..c4449a163991 100644
+--- a/drivers/soc/mediatek/mtk-pmic-wrap.c
++++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
+@@ -1371,7 +1371,7 @@ static bool pwrap_is_pmic_cipher_ready(struct pmic_wrapper *wrp)
+ static int pwrap_init_cipher(struct pmic_wrapper *wrp)
+ {
+ int ret;
+- u32 rdata;
++ u32 rdata = 0;
+
+ pwrap_writel(wrp, 0x1, PWRAP_CIPHER_SWRST);
+ pwrap_writel(wrp, 0x0, PWRAP_CIPHER_SWRST);
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 9957d28546..60324553d4 100644
--- a/series.conf
+++ b/series.conf
@@ -22466,6 +22466,7 @@
patches.drm/drm-i915-fbc-disable-framebuffer-compression-on-Gemi.patch
patches.drm/drm-bridge-adv7511-Fix-low-refresh-rate-selection.patch
patches.drivers/thermal-cpu_cooling-Actually-trace-CPU-load-in-therm.patch
+ patches.drivers/soc-mediatek-pwrap-Zero-initialize-rdata-in-pwrap_in.patch
patches.suse/objtool-fix-function-fallthrough-detection.patch
patches.arch/x86-speculation-mds-revert-cpu-buffer-clear-on-double-fault-exit.patch
patches.fixes/configfs-fix-possible-use-after-free-in-configfs_reg.patch