Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50453201025 for ; Mon, 2 Dec 2024 13:53:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733147599; cv=none; b=RYePhken4TsjiZRfVOcHUKQYg9oC0R2J9kAgnFV63CJDnhcNWYPbC8EHKqJl4KEV9N5XWqeKMdponfbwqFr+UtVnh7X5N/3/j6Fvz6kLQeKTBfD7od4jW2lLf6MekOvymu2ivYMNIh0le86qX+pMUsgFSAkgv7fpGubjB5tKRyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733147599; c=relaxed/simple; bh=WhT5wOOJ+sjDiW4TA/99ORa8Iws7B9Ko2JfK9Kueb0Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nMBLkwFp9E6Q6lZLh6rcfDYVspFQ5SFCCGeL/O/xBQJEHNDJyP+tjzkIH1SNPlfyUoTc2WELXVY3ckvvF1i4HpQQr27CLxM2d3vVfC3hat8idpnba4Z0IxNqKFdLjQOIpUTFexwQSGQHqcl8eQefSRzFKYSz7RXMrKs0Jy6YXj4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HhtvVkGW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="HhtvVkGW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69DABC4CED1; Mon, 2 Dec 2024 13:53:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1733147598; bh=WhT5wOOJ+sjDiW4TA/99ORa8Iws7B9Ko2JfK9Kueb0Y=; h=From:To:Cc:Subject:Date:Reply-to:From; b=HhtvVkGWkO7fkGOivfGEqs3y30O4K25kIIrV3sNmLWll3b+9g/PIy6rnJnzoAOG3N MYr5aJvTU+hMpEdm1+MLSAwxtMT8OD4fohN9XxpmhMwQkhj7UWk9UGNiGEgv1OuGzj Z0WxtvMc3AF2UwOlVvoRQ3W2ysWih/FSMooZWafU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-53119: virtio/vsock: Fix accept_queue memory leak Date: Mon, 2 Dec 2024 14:52:58 +0100 Message-ID: <2024120251-CVE-2024-53119-4957@gregkh> X-Mailer: git-send-email 2.47.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=4278; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=WhT5wOOJ+sjDiW4TA/99ORa8Iws7B9Ko2JfK9Kueb0Y=; b=owGbwMvMwCRo6H6F97bub03G02pJDOm+uzdXWTWrays03BKY/OVwbtrUH6r6Sif4zSTeh+iEp LYsmizXEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABOx6WGYp1dy9ucbf4GS7fm3 RY9UNTvydX3ZwDDf+6zelLsWduk9O68IXOh7d8D23ilHAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: virtio/vsock: Fix accept_queue memory leak As the final stages of socket destruction may be delayed, it is possible that virtio_transport_recv_listen() will be called after the accept_queue has been flushed, but before the SOCK_DONE flag has been set. As a result, sockets enqueued after the flush would remain unremoved, leading to a memory leak. vsock_release __vsock_release lock virtio_transport_release virtio_transport_close schedule_delayed_work(close_work) sk_shutdown = SHUTDOWN_MASK (!) flush accept_queue release virtio_transport_recv_pkt vsock_find_bound_socket lock if flag(SOCK_DONE) return virtio_transport_recv_listen child = vsock_create_connected (!) vsock_enqueue_accept(child) release close_work lock virtio_transport_do_close set_flag(SOCK_DONE) virtio_transport_remove_sock vsock_remove_sock vsock_remove_bound release Introduce a sk_shutdown check to disallow vsock_enqueue_accept() during socket destruction. unreferenced object 0xffff888109e3f800 (size 2040): comm "kworker/5:2", pid 371, jiffies 4294940105 hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 28 00 0b 40 00 00 00 00 00 00 00 00 00 00 00 00 (..@............ backtrace (crc 9e5f4e84): [] kmem_cache_alloc_noprof+0x2c1/0x360 [] sk_prot_alloc+0x30/0x120 [] sk_alloc+0x2c/0x4b0 [] __vsock_create.constprop.0+0x2a/0x310 [] virtio_transport_recv_pkt+0x4dc/0x9a0 [] vsock_loopback_work+0xfd/0x140 [] process_one_work+0x20c/0x570 [] worker_thread+0x1bf/0x3a0 [] kthread+0xdd/0x110 [] ret_from_fork+0x2d/0x50 [] ret_from_fork_asm+0x1a/0x30 The Linux kernel CVE team has assigned CVE-2024-53119 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10 with commit 3fe356d58efa and fixed in 6.1.119 with commit 946c7600fa22 Issue introduced in 5.10 with commit 3fe356d58efa and fixed in 6.6.63 with commit 897617a413e0 Issue introduced in 5.10 with commit 3fe356d58efa and fixed in 6.11.10 with commit 241534504224 Issue introduced in 5.10 with commit 3fe356d58efa and fixed in 6.12 with commit d7b0ff5a8667 Issue introduced in 5.9.13 with commit 2e7dd9504620 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2024-53119 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: net/vmw_vsock/virtio_transport_common.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/946c7600fa2207cc8d3fbc86a518ec56f98a5813 https://git.kernel.org/stable/c/897617a413e0bf1c6380e3b34b2f28f450508549 https://git.kernel.org/stable/c/2415345042245de7601dcc6eafdbe3a3dcc9e379 https://git.kernel.org/stable/c/d7b0ff5a866724c3ad21f2628c22a63336deec3f