Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-06-24 12:03:41 +0200
committerTakashi Iwai <tiwai@suse.de>2019-06-24 12:03:46 +0200
commitf0dd41e738320d625648654b29538a44b35671b0 (patch)
tree8d548b006cb4da90b910af6d94fd92429fe1a86a
parent05cb5ff0b33aa6584747cb6119c750546790bd7d (diff)
Drivers: misc: fix out-of-bounds access in function
param_set_kgdbts_var (bsc#1051510).
-rw-r--r--patches.drivers/Drivers-misc-fix-out-of-bounds-access-in-function-pa.patch42
-rw-r--r--series.conf1
2 files changed, 43 insertions, 0 deletions
diff --git a/patches.drivers/Drivers-misc-fix-out-of-bounds-access-in-function-pa.patch b/patches.drivers/Drivers-misc-fix-out-of-bounds-access-in-function-pa.patch
new file mode 100644
index 0000000000..fe997e9cab
--- /dev/null
+++ b/patches.drivers/Drivers-misc-fix-out-of-bounds-access-in-function-pa.patch
@@ -0,0 +1,42 @@
+From b281218ad4311a0342a40cb02fb17a363df08b48 Mon Sep 17 00:00:00 2001
+From: Young Xiao <YangX92@hotmail.com>
+Date: Fri, 12 Apr 2019 15:45:06 +0800
+Subject: [PATCH] Drivers: misc: fix out-of-bounds access in function param_set_kgdbts_var
+Git-commit: b281218ad4311a0342a40cb02fb17a363df08b48
+Patch-mainline: v5.2-rc1
+References: bsc#1051510
+
+There is an out-of-bounds access to "config[len - 1]" array when the
+variable "len" is zero.
+
+See commit dada6a43b040 ("kgdboc: fix KASAN global-out-of-bounds bug
+in param_set_kgdboc_var()") for details.
+
+Signed-off-by: Young Xiao <YangX92@hotmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/misc/kgdbts.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/misc/kgdbts.c
++++ b/drivers/misc/kgdbts.c
+@@ -1134,7 +1134,7 @@ static void kgdbts_put_char(u8 chr)
+
+ static int param_set_kgdbts_var(const char *kmessage, struct kernel_param *kp)
+ {
+- int len = strlen(kmessage);
++ size_t len = strlen(kmessage);
+
+ if (len >= MAX_CONFIG_LEN) {
+ printk(KERN_ERR "kgdbts: config string too long\n");
+@@ -1154,7 +1154,7 @@ static int param_set_kgdbts_var(const ch
+
+ strcpy(config, kmessage);
+ /* Chop out \n char as a result of echo */
+- if (config[len - 1] == '\n')
++ if (len && config[len - 1] == '\n')
+ config[len - 1] = '\0';
+
+ /* Go and configure with the new params. */
diff --git a/series.conf b/series.conf
index 939fb1eea1..c292f92252 100644
--- a/series.conf
+++ b/series.conf
@@ -22244,6 +22244,7 @@
patches.drivers/chardev-add-additional-check-for-minor-range-overlap.patch
patches.drivers/nvmem-core-fix-read-buffer-in-place.patch
patches.drivers/extcon-arizona-Disable-mic-detect-if-running-when-dr.patch
+ patches.drivers/Drivers-misc-fix-out-of-bounds-access-in-function-pa.patch
patches.drivers/w1-fix-the-resume-command-API.patch
patches.drivers/thunderbolt-Fix-to-check-for-kmemdup-failure.patch
patches.drivers/intel_th-msu-Fix-single-mode-with-IOMMU.patch