Home Home > GIT Browse > vanilla
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-08-14 17:07:35 +0200
committerTakashi Iwai <tiwai@suse.de>2018-08-14 17:07:35 +0200
commit947aa512fe464b682971a0b9cb135f6bcc1a0b5b (patch)
tree17e0e31e1be457b8d07fb9ed25068ad63f17bd77
parent059d25de4932b161a446cedbed89011329ec04e6 (diff)
hv/netvsc: Fix NULL dereference at single queue mode fallbackrpm-4.12.14-25.13--sle15-updatesrpm-4.12.14-25.13
(bsc#1104708).
-rw-r--r--patches.suse/hv-netvsc-Fix-NULL-dereference-at-single-queue-mode-.patch38
-rw-r--r--series.conf2
2 files changed, 40 insertions, 0 deletions
diff --git a/patches.suse/hv-netvsc-Fix-NULL-dereference-at-single-queue-mode-.patch b/patches.suse/hv-netvsc-Fix-NULL-dereference-at-single-queue-mode-.patch
new file mode 100644
index 0000000000..efcd49a4ae
--- /dev/null
+++ b/patches.suse/hv-netvsc-Fix-NULL-dereference-at-single-queue-mode-.patch
@@ -0,0 +1,38 @@
+From: Takashi Iwai <tiwai@suse.de>
+Subject: [PATCH] hv/netvsc: Fix NULL dereference at single queue mode fallback
+References: bsc#1104708
+Patch-mainline: No, will be submitted soon later
+
+The recent commit 916c5e1413be ("hv/netvsc: fix handling of fallback
+to single queue mode") tried to fix the fallback behavior to a single
+queue mode, but it changed the function to return zero incorrectly,
+while the function should return an object pointer. Eventually this
+leads to a NULL dereference at the callers that expect non-NULL
+value.
+
+Fix it by returning the proper net_device object.
+
+Fixes: 916c5e1413be ("hv/netvsc: fix handling of fallback to single queue mode")
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/net/hyperv/rndis_filter.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
+index 408ece27131c..2a5209f23f29 100644
+--- a/drivers/net/hyperv/rndis_filter.c
++++ b/drivers/net/hyperv/rndis_filter.c
+@@ -1338,7 +1338,7 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
+ /* setting up multiple channels failed */
+ net_device->max_chn = 1;
+ net_device->num_chn = 1;
+- return 0;
++ return net_device;
+
+ err_dev_remv:
+ rndis_filter_device_remove(dev, net_device);
+--
+2.18.0
+
diff --git a/series.conf b/series.conf
index 35c7c13488..ce0f3ecb83 100644
--- a/series.conf
+++ b/series.conf
@@ -15946,6 +15946,8 @@
patches.suse/suse-hv-kvp_on_msg.dbg.patch
patches.suse/suse-hv-hv_compose_msi_msg.patch
+ patches.suse/hv-netvsc-Fix-NULL-dereference-at-single-queue-mode-.patch
+
# bsc#1056592
patches.suse/ras-cec-disable-cec.patch