Skip to content

add Cortex-A72 Spectre v4 (CVE-2018-3639) mitigation#115

Open
lilyanatia wants to merge 1 commit intoraspberrypi:masterfrom
lilyanatia:spectre_v4
Open

add Cortex-A72 Spectre v4 (CVE-2018-3639) mitigation#115
lilyanatia wants to merge 1 commit intoraspberrypi:masterfrom
lilyanatia:spectre_v4

Conversation

@lilyanatia
Copy link

mitigate Spectre v4:

For Cortex-A57 and Cortex-A72:

  • Set bit 55 (disable load pass store) of CPUACTLR_EL1 (S3_1_C15_C2_0).

pelwell pushed a commit that referenced this pull request Oct 8, 2020
- The bootstub has been completely rewritten taking advantage of the
  Thumb-2 instruction set, which results in major space gains
- Res0 bits of NSACR are no longer set (supersedes #85)
- CNTVOFF is set to zero, now consistent with armstub8 (supersedes #113)
- SMC instructions are now disabled, now consistent with armstub8
- ACTLR is now configured to allow Non-secure access to several CPU
  configuration registers (CPUACTLR/CPUECTLR/L2CTLR/L2ECTLR/L2ACTLR),
  which makes it possible to e.g. enable Spectre v4 mitigations directly
  in the kernel without needing a separate bootstub variant
  (potentially supersedes #115)

Free space in each affected bootstub after this commit:

  armstub7.bin:        108 bytes
  armstub8-32.bin:     104 bytes
  armstub8-32-gic.bin:  44 bytes (!)
@ell1e
Copy link

ell1e commented Feb 25, 2026

Is there any info available on how to enable this mitigation for the Raspberry Pi 4 & 5? A config.txt option would be nice if it's not enabled by default, which was suggested here it won't be.

@popcornmix
Copy link
Contributor

Build the stubs in this PR copy armstub8-gic-spectrev4.bin to boot directory of sdcard.
Add to config.txt armstub=armstub8-gic-spectrev4.bin

Note: this will only affect Pi4. The Pi5 stub comes from arm's TFA which should already support this.

@ell1e
Copy link

ell1e commented Feb 25, 2026

The Pi5 stub comes from arm's TFA which should already support this.

So is the Raspberry Pi 5 using all mitigations after all? Some contributors seemed to believe that's not the case.

I'm saddened to hear there might never be a config option to make this more accessible for interested users. Perhaps the prebuilt stubs could be offered somewhere with a short guide, at least?

@popcornmix
Copy link
Contributor

This is the stub file if you want to try it.

armstub8-gic-spectrev4.bin

@ell1e
Copy link

ell1e commented Feb 25, 2026

I would love to help! However, I only have a Raspberry Pi 5 at the moment. I'm guessing this is for RPI4?

@popcornmix
Copy link
Contributor

. I'm guessing this is for RPI4?

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants