From mboxrd@z Thu Jan 1 00:00:00 1970 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 B06E828D8D1 for ; Wed, 18 Jun 2025 11:13:51 +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=1750245231; cv=none; b=hSakZTDwA5ZGAmOZqOydwR40I0lal+xh1r6/ybnYfzcwclK/MIKNdAGxB91acW5vYl9eRiFmldtoL3YhhqxNVseqr/QA1vupTVJr3iSRW9zLJgandVG61H8lbdza2/X1CEbOQ4Zb5pekyYPKe7JmGXaKleQz0CaQkqeSG72Z1D8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750245231; c=relaxed/simple; bh=nImPgY2QWgBG7G6hLmgLRlHQT6h8YoUoph+6dz1hhQ0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=B4+QI8poyTDy4ZxZXgdkFaxwwNQa8NdK0XDXanC2RCiDAfcbCYl858yP+Eqzy+6Ies/DvYuyT/7Qmw+rUov025yEppsf/liDxI4IpuU+C6bEwBghb29oQGPuuuc6320THFiZ3YQqDWaFUBGf4eWHIlqUf7Vb/fYUMFYrY/yxi5c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=r09rVIIt; 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="r09rVIIt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E41AC4CEE7; Wed, 18 Jun 2025 11:13:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750245231; bh=nImPgY2QWgBG7G6hLmgLRlHQT6h8YoUoph+6dz1hhQ0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=r09rVIItPf7EAtEooEZASHUZEhbtYGfXmMa4TLejjWqJdFHcRiDzeM5qMToCzB+dt WNlgmJ2GddjHjXtfixPw7vj0Vu8mRYw7Jq1HW1pcRpYd4TSrG+zHjceOKJwq6LF7Nw FS+BgHTk79UUF7PMY50OH8/BJAaWOYkdKQ43Hob8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50167: bpf: fix potential 32-bit overflow when accessing ARRAY map element Date: Wed, 18 Jun 2025 13:03:52 +0200 Message-ID: <2025061827-CVE-2022-50167-e4bf@gregkh> X-Mailer: git-send-email 2.49.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=2390; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=lrniWmg7WLdgEHcQ1K5DBYgpRjdtXpiw1Fvr+Fl51qM=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBczq+b2Q6+obvucW0I3aBk9vTS7s9Ar2fnbhgIMmVu P0l98/mjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjISm6GefZ2koJi1yXSiwwm HPV5e2BPgsUXe4a5UiXH9/05LFu15Gz6WbUV7oGFiyvuAAA= 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: fix potential 32-bit overflow when accessing ARRAY map element If BPF array map is bigger than 4GB, element pointer calculation can overflow because both index and elem_size are u32. Fix this everywhere by forcing 64-bit multiplication. Extract this formula into separate small helper and use it consistently in various places. Speculative-preventing formula utilizing index_mask trick is left as is, but explicit u64 casts are added in both places. The Linux kernel CVE team has assigned CVE-2022-50167 to this issue. Affected and fixed versions =========================== Issue introduced in 5.3 with commit c85d69135a9175c50a823d04d62d932312d037b3 and fixed in 5.18.18 with commit 063e092534d4c6785228e5b1eb6e9329f66ccbe4 Issue introduced in 5.3 with commit c85d69135a9175c50a823d04d62d932312d037b3 and fixed in 5.19.2 with commit 3c7256b880b3a5aa1895fd169a34aa4224a11862 Issue introduced in 5.3 with commit c85d69135a9175c50a823d04d62d932312d037b3 and fixed in 6.0 with commit 87ac0d600943994444e24382a87aa19acc4cd3d4 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-50167 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/arraymap.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/063e092534d4c6785228e5b1eb6e9329f66ccbe4 https://git.kernel.org/stable/c/3c7256b880b3a5aa1895fd169a34aa4224a11862 https://git.kernel.org/stable/c/87ac0d600943994444e24382a87aa19acc4cd3d4