Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-10-15 17:52:57 +0200
committerTakashi Iwai <tiwai@suse.de>2018-10-15 17:52:57 +0200
commitda720418a1f845a57ad8a5c291aa6a5436eb8e28 (patch)
treee0cfb29cbaaeb05e4d4e7e795e42ee5f7db39955
parentc6608bb82a84adf10014efe617a8c4ec54eea568 (diff)
vmbus: don't return values for uninitalized channels
(bsc#1051510).
-rw-r--r--patches.suse/vmbus-don-t-return-values-for-uninitalized-channels.patch41
-rw-r--r--series.conf1
2 files changed, 42 insertions, 0 deletions
diff --git a/patches.suse/vmbus-don-t-return-values-for-uninitalized-channels.patch b/patches.suse/vmbus-don-t-return-values-for-uninitalized-channels.patch
new file mode 100644
index 0000000000..3c21d97c60
--- /dev/null
+++ b/patches.suse/vmbus-don-t-return-values-for-uninitalized-channels.patch
@@ -0,0 +1,41 @@
+From 6712cc9c22117a8af9f3df272b4a44fd2e4201cd Mon Sep 17 00:00:00 2001
+From: Stephen Hemminger <stephen@networkplumber.org>
+Date: Mon, 20 Aug 2018 21:16:40 +0000
+Subject: [PATCH] vmbus: don't return values for uninitalized channels
+Git-commit: 6712cc9c22117a8af9f3df272b4a44fd2e4201cd
+Patch-mainline: v4.19-rc4
+References: bsc#1051510
+
+For unsupported device types, the vmbus channel ringbuffer is never
+initialized, and therefore reading the sysfs files will return garbage
+or cause a kernel OOPS.
+
+Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info")
+
+Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Cc: <stable@vger.kernel.org> # 4.15
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/hv/vmbus_drv.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
+index b1b548a21f91..c71cc857b649 100644
+--- a/drivers/hv/vmbus_drv.c
++++ b/drivers/hv/vmbus_drv.c
+@@ -1291,6 +1291,9 @@ static ssize_t vmbus_chan_attr_show(struct kobject *kobj,
+ if (!attribute->show)
+ return -EIO;
+
++ if (chan->state != CHANNEL_OPENED_STATE)
++ return -EINVAL;
++
+ return attribute->show(chan, buf);
+ }
+
+--
+2.19.0
+
diff --git a/series.conf b/series.conf
index 78760cd215..f597452af6 100644
--- a/series.conf
+++ b/series.conf
@@ -17736,6 +17736,7 @@
patches.drivers/drm-i915-overlay-Allocate-physical-registers-from-st.patch
patches.fixes/0001-drm-amdgpu-fix-error-handling-in-amdgpu_cs_user_fenc.patch
patches.drivers/mei-ignore-not-found-client-in-the-enumeration.patch
+ patches.suse/vmbus-don-t-return-values-for-uninitalized-channels.patch
patches.drivers/USB-add-quirk-for-WORLDE-Controller-KS49-or-Prodipe-.patch
patches.drivers/xhci-Fix-use-after-free-for-URB-cancellation-on-a-re.patch
patches.drivers/USB-yurex-Fix-buffer-over-read-in-yurex_write.patch