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 8F08A1C287 for ; Thu, 22 Aug 2024 03:33:25 +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=1724297605; cv=none; b=Z5jrl/MoY+uCbg9kd5+/fnAIbVVl9z9qAWYZ3qxPAXbto/pRPQrrUX+SD+BHU149EZv9RBFFjA3ffEcXILU4NjWddMGXOxCoBNTRCOKGrn0eRGPVlRFALLxwkY00RwUlPyBWT5EcMudCc7ZkwyB4XdYTPgrfZTbB6PbBRIKyMLU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724297605; c=relaxed/simple; bh=yt0gzvOhoUmZb+mcdxx7A6+4H9SjL4wfaoKs9J/6X4s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kJtE1x+yo5CYo3fit2QelniWCkCwqx0uKHvK6hYT5mYQdaeHeYexcwwIBCEwFruvjHibU1WD60RNEpBtZfTM4XigsiQRRtI4JUVjEyS19Nd+3HhGeAC3C1sysE7bYH0jvwsS/hqZK7fssxhPkTDBV6ARPKYcHuXh2Bote4Xy6ZE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VooUbd3O; 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="VooUbd3O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D19BC4AF09; Thu, 22 Aug 2024 03:33:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1724297605; bh=yt0gzvOhoUmZb+mcdxx7A6+4H9SjL4wfaoKs9J/6X4s=; h=From:To:Cc:Subject:Date:Reply-to:From; b=VooUbd3O2o2hIo9KQ8bGfV2wqyo52IYDrvYPobawkxHvjpzk/oq9K7HDyifAAOaN+ xq8PyYZAPYm1l12Sg2HqXEwJM3/Lih1EMmbYAG12Q6CW2Zgo7j5T3W+59OaJNSVJHQ ieA81zMDIGLKqk6mHvMbE1Nxn3NLVPjDR0+FT8Io= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48929: bpf: Fix crash due to out of bounds access into reg2btf_ids. Date: Thu, 22 Aug 2024 11:31:30 +0800 Message-ID: <2024082222-CVE-2022-48929-857d@gregkh> X-Mailer: git-send-email 2.46.0 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=2525; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=yt0gzvOhoUmZb+mcdxx7A6+4H9SjL4wfaoKs9J/6X4s=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnHNnLNdksU3H7jjaWavpJTUIjTN9V5T9iPRWzcq2W8p FLols+ajlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIYyXDgnmvjF0OsW8s3VHs 5q/Dfc355iTziQzzq3adct+XqSj42oBfr+9Ka6NlxE9ZAA== 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: bpf: Fix crash due to out of bounds access into reg2btf_ids. When commit e6ac2450d6de ("bpf: Support bpf program calling kernel function") added kfunc support, it defined reg2btf_ids as a cheap way to translate the verifier reg type to the appropriate btf_vmlinux BTF ID, however commit c25b2ae13603 ("bpf: Replace PTR_TO_XXX_OR_NULL with PTR_TO_XXX | PTR_MAYBE_NULL") moved the __BPF_REG_TYPE_MAX from the last member of bpf_reg_type enum to after the base register types, and defined other variants using type flag composition. However, now, the direct usage of reg->type to index into reg2btf_ids may no longer fall into __BPF_REG_TYPE_MAX range, and hence lead to out of bounds access and kernel crash on dereference of bad pointer. The Linux kernel CVE team has assigned CVE-2022-48929 to this issue. Affected and fixed versions =========================== Issue introduced in 5.15.15 with commit e8efe8369944 and fixed in 5.15.37 with commit 8c39925e98d4 Issue introduced in 5.16.1 with commit 931e56be527f and fixed in 5.16.12 with commit f0ce1bc9e023 Issue introduced in 5.10.92 with commit 35ab8c9085b0 Issue introduced in 5.16.11 with commit 77459bc4d5e2 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-48929 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: kernel/bpf/btf.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/8c39925e98d498b9531343066ef82ae39e41adae https://git.kernel.org/stable/c/f0ce1bc9e0235dd7412240be493d7ea65ed9eadc https://git.kernel.org/stable/c/45ce4b4f9009102cd9f581196d480a59208690c1