Is disabling hyperthreading worth it? Asking for hardening Arch Linux a little bit
I quote from Arch Wiki: https://wiki.archlinux.org/index.php/Security#Disable_Hyper-Threading
Kernel Developer Greg Kroah-Hartman has endorsed disabling Hyper-Threading as a security hardening option for systems running untrusted code. (Web browsers that enable Javascript are an example of untrusted code.) This may have a small performance impact.
Is this really a neccesary thing? Do you have some useful security tips?
About this post
- Posted
- Archived
- Score
- 4 · 100% up
- Kind
- Text
- ID
- fswtpa
12 comments
As with any security conscious decision, it depends on your threat model and use cases. If you're a home user I wouldn't worry too much about it. A firewall and smart choices should be enough to keep you safe form any threats you are likely to encounter. If you're running Arch in some "production" environment, then I'm concerned that you're asking this question here, as you should already know the answer. It all comes down to what you're doing, your threat model, and what sacrifices you're willing to make in the name of security.
For a home pc? No. It is a significant performance hit for a slight decrease in probability of getting pwned, assuming good practices.
Block everything you don't need on the internet (eg ublock origin, umatrix, noscript)
Generally don't use software not inside the official repos. Make very few exceptions which you make sure are coming from trustworthy sources.
Keep everything up to date all the time
Enforce safe communications (https, signatures)
The core concept of the above advice is that it's more effective to avoid malicious shit altogether than it is to worry about minor hardening modifications. I mean if an attacker gets you to run a malicious script as your main user without air-tight sandboxing, they might as well just steal all your valuable personal info directly rather than exploit hyper-threading vulnerabilities.
On top of that suggestions like disabling HT for “security” reasons (I know it can be a valid attack vector) are extremely easy but basically do nothing other than reduce performance.
Where as not doing stupid shit, or installing or running arbitrary things, refusing non-secure communications, using extensions like no script, or umatrix require effort on a consistent basis are far and away more effective at securing your desktop or laptop.
The sad truth is that people are most likely to run into security or privacy issues with their web browsing. The web is pretty unusable as we know it without JavaScript, or very selectively loading things with umatrix for every website.
It’s got to the point now that if a site won’t load with allowance from umatrix I don’t need to load it. Or it gets loaded in a sandboxed environment. This is a fairly common occurrence and far more difficult to deal with than any other common security related thing.
I guess this is a thing to be checked on a case-by-case basis. For example I had HT turned off and it didn't have a big impact on my (mostly) office work and compilation of small-to-mid-size Java projects. This changed when I started working with Rust that heavily utilizes CPU and RAM and that made me enable HT back on.
Agreed. Fortunately browsers un-shipped high-precision timers because visiting a random page is just that - allowing remote code to run on your own PC.
Do you have sensitive data? / Do you think that you may be target of malicious people?
If your answer for those questions is "No", I wouldn't worry about that. Just be aware and take the common security practices.
Just because you're NOT paranoid, doesn't mean that they're not after you...
Be that as it may, taking the common security practices is enough for a common user. Specially on Linux.
Most web browsers run in a sandbox environment (it's really hard to find vurnelabilities in that type of environment) by now so you shouldn't really care about it if you're doing just that, if you want to max out on security then use an AMD processor with OpenBSD
that's exactly why hardware vulnerabilities are likely to be used in that type of environment. outside of locked down environments like that, there are often plenty of software vulnerabilities that are much easier to exploit.
I have all mitigations enabled (ie hyper threading disabled) on all public facing servers, it’s too much of a risk leaving a known attack vector open 24/7.
Other devices that are used sparingly or for testing/staging purposes do not have mitigations enabled.
Deleted before we saved it.
To be fair, I'm pretty sure you and I would be just fine if we were to use stock Linux with no hardening and with
mitigations=offkernel parameter (which turns off all CPU vulnerability mitigations).Though it doesn't hurt to have at least have these mitigations enabled (as per default), i.e. a bit of hardening is reasonable compared to none), but there's also no need to go all-in as for us, random home users, there isn't any much threat anyways.
At the end of the day, developers of Arch Linux (and of Linux and related software in general) very likely know deep downs of hardware and things like security very well, so I assume that keeping hyperthreading enabled by default is a conscious and a reasoned decision they made and that it is completely reasonable to trust them on that decision.
But if you feel like doing it, either because it makes you feel better about security or don't want to risk it or anything, by all means, definitely harden everything. I assume you don't need maximally high performance out of your hardware either (though it would be nice lol), so, dunno, your choice.
What I guess is that you should just go ahead and disable it, why not! Just try it for yourself, see if you notice any meaningful performance decrease, and then see if it bothers you, and then decide at your own discretion.