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=1796385431; b=CCF2ZtmYhE59fNIDFM15CtYg1X3J6mUCywcaN/TEvWZWV4Y6t7VhIuCzsU1j31L9fv8D 6LG6ruudRfwutsnITPSDy6hz7yNNDkO6s7LDQFeL6uavJTayxCVINFq4wh9V5nHInEm8y y7+yqc28V20b3yOhiJFCK+r/gpBThoUAFS4knPxhDyTndGk95Na1b+7gA3fepMK4Y0RkG EbW5tBxRNQhTukMB3w2jxLRpihUfZhU2NMQ0uwvduSHTpr+DZlmjCr+IwlyGjeBq8SMGX DtAxsVrJVdFNTWkpJKeuBeWiBnVDEoALrNrIslekaSet0O5ujYgk4LvX+30Zq90tNLg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385431; 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=SKBWCJKBuABV+wdtXd4T5zwSNT1tFYpn+jzYhQ9spg4=; b=MqmEbT/XuZR9uECjM/rUVe0QXOFmA0FfBVUtTbvvuQYSZVdzFM/vI79Dkx+6MpvV8C/A DLqNIBrx50aNdb/tvlsFunvPEXEPeh5z3jBJ9M2RNrAcCBpKbqEaGyRhQGgSPd3l7wTNr nj/gMUeq9UstenmnI8v3lse9wsOIGKuaLmuArnFGncZDGEei9gMEz7s18y7FAZT6Sqipv kRW3TlaYvBVe1Flbfq8qgTqpSLnL5/VXDcy8OnwvPeXYZD+L9/3Ao9iQ1mMQiUgfV5rJD Bx9h298ZKAIEp2RnQ+mfI2XaaYuGw8M70ct+Kp7phqRIefObke07SMeSMhB2TKWiuWg== 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=wSt9FaKG; 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 ECD71606A322; Fri, 4 Dec 2026 11:57:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=wSt9FaKG Received: by smtp.kernel.org (Postfix) with ESMTPSA id 079D41F00936; Fri, 4 Dec 2026 11:57:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385430; bh=SKBWCJKBuABV+wdtXd4T5zwSNT1tFYpn+jzYhQ9spg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=wSt9FaKGwGZnAC/iGSCd4kXmaw+gLdzDU7/2qXonwRSHgjsL+SUADzzrhMw59h8ud yeaGsJy6Edw5CVEnnth95fxmDpfiQwVZUMsxT/vU5RKD164fJt4aMAmUiStXSZCOwb yIuubwEPiQQX6pCjlFb2SWjR8nB2dbBuyIPVAgAw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Stefano Stabellini , Yehyeong Lee , Juergen Gross Subject: [PATCH 6.6 0555/1167] xen/pvcalls: destroy the per-socket workqueue on release Date: Fri, 4 Dec 2026 18:59:42 +0900 Message-ID: <20261204100716.508657435@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org 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: Yehyeong Lee commit 6b3feb6bfa9ac384f7a3ec25c40b9b4d3da96d25 upstream. pvcalls_new_active_socket() gives every active socket its own ordered workqueue: map->ioworker.wq = alloc_ordered_workqueue("pvcalls_io", 0); and nothing ever destroys it. pvcalls_back_release_active() flushes map->ioworker.register_work and frees map, but the workqueue and its pool_workqueues stay allocated, so a frontend leaks a workqueue per socket it connects and releases - a loop a guest can run as long as it likes. Destroy it right after flush_work(): the IRQ is disabled and sk_data_ready restored by then, so nothing can queue new work, and the rings are still mapped while it drains - pvcalls_conn_back_read() reads map->ring and map->data, which xenbus_unmap_ring_vfree() takes away a few lines later. pvcalls_back_ioworker() does not take fedata->socket_lock, which the backend_disconnect() caller holds here - only the socket's own sk_receive_queue lock - so draining it from this point is safe; the flush_work() just above already has the same requirement. Fixes: 5db4d286a8ef ("xen/pvcalls: implement connect command") Cc: stable@vger.kernel.org Reviewed-by: Stefano Stabellini Signed-off-by: Yehyeong Lee Signed-off-by: Juergen Gross Message-ID: <20261110125002.46683-3-yhlee@isslab.korea.ac.kr> Signed-off-by: Greg Kroah-Hartman --- drivers/xen/pvcalls-back.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/xen/pvcalls-back.c +++ b/drivers/xen/pvcalls-back.c @@ -452,6 +452,7 @@ static int pvcalls_back_release_active(s atomic_set(&map->release, 1); flush_work(&map->ioworker.register_work); + destroy_workqueue(map->ioworker.wq); xenbus_unmap_ring_vfree(dev, map->bytes); xenbus_unmap_ring_vfree(dev, (void *)map->ring);