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=1796388215; b=ki9oeIOd/Extvid8socT6faJzn3OH8fqH7WVFeuwUHKRclf1h42euUT5rwIRIl2BzsBe zWb4GuyU2ZbGgvtAopjb/gUGjTEli9cpWTw197uo6nT9t5tYMKcUlm1mICo/SoGOQnxcG vlIVmSM47dI7CWcRGlQM+utSv//tokOcmhYvJF2angliCvG6ofRb3JR8xj48975e1zJmi KdamAZeYNNKxqQWhJl+Rk86HHxqtY7mCbwpnE9hjIAtp2MDCF+ROhxYuIzpeDGR0Z6ega 4GjHX84auJQ9e35/0h4Qn4MuVkg+YLHWHwR32GFRPzm34R2KiRFfkuNrc1oM6FzHqrQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388215; 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=tPaRajEeVoTi4PMX6ivcUUoo0GD8zwFqi1OpwtA+ClI=; b=MRCYGh1x278RFRZsAu8WQkzAa+slRpq0yAC3UNMl242YusD94jWxT0aotDCb17j+viTX Aps5zCqETSR2zq6UCFehP4AU1UZJh+45OuAJs8h8xScqlYLo6UmO5oXz0A9LCsxMvObuw Ja/coFKDUrb3aYPdHzUHfIW1Q+cGw5ZAQlnjdTFGBG0wzR+oaBkITodvo9bIBGRQXq5zA DVXBH1FmuqzjBxAz2BlvFJ3X67sDrDsV4Wee9RkzLJ9ma51c25g2iyVKLckt9+4RbfuZu cPdY1TgklqMTlIrvy8Yt7JzOPTvyiCGJHZitvFz11bvWruP0nFYL4IvqcFOLmFiuiig== 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=E26+hhhF; 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 5ED53606A322; Fri, 4 Dec 2026 12:43:35 +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=E26+hhhF Received: by smtp.kernel.org (Postfix) with ESMTPSA id C681F1F000C2; Fri, 4 Dec 2026 12:43:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388215; bh=tPaRajEeVoTi4PMX6ivcUUoo0GD8zwFqi1OpwtA+ClI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=E26+hhhFYdruVi6gHw6GitTYJBx9BQEi8ETHad6qkcG1DVXsgPxa69lr1C16wBF6g zxKBAkz3B607oxq8qp0lnwBjxDkRZahmI0GnDy7pbxC7JLcPvfbbBiBBQNhn0458+y MV1IyeaEbE63F/Sa2xXrjdbZ47qsizaG/TQPGgWc= 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.1 0527/1059] xen/pvcalls: destroy the per-socket workqueue on release Date: Fri, 4 Dec 2026 19:00:58 +0900 Message-ID: <20261204100657.873246733@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@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.1-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 @@ -448,6 +448,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);