summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDexuan Cui <decui@microsoft.com>2018-11-26 02:29:56 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-05 19:41:26 +0100
commit3c44b197448dfb8bef4fa9cab92b7a73153a6f76 (patch)
treec79a503442d3da3de49bd015a66b31a1c3dd8cdf
parent7c1ba1a1bb0d1a5dcebc737343f0c45840cf181d (diff)
downloadlinux-stable-3c44b197448dfb8bef4fa9cab92b7a73153a6f76.tar.gz
linux-stable-3c44b197448dfb8bef4fa9cab92b7a73153a6f76.tar.bz2
linux-stable-3c44b197448dfb8bef4fa9cab92b7a73153a6f76.zip
Drivers: hv: vmbus: check the creation_status in vmbus_establish_gpadl()
commit eceb05965489784f24bbf4d61ba60e475a983016 upstream. This is a longstanding issue: if the vmbus upper-layer drivers try to consume too many GPADLs, the host may return with an error 0xC0000044 (STATUS_QUOTA_EXCEEDED), but currently we forget to check the creation_status, and hence we can pass an invalid GPADL handle into the OPEN_CHANNEL message, and get an error code 0xc0000225 in open_info->response.open_result.status, and finally we hang in vmbus_open() -> "goto error_free_info" -> vmbus_teardown_gpadl(). With this patch, we can exit gracefully on STATUS_QUOTA_EXCEEDED. Cc: Stephen Hemminger <sthemmin@microsoft.com> Cc: K. Y. Srinivasan <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: stable@vger.kernel.org Signed-off-by: Dexuan Cui <decui@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/hv/channel.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index d96b09fea835..e05de5032f0c 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -454,6 +454,14 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
}
wait_for_completion(&msginfo->waitevent);
+ if (msginfo->response.gpadl_created.creation_status != 0) {
+ pr_err("Failed to establish GPADL: err = 0x%x\n",
+ msginfo->response.gpadl_created.creation_status);
+
+ ret = -EDQUOT;
+ goto cleanup;
+ }
+
if (channel->rescind) {
ret = -ENODEV;
goto cleanup;