Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 2941A38399C for ; Sat, 25 Jul 2026 08:56:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784969790; cv=none; b=IRvqXjv5c73K29LaZvRIajaoLorcSS7V68Uxz6LznM8VdPLw4ltr1fW494ReyrGOClWemPfaVoLTBC3TbdJFkzR28RJr6sLxLozx0BzvQt7t4mEMfUWVaW67jN7S61wh9kFqAARzwbmgun/wJDlDA+I3x5dpOlw6i+WFcal6syk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784969790; c=relaxed/simple; bh=kjAp9rjHPxy//30fw+PFh450O8ry8X8xXonBX0enw38=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pHcq2ZTpqxxcCap4weBTUc9WyBoDd/+uwtDLPyILBAlzi4/5BEYmqKhjW+3JREJWlSCeB6wF/bX7PaY44lYO5uO5a6DU893FJmWHPXMM1HQEqlPTPRJDvRa25jS9hT8XCisoYM86xuw0xzHHfviwVFeRMupyNSV/IMEB2M+Esec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yyorqr41; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yyorqr41" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 885B01F000E9; Sat, 25 Jul 2026 08:56:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784969789; bh=MZEyKbbeMkfdXDfqYyKDb839IAaYHfTFyX4abIY8xiw=; h=From:To:Cc:Subject:Date:Reply-To; b=yyorqr41pLhSl1bnb7QGKlddr+3UE4RBRj0TBJ8d92tnhOxTL2h1ndrQJf+LT66c8 aOtVR0DyGednxcrRQklV+f+i8xuLEY+/pdu3p5bqAoPOJ0I3I+hvBVpSLpeqUfbuL3 zI6O/1VopxLUJ9wjyB/eQfjMRSl+i45NrUohevig= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-64354: bpf: Validate BTF repeated field counts before expansion Date: Sat, 25 Jul 2026 10:49:31 +0200 Message-ID: <2026072519-CVE-2026-64354-a771@gregkh> X-Mailer: git-send-email 2.55.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2911; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=QZrpLKlnvkQnwwuwT7VEmTYS6FB4QDjlH64OyeELw0c=; b=owGbwMvMwCRo6H6F97bub03G02pJDFkpFcHG3q+FVy475f7YSW1z3oalkjd79X+K1iXfa5/SZ GcsfSynI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACYSFcswV3Lr7Ci35KnqpRW7 N/idvftw4VexMoYFk7w7Dn1y4eL/M2d5Us+6s+Kmp+9KAAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: bpf: Validate BTF repeated field counts before expansion btf_parse_struct_metas() walks user-supplied BTF during BPF_BTF_LOAD, and btf_repeat_fields() expands repeatable fields from array elements into the fixed BTF_FIELDS_MAX scratch array used by btf_parse_fields(). The remaining-capacity check performs the expanded field count calculation in u32. A malformed BTF can wrap that calculation, causing the check to pass even when the expanded field count exceeds the scratch array capacity. The following memcpy() can then write past the end of the array. Use checked addition and multiplication before copying repeated fields and reject impossible counts. The Linux kernel CVE team has assigned CVE-2026-64354 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12 with commit 797d73ee232dd1833dec4824bc53a22032e97c1c and fixed in 6.12.96 with commit c5ff816d5f13900c3f1f3298cfcc61339e056e56 Issue introduced in 6.12 with commit 797d73ee232dd1833dec4824bc53a22032e97c1c and fixed in 6.18.39 with commit cd407de2ef5dc70f1970b343ffaa16186340fdfd Issue introduced in 6.12 with commit 797d73ee232dd1833dec4824bc53a22032e97c1c and fixed in 7.1.4 with commit ff77d013b737c0f77d925e2f2c59f0cf3d76bd35 Issue introduced in 6.12 with commit 797d73ee232dd1833dec4824bc53a22032e97c1c and fixed in 7.2-rc1 with commit b9452b594fd3aecbfd4aa0a6a1f741330a37dab7 Issue introduced in 6.11.6 with commit 6f957d972feee9b385ea3ae6530310a84e55ba71 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-2026-64354 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/c5ff816d5f13900c3f1f3298cfcc61339e056e56 https://git.kernel.org/stable/c/cd407de2ef5dc70f1970b343ffaa16186340fdfd https://git.kernel.org/stable/c/ff77d013b737c0f77d925e2f2c59f0cf3d76bd35 https://git.kernel.org/stable/c/b9452b594fd3aecbfd4aa0a6a1f741330a37dab7