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 CC4692DC34B for ; Tue, 13 Jan 2026 15:35:48 +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=1768318548; cv=none; b=ta5UirvutcF0Axtt1Cn4Jr4TKfSKzJ4yk5M4hWedBu5JTWzz07P/g++mSx+l2dx1+Z4viL5J+D8xGcnXcwZPyLyIye7ukfvt4Wrj73iAWOo8oCxc9dJ1be2kXtHRCKk0GtiKFlvI17JwIClRfs2nM6anpk3RzgdY5+9XuBUzjl4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768318548; c=relaxed/simple; bh=w2vE6PRv9uLJ46/HXgk+tEBKmx8s8BEQE1tBI4tvS5g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=OT3O2RQnrB/dCz7kumozQEXtwrUnl3yi/duGYqo08qNMb/g4It/Gf10n/upKFHGIEVdwEvtZRoD3SvPoSV0+70BKjRbwUo4kfONJYcSvARMkwvvIpMC4vMtyoefA46p/b+42tUDclbfk1ewZyFBTchI/Fnjn7W/ivyTxfDW0YLw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VkukyjF5; 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="VkukyjF5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28F14C116C6; Tue, 13 Jan 2026 15:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768318548; bh=w2vE6PRv9uLJ46/HXgk+tEBKmx8s8BEQE1tBI4tvS5g=; h=From:To:Cc:Subject:Date:Reply-To:From; b=VkukyjF5TMw0J3Z9M3IBgPZd3bfnKXbYdGpe4CJsNOLRhgd6XSyDo+iAEztpBp7ej KCCCAzhnCSoXK0vhC9FsMaI4kj1veCcYIQ/KU4i4gStwZzF9NcOGqHL6827/c8iNb+ 1/1om52yxFz3Ok2B9zYYDBuBPBFrzeUlNtsk+VDE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-71078: powerpc/64s/slb: Fix SLB multihit issue during SLB preload Date: Tue, 13 Jan 2026 16:35:37 +0100 Message-ID: <2026011337-CVE-2025-71078-9a51@gregkh> X-Mailer: git-send-email 2.52.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=9321; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=tjst+m5NhXDpHVgNWpe63OBg1ZatWhNYVZUfk9E+yio=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlpaZ7Mtxgnzvn4VjX4pP55vVv/j4YlnBWf4LYjnV+V6 efrzYsDOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi/5cyLOi9meYt+yAwSz1K /uVBKYmKmUHpyxnmVziUHmz/MqPlC/fGBUflCmZdsH8qDQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: powerpc/64s/slb: Fix SLB multihit issue during SLB preload On systems using the hash MMU, there is a software SLB preload cache that mirrors the entries loaded into the hardware SLB buffer. This preload cache is subject to periodic eviction — typically after every 256 context switches — to remove old entry. To optimize performance, the kernel skips switch_mmu_context() in switch_mm_irqs_off() when the prev and next mm_struct are the same. However, on hash MMU systems, this can lead to inconsistencies between the hardware SLB and the software preload cache. If an SLB entry for a process is evicted from the software cache on one CPU, and the same process later runs on another CPU without executing switch_mmu_context(), the hardware SLB may retain stale entries. If the kernel then attempts to reload that entry, it can trigger an SLB multi-hit error. The following timeline shows how stale SLB entries are created and can cause a multi-hit error when a process moves between CPUs without a MMU context switch. CPU 0 CPU 1 ----- ----- Process P exec swapper/1 load_elf_binary begin_new_exc activate_mm switch_mm_irqs_off switch_mmu_context switch_slb /* * This invalidates all * the entries in the HW * and setup the new HW * SLB entries as per the * preload cache. */ context_switch sched_migrate_task migrates process P to cpu-1 Process swapper/0 context switch (to process P) (uses mm_struct of Process P) switch_mm_irqs_off() switch_slb load_slb++ /* * load_slb becomes 0 here * and we evict an entry from * the preload cache with * preload_age(). We still * keep HW SLB and preload * cache in sync, that is * because all HW SLB entries * anyways gets evicted in * switch_slb during SLBIA. * We then only add those * entries back in HW SLB, * which are currently * present in preload_cache * (after eviction). */ load_elf_binary continues... setup_new_exec() slb_setup_new_exec() sched_switch event sched_migrate_task migrates process P to cpu-0 context_switch from swapper/0 to Process P switch_mm_irqs_off() /* * Since both prev and next mm struct are same we don't call * switch_mmu_context(). This will cause the HW SLB and SW preload * cache to go out of sync in preload_new_slb_context. Because there * was an SLB entry which was evicted from both HW and preload cache * on cpu-1. Now later in preload_new_slb_context(), when we will try * to add the same preload entry again, we will add this to the SW * preload cache and then will add it to the HW SLB. Since on cpu-0 * this entry was never invalidated, hence adding this entry to the HW * SLB will cause a SLB multi-hit error. */ load_elf_binary continues... START_THREAD start_thread preload_new_slb_context /* * This tries to add a new EA to preload cache which was earlier * evicted from both cpu-1 HW SLB and preload cache. This caused the * HW SLB of cpu-0 to go out of sync with the SW preload cache. The * reason for this was, that when we context switched back on CPU-0, * we should have ideally called switch_mmu_context() which will * bring the HW SLB entries on CPU-0 in sync with SW preload cache * entries by setting up the mmu context properly. But we didn't do * that since the prev mm_struct running on cpu-0 was same as the * next mm_struct (which is true for swapper / kernel threads). So * now when we try to add this new entry into the HW SLB of cpu-0, * we hit a SLB multi-hit error. */ WARNING: CPU: 0 PID: 1810970 at arch/powerpc/mm/book3s64/slb.c:62 assert_slb_presence+0x2c/0x50(48 results) 02:47:29 [20157/42149] Modules linked in: CPU: 0 UID: 0 PID: 1810970 Comm: dd Not tainted 6.16.0-rc3-dirty #12 VOLUNTARY Hardware name: IBM pSeries (emulated by qemu) POWER8 (architected) 0x4d0200 0xf000004 of:SLOF,HEAD hv:linux,kvm pSeries NIP: c00000000015426c LR: c0000000001543b4 CTR: 0000000000000000 REGS: c0000000497c77e0 TRAP: 0700 Not tainted (6.16.0-rc3-dirty) MSR: 8000000002823033 CR: 28888482 XER: 00000000 CFAR: c0000000001543b0 IRQMASK: 3 <...> NIP [c00000000015426c] assert_slb_presence+0x2c/0x50 LR [c0000000001543b4] slb_insert_entry+0x124/0x390 Call Trace: 0x7fffceb5ffff (unreliable) preload_new_slb_context+0x100/0x1a0 start_thread+0x26c/0x420 load_elf_binary+0x1b04/0x1c40 bprm_execve+0x358/0x680 do_execveat_common+0x1f8/0x240 sys_execve+0x58/0x70 system_call_exception+0x114/0x300 system_call_common+0x160/0x2c4 >From the above analysis, during early exec the hardware SLB is cleared, and entries from the software preload cache are reloaded into hardware by switch_slb. However, preload_new_slb_context and slb_setup_new_exec also attempt to load some of the same entries, which can trigger a multi-hit. In most cases, these additional preloads simply hit existing entries and add nothing new. Removing these functions avoids redundant preloads and eliminates the multi-hit issue. This patch removes these two functions. We tested process switching performance using the context_switch benchmark on POWER9/hash, and observed no regression. Without this patch: 129041 ops/sec With this patch: 129341 ops/sec We also measured SLB faults during boot, and the counts are essentially the same with and without this patch. SLB faults without this patch: 19727 SLB faults with this patch: 19786 The Linux kernel CVE team has assigned CVE-2025-71078 to this issue. Affected and fixed versions =========================== Issue introduced in 4.20 with commit 5434ae74629af58ad0fc27143a9ea435f7734410 and fixed in 6.1.160 with commit c9f865022a1823d814032a09906e91e4701a35fc Issue introduced in 4.20 with commit 5434ae74629af58ad0fc27143a9ea435f7734410 and fixed in 6.6.120 with commit b13a3dbfa196af68eae2031f209743735ad416bf Issue introduced in 4.20 with commit 5434ae74629af58ad0fc27143a9ea435f7734410 and fixed in 6.12.64 with commit 895123c309a34d2cfccf7812b41e17261a3a6f37 Issue introduced in 4.20 with commit 5434ae74629af58ad0fc27143a9ea435f7734410 and fixed in 6.18.4 with commit 4ae1e46d8a290319f33f71a2710a1382ba5431e8 Issue introduced in 4.20 with commit 5434ae74629af58ad0fc27143a9ea435f7734410 and fixed in 6.19-rc1 with commit 00312419f0863964625d6dcda8183f96849412c6 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-2025-71078 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: arch/powerpc/include/asm/book3s/64/mmu-hash.h arch/powerpc/kernel/process.c arch/powerpc/mm/book3s64/internal.h arch/powerpc/mm/book3s64/mmu_context.c arch/powerpc/mm/book3s64/slb.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/c9f865022a1823d814032a09906e91e4701a35fc https://git.kernel.org/stable/c/b13a3dbfa196af68eae2031f209743735ad416bf https://git.kernel.org/stable/c/895123c309a34d2cfccf7812b41e17261a3a6f37 https://git.kernel.org/stable/c/4ae1e46d8a290319f33f71a2710a1382ba5431e8 https://git.kernel.org/stable/c/00312419f0863964625d6dcda8183f96849412c6