From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793210033; b=15Z/1X3gRqmkLO6kCJ/WsqNX1XYjTAsXpt7TT3kLN+I418hRu5fgDf7oA5SmX3PMQfzv JVQFO5Lk9r1BV6AVRmnSQ5+AcdMk1Zo2xOTrXAeIGJeONf5Xp3H5r4pwvZ0GPaFwLKioe MKdync1tqoHpa1kaOOk7PcXwOxgOJwkiZ9nkF+9dv7+z0VDlHqLq+1TqZ+Hn8faAyEESZ lncyXJcSoOJ+y9KAYzlWioMtgRvj9K56aV5i+2tq7gOSmvJAYIwISwESyVPRyUlwA8iej u1bmhEzYCISIFXh8LHlTj4jT3xxR8cspBIe6KZaeAD9GhTqoB/s1Ddmlix88SWYTCjA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793210033; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=gQ5uf54w/wx5skAWpaki5bVUpEnH8VBrAf+EqV1xLU0=; b=OT29LmYxbu/z0Z+bhWMyguFkZu/J+Qy53Uo1EILVigHE5GWyn/OzxA3nSNwNfZnjQ+oi iMYAgrgAXz+HQ8s2tRiWhpDFFxUxD4UNZkTZf0navR5JChyCsFrFjfR0cZNhvdsMeoPLM srMb2NyQ4L3XKWEotvcqMO7ZdDkLv0ZPd73GXAuiWYYRrEJmyEVxH/8VC82i+xCcU0WDK ZG8RTKlgWu3o7D/87oaLfvgOjvHVITqDVFKnaxmPttl8tCRdtjTyt/ssU0zKx/3zC/XR3 hWeyer2sfyeJaqei1ZLvQJWO8IsQ+EhubAhnqaBa6HCaq0Cw4r3AjA3Iv9pV2GTDtPQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=ahGUegDl; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 935C8606A31A; Wed, 28 Oct 2026 17:53:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=ahGUegDl Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2FA81F01825; Wed, 28 Oct 2026 17:53:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1793210033; bh=gQ5uf54w/wx5skAWpaki5bVUpEnH8VBrAf+EqV1xLU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ahGUegDllT8R2PZOXHpzQzvEOuDh+gR8o+GTT5RWzAlenlJ6ev9tjUl3ZIgXjR8fX dqspCUMLH1PbFer6KPqQIAvHOwXMf9VW4CNudftGOVOVi0Dw6KRI3CwkphpuiCkSHj 6wMNsgdMqSGdusk9eHB2w+ajxqpc9ltCrbhR0OF4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko , Michael Kelley , Wei Liu , Sasha Levin Subject: [PATCH 6.6 008/168] Drivers: hv: Dont reset VMBus connection state on error/exit paths Date: Wed, 28 Oct 2026 17:59:04 +0100 Message-ID: <20261028165943.292665256@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261028165943.089486480@linuxfoundation.org> References: <20261028165943.089486480@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Kelley [ Upstream commit ec31dc39e835ccde0930daccece8c492d28282fc ] In two places, current code forces vmbus_connection.conn_state to DISCONNECTED prior to calling vmbus_disconnect(). But vmbus_disconnect() calls vmbus_initiate_unload(), which unloads the VMBus connection only if the conn_state is CONNECTED. Consequently, the connection remains and the Hyper-V host might continue to send messages or post VMBus interrupts. The problem was introduced in commit 74347a99e73ae ("x86/Hyper-V: Unload vmbus channel in hv panic callback"), in that vmbus_initiate_unload() started checking the current connection state before doing the unload. This commit removed some occurrences where conn_state was forced to DISCONNECTED, but these two remained, apparently due to an oversight at the time. Fix this by not forcing conn_state to DISCONNECTED during VMBus exit, or if a failure occurs when establishing the connection in the first place. Whatever value conn_state has at the time is then read by vmbus_initiate_unload() to determine if there is a connection to be unloaded. Reported-by: Sashiko Closes: https://lore.kernel.org/linux-hyperv/20260805205806.B5AC31F000E9@smtp.kernel.org/ Fixes: 74347a99e73ae ("x86/Hyper-V: Unload vmbus channel in hv panic callback") Signed-off-by: Michael Kelley Signed-off-by: Wei Liu Signed-off-by: Sasha Levin --- drivers/hv/connection.c | 1 - drivers/hv/vmbus_drv.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index 3cdba13b132f0..722c07ec05be4 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c @@ -340,7 +340,6 @@ int vmbus_connect(void) cleanup: pr_err("Unable to connect to host\n"); - vmbus_connection.conn_state = DISCONNECTED; vmbus_disconnect(); kfree(msginfo); diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 9df19a69feb69..44af1c455bbf9 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -2707,7 +2707,6 @@ static void __exit vmbus_exit(void) hv_remove_kexec_handler(); hv_remove_crash_handler(); - vmbus_connection.conn_state = DISCONNECTED; hv_stimer_global_cleanup(); vmbus_disconnect(); if (vmbus_irq == -1) { -- 2.53.0