Repository navigation
[ciqlts9_6] x86/bugs: Make Safe-RET robust against interrupt injection - #1726
ciq-kernel-automation[bot] wants to merge 1 commit into
Conversation
|
🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/39695862842 |
🔍 Diffofdiffs: 1 backport differs from upstreamOpen to anyone signed in to GitHub. Report expires 2027-01-19 23:42 UTC.
Checked PR revision |
JIRA PR Check Results1 commit(s) with issues found: Commit
|
|
✅ Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/39695862842 |
Time logged. |
| SYM_CODE_END(srso_alias_return_thunk) | ||
| .popsection | ||
|
|
||
| .pushsection .noinstr.text, "ax" |
There was a problem hiding this comment.
In upstream and linux-5.15.y this is wrapped in
#ifdef CONFIG_CPU_SRSO
<code>
#endif /* CONFIG_CPU_SRSO */
There are other sections of this commit wrapped in this ... was there a specific reason the ifdef was dropped here?
There was a problem hiding this comment.
This block sits inside the pre-existing #ifdef CONFIG_MITIGATION_SRSO region that wraps the whole SRSO section (that is this trees equivalent to CONFIG_CPU_SRSO). in 5.15.y and 5.10.y that wasn't the case which is why it needed to be independently #ifdef'd.
There was a problem hiding this comment.
I didn't unroll enough to see that it was WAY up there
| SYM_CODE_END(srso_alias_return_thunk) | ||
| .popsection | ||
|
|
||
| .pushsection .noinstr.text, "ax" |
There was a problem hiding this comment.
I didn't unroll enough to see that it was WAY up there
shreeya-patel98
left a comment
There was a problem hiding this comment.
I think the upstream commit can be cherry-picked as is on 9.6. ciqlts9_6 has apply_relocation(), so the old ALTERNATIVE_2 can carry the inline __HANDLE_INTR_SAFERET() sequence.
The only thing that breaks is the build: upstream's new #include <asm/ptrace-abi.h> in nospec-branch.h makes RIP expand to 128 in .S files, and aesni-intel_asm.S still uses ONE(%RIP). Lowercasing those two operands fixes it:
--- a/arch/x86/crypto/aesni-intel_asm.S
+++ b/arch/x86/crypto/aesni-intel_asm.S
@@ -799 +799 @@
- MOVADQ ONE(%RIP),\TMP1
+ MOVADQ ONE(%rip),\TMP1
@@ -871 +871 @@
- MOVADQ ONE(%RIP),\TMP1
+ MOVADQ ONE(%rip),\TMP1Beyond that, only minor context conflicts in nospec-branch.h needed resolving. With these changes, vmlinux builds cleanly with objtool. Also register names are case-insensitive in gas, so this doesn't change the generated code.
c9b17d7
b896930 to
c9b17d7
Compare
|
🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/39968508220 |
🔍 Diffofdiffs: 1 backport differs from upstreamOpen to anyone signed in to GitHub. Report expires 2027-01-21 14:09 UTC.
Checked PR revision |
|
✅ Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/39968508220 |
jira VULN-196245 cve CVE-2026-68480 commit-author Borislav Petkov (AMD) <bp@alien8.de> commit 7e7f81c upstream-diff Two adjustments: (1) __HANDLE_INTR_SAFERET() is inserted before this tree's #ifdef __ASSEMBLY__ boundary where upstream adds it before its #ifdef __ASSEMBLER__ boundary - the same shared macro zone, so only the surrounding context differs; (2) upstream's new <asm/ptrace-abi.h> include in nospec-branch.h defines RIP as 128, which the preprocessor substitutes into the two uppercase ONE(%RIP) operands in arch/x86/crypto/aesni-intel_asm.S (lines 799 and 871, the only uppercase register-name operands in any .S file), so those are lowercased to ONE(%rip); register names are case-insensitive in gas and the assembled objects are byte-identical. An attacker injecting interrupts while the Safe-RET mitigation executes on machines affected by SRSO can neutralize the safe return sequence, potentially leading to data leakage through speculative execution. Fixup register state as if the Safe-RET sequence executed successfully by "emulating" it, in a manner of speaking, and avoid executing a RET instruction after returning from the interrupt. Co-developed-by: David Kaplan <David.Kaplan@amd.com> Signed-off-by: David Kaplan <David.Kaplan@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> (cherry picked from commit 7e7f81c) Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
c9b17d7 to
b97b40e
Compare
You are right. I think when it didn't apply I instantly went down the 5.15/5.10 route which kinda led me down this hybrid path. I've pushed something closer to upstream. See what you think. |
|
🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/39970743678 |
🔍 Diffofdiffs: 1 backport differs from upstreamOpen to anyone signed in to GitHub. Report expires 2027-01-21 14:26 UTC.
Checked PR revision |
|
✅ Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/39970743678 |
Summary
This PR has been automatically created after successful completion of all CI stages.
Commit Message(s)
Test Results
✅ Build Stage
✅ Boot Verification
✅ Kernel Selftests
✅ LTP Results
🤖 This PR was automatically generated by GitHub Actions
Run ID: 39664748730