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 E85746F2E7 for ; Mon, 10 Jun 2024 09:03:38 +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=1718010219; cv=none; b=Sh4uwxIl5eOMM5JaZuimUPMMjMiemjGPsbXralEeAzPTHc5I51RPKF8twWF0Rcd0IlYUlaL8fD4AglJWLdKrupDARPrrKW7+Rn4nepZRjTVWa1niDrstoHBiVJaCsAmlLsxkdXRZ3oQn9s7Bc0eJg5FEL/5ItamvQknLJGMnrjs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718010219; c=relaxed/simple; bh=ck4puSqoSDJUZclx0ivLWTPs6NnEv91PqcDGXHAHZTI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TtMTYNGUBE1QspaTxzPkdOZgez39VR2sG6R6ZjorJJj7AYPwTKfK0bkfI2NcslQ4ZbG6DnLbaRSIzeRXx9E6WcfT0c/kue9jyQ+uBQJjowp5yhOHyVo0AYbdHKTI55Y36xzLOsBpkn4HEQOYptw9Xd14sDK8aweQfra+0tgu0sk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UHt0gdaQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UHt0gdaQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D116DC2BBFC; Mon, 10 Jun 2024 09:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718010218; bh=ck4puSqoSDJUZclx0ivLWTPs6NnEv91PqcDGXHAHZTI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=UHt0gdaQScKyAT9wWrhnwX36x/lJWqnlUHoaBGbFdxVolzzXP9PHV4+J1EJxkRqf2 Y0heFp49XxZZrZIcSA3DKClNMc4RgzlC3Z7ZFAPFWMkqJvfPHHbOr75SJp5kv1qJ0Y KkGePlkYv4SntdwA4LZNFd6l+eGbqUejPiPG4/4kUZUoItu4ZvDHkGUfg2dWbVer1y hBN2ri6VT6GMasbBPCPGMsVc6faQZuxJjcXPJobCP7E5nBg1Wus4AhEf0BFTGvaQS3 ghqDJVGW+qOqv3VxSZQjBNzdLYUR0XVusAKBtjbQho+6NuIfyVbs2rCv5KalPITtz6 b96/lTjBj58lg== From: Lee Jones To: linux-cve-announce@vger.kernel.org Cc: Lee Jones Subject: CVE-2024-36971: net: fix __dst_negative_advice() race Date: Mon, 10 Jun 2024 10:03:31 +0100 Message-ID: <20240610090330.1347021-2-lee@kernel.org> X-Mailer: git-send-email 2.45.2.505.gda0bf45e8d-goog 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=2335; i=lee@kernel.org; h=from:subject; bh=ck4puSqoSDJUZclx0ivLWTPs6NnEv91PqcDGXHAHZTI=; b=owEBbQKS/ZANAwAKAVGvii+H/HdhAcsmYgBmZsFiZAkNMq02p3yMxwKvdClFCLP/jIUmZygzM RwSiA2/KUSJAjMEAAEKAB0WIQR2tsk1o74gmpTwh0hRr4ovh/x3YQUCZmbBYgAKCRBRr4ovh/x3 YTFGD/4yBE11duc2RScQNcKizObNcu4jShl/I2vKXXGOke+jNFKCXCIvNdcNKTiF3kj9QdNYGwJ bR5skBkI5rErVqniNev/wWqvfYTMZHYS/0ocS8lNiB/Ef48OGNXVhmtCnLtOgGm+wqKA+32jpXX XmQt1ZW85iIUlQHZBPVmIg6yVmyYZuvsmi2GOqasquli7u42lo5qvB0Ecih0qcFVMWFfokbd/fv 17IYJcbqBnmC4GjY/ZSTLG6AwTWjBSbDyjLJRcHehboIGOrgWR36oCAIadiNGmEvlMpQPA1vdfw 357KRM0QDGagvdAbsERBytEn2d+BCAo7MIQeOxb5HhAiVO57c1McIcjdO2q6SiurMY7U6dmM7wF k3sflLMTjgpnF1/efTAGrSaWL20W2QLUc7deHyGltrEzfV2afcqLHvD7O57r6AdY9sPfgYUBa3L qvzixVABO3Qmt83/zQume2GDH1G2rM493FTppdvNJu8Nv6qOBzzpQskjkM2j1jN59TF+OXCf7tu uXMHxp/FWShtfaGSndVuokOMqibfPJ74cyVdZdMEnyW3AS6M2rW0W94bmyGOzWZ4oFa2m6JW54V LqJlBK0A2KQVlEyegd59gD2NJj+s/iI9SEZo5ZS94/XYReo3nE6fzo+vC1vCPEUuFjyPMbkG/6a AjeI+C0Lyt0tpqA== X-Developer-Key: i=lee@kernel.org; a=openpgp; fpr=76B6C935A3BE209A94F0874851AF8A2F87FC7761 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: net: fix __dst_negative_advice() race __dst_negative_advice() does not enforce proper RCU rules when sk->dst_cache must be cleared, leading to possible UAF. RCU rules are that we must first clear sk->sk_dst_cache, then call dst_release(old_dst). Note that sk_dst_reset(sk) is implementing this protocol correctly, while __dst_negative_advice() uses the wrong order. Given that ip6_negative_advice() has special logic against RTF_CACHE, this means each of the three ->negative_advice() existing methods must perform the sk_dst_reset() themselves. Note the check against NULL dst is centralized in __dst_negative_advice(), there is no need to duplicate it in various callbacks. Many thanks to Clement Lecigne for tracking this issue. This old bug became visible after the blamed commit, using UDP sockets. The Linux kernel CVE team has assigned CVE-2024-36971 to this issue. Affected and fixed versions =========================== Issue introduced in 4.6 with commit a87cb3e48ee8 and fixed in 6.10-rc2 with commit 92f1655aa2b2 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-36971 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_ops.h include/net/sock.h net/ipv4/route.c net/ipv6/route.c net/xfrm/xfrm_policy.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/92f1655aa2b2294d0b49925f3b875a634bd3b59e