The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Linux 6.6.149
@ 2026-08-06 17:32 Greg Kroah-Hartman
  2026-08-06 17:32 ` Greg Kroah-Hartman
  2026-08-07  4:22 ` CVE-2026-68480 mitigations for older stable series (was: Re: Linux 6.6.149) Salvatore Bonaccorso
  0 siblings, 2 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2026-08-06 17:32 UTC (permalink / raw)
  To: linux-kernel, akpm, torvalds, stable; +Cc: lwn, jslaby, Greg Kroah-Hartman

I'm announcing the release of the 6.6.149 kernel.

All users of the 6.6 kernel series must upgrade.

The updated 6.6.y git tree can be found at:
	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.6.y
and can be browsed at the normal kernel.org git web browser:
	https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h

------------

 Makefile                             |    2 -
 arch/x86/entry/entry_64.S            |    8 ++++-
 arch/x86/include/asm/nospec-branch.h |   56 +++++++++++++++++++++++++++++++++++
 arch/x86/kernel/cpu/bugs.c           |   39 ++++++++++++++++++++++++
 arch/x86/lib/retpoline.S             |   20 ++++++++++++
 5 files changed, 123 insertions(+), 2 deletions(-)

Borislav Petkov (AMD) (1):
      x86/bugs: Make Safe-RET robust against interrupt injection

Greg Kroah-Hartman (1):
      Linux 6.6.149


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linux 6.6.149
  2026-08-06 17:32 Linux 6.6.149 Greg Kroah-Hartman
@ 2026-08-06 17:32 ` Greg Kroah-Hartman
  2026-08-07  4:22 ` CVE-2026-68480 mitigations for older stable series (was: Re: Linux 6.6.149) Salvatore Bonaccorso
  1 sibling, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2026-08-06 17:32 UTC (permalink / raw)
  To: linux-kernel, akpm, torvalds, stable; +Cc: lwn, jslaby, Greg Kroah-Hartman

diff --git a/Makefile b/Makefile
index 62de0a92ea10..f64070d333e2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 6
 PATCHLEVEL = 6
-SUBLEVEL = 148
+SUBLEVEL = 149
 EXTRAVERSION =
 NAME = Pinguïn Aangedreven
 
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 1f9e508ac075..3aee64b51921 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -976,6 +976,8 @@ SYM_CODE_START(paranoid_entry)
 	IBRS_ENTER save_reg=%r15
 	UNTRAIN_RET_FROM_CALL
 
+	HANDLE_INTR_SAFERET 8(%rsp)
+
 	RET
 SYM_CODE_END(paranoid_entry)
 
@@ -1078,6 +1080,11 @@ SYM_CODE_START(error_entry)
 	movl	%ecx, %eax			/* zero extend */
 	cmpq	%rax, RIP+8(%rsp)
 	je	.Lbstep_iret
+
+	VALIDATE_UNRET_END
+
+	HANDLE_INTR_SAFERET 8(%rsp)
+
 	cmpq	$.Lgs_change, RIP+8(%rsp)
 	jne	.Lerror_entry_done_lfence
 
@@ -1096,7 +1103,6 @@ SYM_CODE_START(error_entry)
 	FENCE_SWAPGS_KERNEL_ENTRY
 	CALL_DEPTH_ACCOUNT
 	leaq	8(%rsp), %rax			/* return pt_regs pointer */
-	VALIDATE_UNRET_END
 	RET
 
 .Lbstep_iret:
diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
index c7d019b0ef4a..43a2daeef5ef 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -186,6 +186,50 @@
 	add	$(BITS_PER_LONG/8), %_ASM_SP;		\
 	lfence;
 
+/*
+ * Helper for detecting if an interrupt occurred at an unsafe location within
+ * Safe-RET.  If Safe-RET is interrupted after the CALL or LEA the RSB may get
+ * poisoned by the interrupt handler.
+ *
+ * The Safe-RET sequence is:
+ *
+ * CALL
+ * LEA 8(%RSP), %RSP
+ * RET
+ *
+ * The two CMPs below check whether RIP points to after the CALL or after the
+ * LEA.
+ *
+ * The LFENCE below is to address this particular speculation case:
+ *
+ * 1. Userspace runs and poisons the BTB around the safe-RET routine
+ *
+ * 2. Userspace triggers some kind of exception
+ *
+ * 3. Kernel executes error_entry() and mis-speculates the branch into thinking
+ *    it actually came from kernel space
+ *
+ * 4. The kernel then further mis-speculates that the exception occurred due
+ *    to an interrupted safe-RET
+ *
+ * 5. The handle_interrupted_saferet() routine speculatively executes and
+ *    speculatively does a safe-RET. But this is unsafe since it was never
+ *    untrained.
+ *
+ * The LFENCE fixes this by ensuring step 5 is never reached speculatively.
+ * Note that this LFENCE only occurs if safe-RET was actually interrupted (so
+ * it's outside of the normal path).
+ */
+#define __HANDLE_INTR_SAFERET(name, pt_regs)		\
+	cmpq	$(name), RIP+pt_regs;			\
+	jb	1f;					\
+	cmpq	$(name)+5, RIP+pt_regs;			\
+	ja	1f;					\
+	lfence;						\
+	leaq	pt_regs, %rdi;				\
+	call	handle_interrupted_saferet;		\
+	1:
+
 #ifdef __ASSEMBLY__
 
 /*
@@ -315,6 +359,14 @@
 #define UNTRAIN_RET_FROM_CALL \
 	__UNTRAIN_RET X86_FEATURE_ENTRY_IBPB, __stringify(RESET_CALL_DEPTH_FROM_CALL)
 
+.macro HANDLE_INTR_SAFERET pt_regs
+#ifdef CONFIG_MITIGATION_SRSO
+	ALTERNATIVE_2 "", \
+	__stringify(__HANDLE_INTR_SAFERET(srso_safe_ret, \pt_regs)), X86_FEATURE_SRSO, \
+	__stringify(__HANDLE_INTR_SAFERET(srso_alias_safe_ret, \pt_regs)), X86_FEATURE_SRSO_ALIAS
+
+#endif
+.endm
 
 .macro CALL_DEPTH_ACCOUNT
 #ifdef CONFIG_CALL_DEPTH_TRACKING
@@ -649,6 +701,10 @@ static __always_inline void x86_idle_clear_cpu_buffers(void)
 		x86_clear_cpu_buffers();
 }
 
+void srso_safe_ret(void);
+void srso_alias_safe_ret(void);
+void handle_interrupted_saferet(struct pt_regs *regs);
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_X86_NOSPEC_BRANCH_H_ */
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 32a27c19acde..bf57acd42186 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -3489,3 +3489,42 @@ ssize_t cpu_show_vmscape(struct device *dev, struct device_attribute *attr, char
 	return cpu_show_common(dev, attr, buf, X86_BUG_VMSCAPE);
 }
 #endif
+
+#ifdef CONFIG_MITIGATION_SRSO
+/*
+ * Called during exception/interrupt entry if interrupted during the
+ * safe-RET sequence.  The safe-RET sequence consists of 3 instructions:
+ *
+ *	CALL
+ *	LEA 8(%RSP), %RSP
+ *	RET
+ *
+ * An interrupt after the CALL or after the LEA could potentially lead
+ * to branch predictor poisoning and results in the sequence not being
+ * able to be safely resumed.
+ *
+ * Therefore, modify the regs state as if the remaining part of the
+ * safe-RET sequence executed so the interrupt returns back to the
+ * desired return target, instead of the to the safe-RET sequence.
+ */
+void noinstr handle_interrupted_saferet(struct pt_regs *regs)
+{
+	unsigned long rip = regs->ip;
+
+	if (rip == (unsigned long) srso_safe_ret ||
+	    rip == (unsigned long) srso_alias_safe_ret) {
+	    /* Modify stack pointer as if LEA executed: */
+	    regs->sp += 8;
+	}
+
+	/*
+	 * Adjust registers as if RET executed:
+	 *
+	 * 1. Read the return address off the stack and into rIP:
+	 */
+	regs->ip = *(unsigned long *)(regs->sp);
+
+	/* 2. Pop rIP off the stack: */
+	regs->sp += 8;
+}
+#endif /* CONFIG_MITIGATION_SRSO */
diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S
index 91ce427d5af1..46404f46140e 100644
--- a/arch/x86/lib/retpoline.S
+++ b/arch/x86/lib/retpoline.S
@@ -161,10 +161,24 @@ __EXPORT_THUNK(srso_alias_untrain_ret)
 
 	.pushsection .text..__x86.rethunk_safe
 SYM_START(srso_alias_safe_ret, SYM_L_GLOBAL, SYM_A_NONE)
+
+	/*
+	 * Tell objtool that those are not function pointers referenced by
+	 * __HANDLE_INTR_SAFERET(). Below too.
+	 */
+	ANNOTATE_NOENDBR
+
+	/*
+	 * Safe-RET sequence. If you need to change it, adjust
+	 * handle_interrupted_saferet() too.
+	 */
 	lea 8(%_ASM_SP), %_ASM_SP
 	UNWIND_HINT_FUNC
+
+	ANNOTATE_NOENDBR
 	ANNOTATE_UNRET_SAFE
 	ret
+	/* End of Safe-RET sequence */
 	int3
 SYM_FUNC_END(srso_alias_safe_ret)
 
@@ -199,8 +213,14 @@ SYM_START(srso_untrain_ret, SYM_L_LOCAL, SYM_A_NONE)
  * the stack.
  */
 SYM_INNER_LABEL(srso_safe_ret, SYM_L_GLOBAL)
+	/*
+	 * Safe-RET sequence. If you need to change it, adjust
+	 * handle_interrupted_saferet() too.
+	 */
 	lea 8(%_ASM_SP), %_ASM_SP
 	ret
+	/* End of Safe-RET sequence */
+
 	int3
 	int3
 	/* end of movabs */

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* CVE-2026-68480 mitigations for older stable series (was: Re: Linux 6.6.149)
  2026-08-06 17:32 Linux 6.6.149 Greg Kroah-Hartman
  2026-08-06 17:32 ` Greg Kroah-Hartman
@ 2026-08-07  4:22 ` Salvatore Bonaccorso
  2026-08-07  4:30   ` Borislav Petkov
  1 sibling, 1 reply; 5+ messages in thread
From: Salvatore Bonaccorso @ 2026-08-07  4:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Borislav Petkov; +Cc: linux-kernel, stable, David Kaplan

Hi Greg, hi Borislav,

On Thu, Aug 06, 2026 at 07:32:17PM +0200, Greg Kroah-Hartman wrote:
> I'm announcing the release of the 6.6.149 kernel.
> 
> All users of the 6.6 kernel series must upgrade.
> 
> The updated 6.6.y git tree can be found at:
> 	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.6.y
> and can be browsed at the normal kernel.org git web browser:
> 	https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

It got mentioned outside of the stable list that the backports of
7e7f81cf6f5c ("x86/bugs: Make Safe-RET robust against interrupt
injection") to address CVE-2026-68480 will not work. So raising the
problem here.

In fact at least they depend on CONFIG_MITIGATION_SRSO, which only was
renamed in a033eec9a06c ("x86/bugs: Rename CONFIG_CPU_SRSO
=> CONFIG_MITIGATION_SRSO") v6.9-rc1, correct?

Borislav, can you have a look for the older backports?

Regards,
Salvatore

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: CVE-2026-68480 mitigations for older stable series (was: Re: Linux 6.6.149)
  2026-08-07  4:22 ` CVE-2026-68480 mitigations for older stable series (was: Re: Linux 6.6.149) Salvatore Bonaccorso
@ 2026-08-07  4:30   ` Borislav Petkov
  2026-08-07  6:31     ` Borislav Petkov
  0 siblings, 1 reply; 5+ messages in thread
From: Borislav Petkov @ 2026-08-07  4:30 UTC (permalink / raw)
  To: Salvatore Bonaccorso
  Cc: Greg Kroah-Hartman, linux-kernel, stable, David Kaplan

Hi,

On Fri, Aug 07, 2026 at 06:22:50AM +0200, Salvatore Bonaccorso wrote:
> In fact at least they depend on CONFIG_MITIGATION_SRSO, which only was
> renamed in a033eec9a06c ("x86/bugs: Rename CONFIG_CPU_SRSO
> => CONFIG_MITIGATION_SRSO") v6.9-rc1, correct?

Yeah, I'm very sorry about that.

> Borislav, can you have a look for the older backports?

Already sent fixed versions to Greg, waiting for him to wake up.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: CVE-2026-68480 mitigations for older stable series (was: Re: Linux 6.6.149)
  2026-08-07  4:30   ` Borislav Petkov
@ 2026-08-07  6:31     ` Borislav Petkov
  0 siblings, 0 replies; 5+ messages in thread
From: Borislav Petkov @ 2026-08-07  6:31 UTC (permalink / raw)
  To: Salvatore Bonaccorso
  Cc: Greg Kroah-Hartman, linux-kernel, stable, David Kaplan

On Thu, Aug 06, 2026 at 09:30:32PM -0700, Borislav Petkov wrote:
> Hi,
> 
> On Fri, Aug 07, 2026 at 06:22:50AM +0200, Salvatore Bonaccorso wrote:
> > In fact at least they depend on CONFIG_MITIGATION_SRSO, which only was
> > renamed in a033eec9a06c ("x86/bugs: Rename CONFIG_CPU_SRSO
> > => CONFIG_MITIGATION_SRSO") v6.9-rc1, correct?
> 
> Yeah, I'm very sorry about that.
> 
> > Borislav, can you have a look for the older backports?
> 
> Already sent fixed versions to Greg, waiting for him to wake up.

Fixes are out now.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-07  6:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 17:32 Linux 6.6.149 Greg Kroah-Hartman
2026-08-06 17:32 ` Greg Kroah-Hartman
2026-08-07  4:22 ` CVE-2026-68480 mitigations for older stable series (was: Re: Linux 6.6.149) Salvatore Bonaccorso
2026-08-07  4:30   ` Borislav Petkov
2026-08-07  6:31     ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox