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 C31D38004F for ; Mon, 29 Jul 2024 15:53:08 +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=1722268388; cv=none; b=CR9qbZI9Nrw0Edk99gNvfQC7AsOwKiFNfOYi5mfb5AXC8EY5CV9aTjNfQGN0YDelMGtioMf8JKL/05KPByRrqtc18MYPdlzPMZKnGjsLohfv96Tl0uv/xaioii5/Lw/2vTOweCvTkJ89Kubh+hcbIXlIGs3HC6mmGEAWOhBb8ik= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722268388; c=relaxed/simple; bh=UpTHHmSTetTJIV90eTCBo5Heu/qDjCZWp4TRMDsHX5g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pqhPlFCbEAZO/C/EV2abdZGf0zWuIU0zfuaXhL0PHaebuqTMiN0pFcbvahCKXlH4anf9Ygljr6Y3yaBmEg+OoWYK2KpO9TqPGnQP0pLpNOzhXQOMhXMYzLLAK5syBMZ1bp3mZ7GHzCO3PLw0WeNH4CQTvMyk2iBvykS/irB+DGo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WmCLXKGq; 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="WmCLXKGq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5429C32786; Mon, 29 Jul 2024 15:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1722268388; bh=UpTHHmSTetTJIV90eTCBo5Heu/qDjCZWp4TRMDsHX5g=; h=From:To:Cc:Subject:Date:Reply-to:From; b=WmCLXKGq0vFYs9kYRpw/DZauW/7TI8c9xLEQ/+fF/wcqsW7/9iB1TmJ20z7bcIdrJ bKfLb7OicQf8qTGzTprTpiXFt9Pv2DaYl9y3+DEePBHBnsZsLfGdrs8a2OdMzhmI1J PMJCO4mmijvRzQVtjZlAoVFOWHHrlwJ3aIWjNvyQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-42072: bpf: Fix may_goto with negative offset. Date: Mon, 29 Jul 2024 17:53:01 +0200 Message-ID: <2024072953-CVE-2024-42072-d6af@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=2369; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=UpTHHmSTetTJIV90eTCBo5Heu/qDjCZWp4TRMDsHX5g=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnLd12tu3zuXnNbKpdh8MEVsR8+7L5wopy99bDrxb8qQ UV5M+2cO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi9t4M89Nmz4oPbCgIMRZY 1LDwvyOzUS1LC8OCRSxnFO/3v3Tht/Z4oGwyb9nvB0wPAA== 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 may_goto with negative offset. Zac's syzbot crafted a bpf prog that exposed two bugs in may_goto. The 1st bug is the way may_goto is patched. When offset is negative it should be patched differently. The 2nd bug is in the verifier: when current state may_goto_depth is equal to visited state may_goto_depth it means there is an actual infinite loop. It's not correct to prune exploration of the program at this point. Note, that this check doesn't limit the program to only one may_goto insn, since 2nd and any further may_goto will increment may_goto_depth only in the queued state pushed for future exploration. The current state will have may_goto_depth == 0 regardless of number of may_goto insns and the verifier has to explore the program until bpf_exit. The Linux kernel CVE team has assigned CVE-2024-42072 to this issue. Affected and fixed versions =========================== Issue introduced in 6.9 with commit 011832b97b31 and fixed in 6.9.8 with commit 175827e04f4b Issue introduced in 6.9 with commit 011832b97b31 and fixed in 6.10 with commit 2b2efe1937ca 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-42072 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/verifier.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/175827e04f4be53f3dfb57edf12d0d49b18fd939 https://git.kernel.org/stable/c/2b2efe1937ca9f8815884bd4dcd5b32733025103