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 004DE199242 for ; Tue, 16 Jul 2024 11:46:40 +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=1721130401; cv=none; b=p4OaJLEJf0xUTRJ1WtQ2YauFSF1sTdYkNxFas6DAGyUgXgCCvdj6sR/laWIT7ixSGMji8xLFqLNgcbWoU7lA1A+XOwFBYGZGMcM7cPgXppU4Xs+KAypD1x+gBeoZClCTVBjP0gu9hUHCCpBMdilOXo4fx7au+vaNjAStCZF+Rao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721130401; c=relaxed/simple; bh=qtwY6Tq/MqSEk4mbGeSEg8LaFwPE/xfpFS3ToDKc4N0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=P7cMt1HGp/zP5/IaZDF2fsXgP1jxSp6t1ZuMvATUn599TaQ1FQv5K5KY8dUTjxtzibwd5Ipq9hVDH1zc7DGn2M94RtFZNDoeWXykt6dkVco3HyIvR+nePbLiNEQseXWaWSent8dxCwHkVoO7vTLfgRrkLjaalPLglddpcDeoEOc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CqZ9e0i1; 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="CqZ9e0i1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 735B4C4AF09; Tue, 16 Jul 2024 11:46:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1721130400; bh=qtwY6Tq/MqSEk4mbGeSEg8LaFwPE/xfpFS3ToDKc4N0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=CqZ9e0i1S2ABijJqDvTQOEHAvZJ2zWkqamVlk/M97ICqgigfLotpoJKkZi5Frmf47 YO4TwrGgaYfdUEg7W3dYoNuLYY+C/OJsjBcSS9YWnGQMN4k/XKP9FLu2DC5fH6To2g 5UX8rJwglVtzcMDMV9Wpn/QrCFSVzJlaWVKmcY3g= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48809: net: fix a memleak when uncloning an skb dst and its metadata Date: Tue, 16 Jul 2024 13:46:01 +0200 Message-ID: <2024071646-CVE-2022-48809-ba13@gregkh> X-Mailer: git-send-email 2.45.2 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=3360; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=qtwY6Tq/MqSEk4mbGeSEg8LaFwPE/xfpFS3ToDKc4N0=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnTYrP+Kb5wuPj+y5TpGveLNnK6+/WrXZqv8Etr9l3XY x2BDMJLOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAireIMCw4+PSWYf2jPlPL2 nCmCm6RNf7KKHGBYMFmPwWCtzvOb6Ux64ecWt0yaz+j/HQA= 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: net: fix a memleak when uncloning an skb dst and its metadata When uncloning an skb dst and its associated metadata, a new dst+metadata is allocated and later replaces the old one in the skb. This is helpful to have a non-shared dst+metadata attached to a specific skb. The issue is the uncloned dst+metadata is initialized with a refcount of 1, which is increased to 2 before attaching it to the skb. When tun_dst_unclone returns, the dst+metadata is only referenced from a single place (the skb) while its refcount is 2. Its refcount will never drop to 0 (when the skb is consumed), leading to a memory leak. Fix this by removing the call to dst_hold in tun_dst_unclone, as the dst+metadata refcount is already 1. The Linux kernel CVE team has assigned CVE-2022-48809 to this issue. Affected and fixed versions =========================== Issue introduced in 4.3 with commit fc4099f17240 and fixed in 4.9.302 with commit 4ac84498fbe8 Issue introduced in 4.3 with commit fc4099f17240 and fixed in 4.14.267 with commit c1ff27d100e2 Issue introduced in 4.3 with commit fc4099f17240 and fixed in 4.19.230 with commit 0be943916d78 Issue introduced in 4.3 with commit fc4099f17240 and fixed in 5.4.180 with commit a80817adc2a4 Issue introduced in 4.3 with commit fc4099f17240 and fixed in 5.10.101 with commit 00e6d6c3bc14 Issue introduced in 4.3 with commit fc4099f17240 and fixed in 5.15.24 with commit fdcb263fa5cd Issue introduced in 4.3 with commit fc4099f17240 and fixed in 5.16.10 with commit 8b1087b998e2 Issue introduced in 4.3 with commit fc4099f17240 and fixed in 5.17 with commit 9eeabdf17fa0 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-2022-48809 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: include/net/dst_metadata.h 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/4ac84498fbe84a00e7aef185e2bb3e40ce71eca4 https://git.kernel.org/stable/c/c1ff27d100e2670b03cbfddb9117e5f9fc672540 https://git.kernel.org/stable/c/0be943916d781df2b652793bb2d3ae4f9624c10a https://git.kernel.org/stable/c/a80817adc2a4c1ba26a7aa5f3ed886e4a18dff88 https://git.kernel.org/stable/c/00e6d6c3bc14dfe32824e2c515f0e0f2d6ecf2f1 https://git.kernel.org/stable/c/fdcb263fa5cda15b8cb24a641fa2718c47605314 https://git.kernel.org/stable/c/8b1087b998e273f07be13dcb5f3ca4c309c7f108 https://git.kernel.org/stable/c/9eeabdf17fa0ab75381045c867c370f4cc75a613