Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8101775imu; Tue, 4 Dec 2018 03:02:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/UrBjsr3w0SK9xQ0XzmpIsnFvyzblNopLZFVSRWbHw5gE9kwcTZwpfo6BPtbv1YYRus1BgD X-Received: by 2002:a63:af18:: with SMTP id w24mr16507160pge.385.1543921361061; Tue, 04 Dec 2018 03:02:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543921361; cv=none; d=google.com; s=arc-20160816; b=YBP7D/oUFjSLvv8xjuw+n1Itlh45+4V5oCOH0eekuiLXtRI+3SXjBYuYNygmsS5n81 ejce8EM3gEUGrNeh4Hw70zIG8cPTUIVlDa1xQe0eAjbPzTzTed+5ZkmEHjE2nYiu7n6z xp3h5OPf5hsyLnCgQVJvpMs4QAGWfT9zSL7OEEkacjNTd1lXyYCOpMPD+GwEYhqpSKW7 Kpa53RpZ1u89SCeeptmM1Rr8vpOPQHxOExjbpBj22bxIMpCXdK4mokKHoBAixg3wXXLr ABUFtDbHOTCVgpCo25WYDOjTdgNOjuY4dc0hPh2KwjW+aBaYw9sPFPhrXUjEOw4NQ9nG 1QBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OBoYwtMPlcAfbm3OIBHAOj0R6DZ1JLvIVrtuMFCXPzo=; b=UTb3lBz8o/wPlfXSrQGQS5+TvRhAQGA7rdEIDrqE/c2s1Jok3H+YYYQqHcrac6XNA2 nYXR7L6NeOdx0PMcSF91P5+ySQSWgxiDHR44G+jHAvTvn+opGkFG4VHydbBrZpKEOsNV V3Ux54VeFPxQ7W7ismkPQZNu4K0qcvug8Vz+tbpKACygv0VwGQQwf70X7Fml7pxfvIxR pd1NOSusYEj9GUjn1ALQPq05Vvbs+T35CnoqDTyw608A4CBRGgHj3t4OQjheYJQix18r ta+1uLsrJo9WSl31iC5Q9mqO2uOo/iy4UKHGqVeqbu12F3S3FUd44Hn1+3zPQIjtF4hX 4lWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PHp9WsV0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u22si15140918pgk.335.2018.12.04.03.02.25; Tue, 04 Dec 2018 03:02:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PHp9WsV0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727391AbeLDLAw (ORCPT + 99 others); Tue, 4 Dec 2018 06:00:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:46158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727362AbeLDLAu (ORCPT ); Tue, 4 Dec 2018 06:00:50 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A638C214C1; Tue, 4 Dec 2018 11:00:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543921249; bh=csUc1xsszE95nH9qJjoUZIYnGPq1qSd6STtJxYffx/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PHp9WsV0AYtr+N/k9cMnMNIuHYNoJUYtkfgDFDYcBF1OzlPdzEESBmXmmSz/8BsTX QaBb71rREhbPOik+FH2gW0vRDR3ezw+HVZxWEl97OcYhqiokLrYVAlEIlAEe+f3Kak OGZ3To+rTzKKcupewAo2rbihf7CDXiDjDg2adXhU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Hemminger , "K. Y. Srinivasan" , Haiyang Zhang , Dexuan Cui Subject: [PATCH 4.19 138/139] Drivers: hv: vmbus: check the creation_status in vmbus_establish_gpadl() Date: Tue, 4 Dec 2018 11:50:19 +0100 Message-Id: <20181204103656.546768798@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dexuan Cui 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 Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: stable@vger.kernel.org Signed-off-by: Dexuan Cui Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman --- drivers/hv/channel.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -482,6 +482,14 @@ int vmbus_establish_gpadl(struct vmbus_c } 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;