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 809F51624E0 for ; Wed, 26 Feb 2025 02:15:43 +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=1740536143; cv=none; b=KcjO8gpgsUyqLkxvJ2UNN3B1DNrb9IKGmWSwG9fyfQs5vtZTvg3u3++6e2jRhG03mkIZUn84TVk8Ytt4iEOuy5MiTRynZu6fd+qiFjaS3F+ivZLakv4CViNAQ8Ol1X3kXxiakQcFNv4rObm30iatT01C7zKE0AOQ1d7SSXZJYxg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740536143; c=relaxed/simple; bh=5T76G9ofd2vTAA7Lv3ha8C1oJaEd90nLjj/K6h7ZA14=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TPGKuymmxIou7cNOc8nyNFg6qJSLuVjOmbtn3HtIsRNoCnBz3CrdSsqPEJR3rwT5hKfjsRVNo35Qd73EJMaXFLHKsGrVd4K05vSUYpkCsJ8Ff6kA/bMv/UYw198U646usN1QIQZCDXWwlcxnUIAkyH11Is+zD+bzCd1bs83q+Eo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=M9ZE7B6Q; 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="M9ZE7B6Q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5693CC4CEDD; Wed, 26 Feb 2025 02:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740536143; bh=5T76G9ofd2vTAA7Lv3ha8C1oJaEd90nLjj/K6h7ZA14=; h=From:To:Cc:Subject:Date:Reply-to:From; b=M9ZE7B6QN7yGx5CUfcVgp7gCekSliRT0UCBr11CpxQ7zQ1jAPnCNJoeQQDhiEwBTq IRMse5r6sxRUkuY5oMJ5zM6KcWvs2u3PHE32s3eKuVRyjSRhr+70/DnBe4NHvOmUJe NDKFEG1MHm2EmMCXUpIYH5T/6dPy3oAnc6gzChmk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49552: bpf: Fix combination of jit blinding and pointers to bpf subprogs. Date: Wed, 26 Feb 2025 03:13:46 +0100 Message-ID: <2025022616-CVE-2022-49552-e30f@gregkh> X-Mailer: git-send-email 2.48.1 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=3084; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=5T76G9ofd2vTAA7Lv3ha8C1oJaEd90nLjj/K6h7ZA14=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7Kji2tU5XnRjz5IffYZN5lg95FR4XLVrib6YZf1Tj8 poXhzmiO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAipn4MC+ZxfHL63FywtkK3 wv3dhcAzp57vWcKwYLXXn7d99o/jkiPOHr7t33yopefrRQA= 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 combination of jit blinding and pointers to bpf subprogs. The combination of jit blinding and pointers to bpf subprogs causes: [ 36.989548] BUG: unable to handle page fault for address: 0000000100000001 [ 36.990342] #PF: supervisor instruction fetch in kernel mode [ 36.990968] #PF: error_code(0x0010) - not-present page [ 36.994859] RIP: 0010:0x100000001 [ 36.995209] Code: Unable to access opcode bytes at RIP 0xffffffd7. [ 37.004091] Call Trace: [ 37.004351] [ 37.004576] ? bpf_loop+0x4d/0x70 [ 37.004932] ? bpf_prog_3899083f75e4c5de_F+0xe3/0x13b The jit blinding logic didn't recognize that ld_imm64 with an address of bpf subprogram is a special instruction and proceeded to randomize it. By itself it wouldn't have been an issue, but jit_subprogs() logic relies on two step process to JIT all subprogs and then JIT them again when addresses of all subprogs are known. Blinding process in the first JIT phase caused second JIT to miss adjustment of special ld_imm64. Fix this issue by ignoring special ld_imm64 instructions that don't have user controlled constants and shouldn't be blinded. The Linux kernel CVE team has assigned CVE-2022-49552 to this issue. Affected and fixed versions =========================== Issue introduced in 5.13 with commit 69c087ba6225b574afb6e505b72cb75242a3d844 and fixed in 5.17.13 with commit a029b02b47dd5bb87a21550d9d9a80cb4dd3f714 Issue introduced in 5.13 with commit 69c087ba6225b574afb6e505b72cb75242a3d844 and fixed in 5.18.2 with commit d106a3e96fca30e44081eae9c27aab28fc132a46 Issue introduced in 5.13 with commit 69c087ba6225b574afb6e505b72cb75242a3d844 and fixed in 5.19 with commit 4b6313cf99b0d51b49aeaea98ec76ca8161ecb80 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-49552 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/core.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/a029b02b47dd5bb87a21550d9d9a80cb4dd3f714 https://git.kernel.org/stable/c/d106a3e96fca30e44081eae9c27aab28fc132a46 https://git.kernel.org/stable/c/4b6313cf99b0d51b49aeaea98ec76ca8161ecb80