-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raspberry Pi 4 missing firmware mitigation for Spectre v4 #1451
Comments
The linked page appears to say
so I guess that needs to go into the ARM stub. The issue is likely to be that this has a significant performance hit for all those who don't care about Spectre, so you now have to gain another version of the stub. |
maybe there could be a config.txt option to enable or disable it? |
Yes, things are possible, it just becomes further maintenance overheads. You can already override the built-in stubs by adding an appropriate file (probably |
I built armstub8-gic.bin with the following changes:
and after booting with that armstub, the |
Thanks. I didn't know your knowledge level, but provided the links in case you could make use of them. Feel free to create a PR for the stub. Ideally wrapped in a Do you have any numbers on the impact that this mitigation has? I know some of them on x86 were HUGE, but I haven't been following this one. |
PR created: raspberrypi/tools#115
so far all the testing I've done shows no impact other than Spectre v4 no longer working. do you have any recommendations of benchmarks that would be likely to show a difference? |
personally I'd want ZERO impact before enabling this by default. How many of us are using our Pi's in a multi-user environment? |
the PR wouldn't enable the mitigation by default (it's wrapped in a |
What PR? If you mean the code above, it's not wrapped in an ifdef - the one ifdef shown sets up the GIC, if GIC mode is enabled. |
raspberrypi/tools#115, which is linked three comments above yours. |
According to this: https://github.com/speed47/spectre-meltdown-checker, the Raspberry Pi 4 is also vulnerable to CVE-2018-3640. |
it is, but ARM says:
and
mitigating CVE-2018-3640 would probably require changes to the Linux kernel, rather than firmware, and probably isn't worth the trouble. |
Any updates on this? People are using the Raspberry increasingly for normal desktop tasks, so this seems like it should be fixed (with the secure variant being the default). Does the Linux kernel contain the necessary mitigations as well? |
idk, pi4 is pretty slow as a desktop os, I'd certainly prefer it not the default, or at the least very easy to switch. |
Spectre mitigation is enabled in the kernel, and raspberrypi/tools#117 was merged last October. Do you have some reason to believe this is not sufficient? |
Because the issue is still open? |
That, and the referenced raspberrypi/tools#115 hasn't been merged. Was it superseded by raspberrypi/tools#117 then? |
Hmm... the PR for raspberrypi/tools#117 suggests that it could supersede raspberrypi/tools#115, but although we've enabled the standard kernel mitigation I don't see anything that actually does set the "disable load pass store" bit of CPUACTLR_EL1. Since the rewrite, raspberrypi/tools#115 no longer applies and will need to be updated, but that will still leave the mitigation as optional (enabled either by an external stub file or by an as-yet-non-existent firmware config.txt setting). |
and (perhaps) more importantly, if it's in there by default, how do we disable the mitigations? |
If what is in there by default?:
|
the cpu-slowing mitigation. we posted at the same time, so now that I've read your post it sounds like no spectre mitigations are enabled by default, which is good. |
Wouldn't it make the most sense if it was somehow set through the kernel mitigations option as well? Or is that not feasible? Any other way is likely to be missed by someone: if it defaults to on people who use the raspberry without untrusted code will get unexpected slowness and if it defaults to off people will set the kernel mitigations option and possibly think they're safe. Neither of these outcomes seems ideal. |
Not sure what you are suggesting, but config.txt has the best visibility I
know of.
…On Thu, Sep 16, 2021 at 9:27 AM Ellie ***@***.***> wrote:
enabled either by an external stub file or by an as-yet-non-existent
firmware config.txt setting
Wouldn't it make the most sense if it was somehow set through the kernel
mitigations option as well? Or is that not feasible? Any other way is
likely to be missed by someone: if it defaults to on people who use the
raspberry without untrusted code will get unexpected slowness and if it
defaults to off people will set the kernel mitigations option and think
they're safe. Neither of these outcomes seems ideal.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1451 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANPGZ5M4RTOCB2LWTFCYBU3UCILH7ANCNFSM4P2U4UFA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
The mitigations kernel option. It is for sure more known under the general Linux population, and since it needs to be set to the desired value anyway having a separate config.txt option that unexpectedly also controls a part of this has IMHO for sure less visibility. As I understand it, if someone sets mitigations=auto,nosmt the expectation would be that everything is enabled without digging into other options. |
If the kernel mitigation is enabled on the command line then detecting it and setting the magic bit accordingly is feasible, |
If that would reliably work with major distros and partitioning setups (like with LUKS/unlocking initramfs), then that sounds like the best variant to me personally, linking it to the kernel mitigations option. But maybe someone else has input on this as well. |
The whole breakdown between cmdline.txt and config.txt is confusing as
heck, you never know where to look for your options. But at least
config.txt allows comments so you can list what options are available and
briefly describe their function. cmdline.txt is hugely less user friendly.
…On Thu, Sep 16, 2021 at 9:53 AM Ellie ***@***.***> wrote:
If that would reliably work with major distros and partitioning setups
(like with LUKS/unlocking initramf), then that sounds like the best variant
to me personally, linking it to the kernel mitigations. But maybe someone
else has input on this as well.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1451 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANPGZ5IYPUKCKJ4NPACIE2DUCIOJBANCNFSM4P2U4UFA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Via rpi4-uefi + the generic Fedora ARM64 image I think the kernel options usually reside in |
No - it wouldn't work with UEFI, grub or any other ways of passing in a kernel command line, which makes me think the config.txt setting to set the "disable load pass store" bit (and only do that) is the most general solution. |
Yes, that might be correct then @ config.txt being best. My suggestion would still be to enable it by default, but you'll probably get tons of voices (as above) disagreeing. But IMHO having an unexpected discovery you ran slower than desired is better than having an unexpected discovery you thought all mitigations were on when they were not. |
I'm not too worked up about the default setting as long as it's well
documented as to how to change it (and when it comes to pi documentation,
"well documented" rarely applies), and there's a status message printed
telling you that it's enabled/disabled during boot. Of course bootup is
full of so many status messages most of which are so completely irrelevant
to anything a user would care about that an actually important status
message would be easy to miss.
…On Fri, Sep 17, 2021 at 10:27 AM Ellie ***@***.***> wrote:
Yes, that might be correct then. My suggestion would still be to enable it
by default, but you'll probably get tons of voices (as above) disagreeing.
But IMHO having an unexpected discovery you ran slower than desired is
better than having an unexpected discovery you thought all mitigations were
on when they were not.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1451 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANPGZ5MMTGLDQRSLSY7HGNTUCN26XANCNFSM4P2U4UFA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Describe the bug
the Raspberry Pi 4's Cortex-A72 cores are vulnerable to Spectre v4 (Speculative Store Bypass, CVE-2018-3639). according to ARM, there's a firmware mitigation available for this vulnerability, but the mitigation seems to not be present on the Raspberry Pi 4.
To reproduce
spectre_v4
demoExpected behaviour
Actual behaviour
System
Pi 4
cat /etc/rpi-issue
)?Arch Linux ARM aarch64
vcgencmd version
)?uname -a
)?The text was updated successfully, but these errors were encountered: