News for hackers. Stuff that matters.
Re:Spectre mitigations murder userspace performance by thanksforfish on Saturday June 19, 2021 @08:46AM (#27559995)
Unfortunately "install a piece of software" also includes allowing javascript to run in your browser. So the risk may be closer to "clicking a link".

https://www.zdnet.com/article/google-this-spectre-proof-of-c...

Additionally, the passwords and keys on your local dev box are very valuable for further attacks, like supply chain attacks.

Re:Spectre mitigations murder userspace performance by hjek on Saturday June 19, 2021 @09:42AM (#27560389)
> Unfortunately "install a piece of software" also includes allowing javascript to run in your browser.

Per-process Spectre mitigations could be helpful there, but I don't understand the technical details to know whether that would be possible to implement. It would be nice to disable mitigations on a video editor and for gaming.

Re:Spectre mitigations murder userspace performance by pjmlp on Saturday June 19, 2021 @10:21AM (#27560650)
If gaming implies a MMO, a possible attack vector is attacking users to get hold of their gaming account details and do as they please.
Re:Spectre mitigations murder userspace performance by usrusr on Saturday June 19, 2021 @03:35PM (#27563673)
The way I understand it (not that well, admittedly), per-process mitigations would be all about keeping that process from reading other memory areas, not about protecting that process from others. Which is better than the reverse if your intention is to allow some processes to run random js.
Re:Spectre mitigations murder userspace performance by pjmlp on Saturday June 19, 2021 @04:26PM (#27564143)
Yeah, but in the context of games, most likely it means threaded code written in C or C++.

If anything Spectre has shown us that the only real mitigation is to go back to multiprocessing with IPC, with the extra hardware resources it entails, as the exploit exists regardless of the language for in-process memory.

Re:Spectre mitigations murder userspace performance by genmud on Saturday June 19, 2021 @10:42PM (#27566646)
The problem with spectre/meltdown is they don't use standard calls to ask for memory of other processes... that is the vulnerability.

If you were do to do per process mitigation it would need to prevent certain process execution flows from happening, because the vulnerability is a problem with the CPU pulling memory from the way speculative execution works. This actually impacts things that are typically protected and is much more impactful than people think... for example, because the bug allows reading from nearly any memory address space, you could also pull in things like crypto keys from the OS or passwords from memory.

Re:Spectre mitigations murder userspace performance by usrusr on Sunday June 20, 2021 @05:29AM (#27568484)
Yeah, but if you can mitigate per process, you can keep the secrets of trusted code from the eyes of untrusted code by only affecting the performance of the untrusted processes. The way I understand it the "protection cost" would fall on potential attackers, not on potential victims (unless of course they are both, holders of secrets and runners of untrusted code).
Re:Spectre mitigations murder userspace performance by genmud on Monday June 21, 2021 @05:21PM (#27584677)
Unfortunately, that is incorrect understanding. In the context of stuff like this, "untrusted code" can be so many different things, it isn't just being able to run an executable... The issue with these vulnerabilities is the processor "pre-runs/prefetches" certain things for performance, which would likely be run in the future, so that it has those results cached, or to increase the amount of instructions in a CPU cycle. The issue is that many of these things aren't direct executable code, but more like access patterns.

For example, a speculative execution vulnerability might exist when there is a string of data in memory that has a memcp pattern, with memory addresses that are valid. To speed up the execution of programs, the processor might proactively read the memory from that memcp pattern because it is sending a command to the memory controller already.

Many of the mitigation techniques are to flush the caches/buffers and be careful about memory reads, which are the precise things that actually take the performance hits. And one of the problems is since they are access patterns, the vulnerabilities can be the html renderer compiled with an application, an SVG rendering library or a mail client.

For example, lets say there are mitigations built into the JS library... if you build a specifically crafted SVG, you could create similar access patterns to get around it. Its a huge cat and mouse game if there aren't OS protections and it only takes a single app to lose your secrets stored in memory.

Re:Spectre mitigations murder userspace performance by temac on Saturday June 19, 2021 @10:33AM (#27560732)
Opt-in per-process spectre mitigation is already the case for some of them, because the mitigations in question are way too costly.

Now it is not possible for every kind of mitigations, because e.g. patching the kernel between mitigated processes and unmitigated ones would be more costly than just always running the mitigations.

edit: thinking more about it: you could have crazy ideas like two versions of the whole kernel space always loaded :D not sure about the cache impact in this case though.

Re:Spectre mitigations murder userspace performance by FunnyLookinHat on Saturday June 19, 2021 @11:06AM (#27561063)
Yeah no disagreement there. I had totally forgotten about the JS POC - ugh!

The JavaScript argument is interesting to me in that it's already flawed. I suppose I'd rather focus on the security issues with browsers running code on my computer more than anything else since it's effectively the "but what about ___" answer to so many threads like this one.

I've seen a few other comments suggesting per-process rules to enable or disable branch protections. That's an interesting thought, especially considering you could apply it to either "trusted" or "untrusted" code depending on it's source.

Re:Spectre mitigations murder userspace performance by fiddlerwoaroof on Saturday June 19, 2021 @12:57PM (#27562148)
With Arm big.little architectures, it could start making sense to have dedicated in-order cores for running JavaScript and other “untrusted” code.

Also, I wonder if disabling mitigations on the desktop and running the browser in a VM with mitigations enabled would be effective.

Re:Spectre mitigations murder userspace performance by saagarjha on Saturday June 19, 2021 @02:34PM (#27563074)
People want their websites to load fast, though.
Re:Spectre mitigations murder userspace performance by reader_mode on Saturday June 19, 2021 @09:17AM (#27560206)
How long would you have to run JavaScript on your desktop to leak sensitive information and has there been any known exploits in the wild ?
Re:Spectre mitigations murder userspace performance by mhh__ on Saturday June 19, 2021 @09:41AM (#27560384)
https://leaky.page/

I don't know about the wild, but if this were tuned (i.e. this requires a lot of work for the first byte, the rest are easy) for a HVT you wouldn't know.

Re:Spectre mitigations murder userspace performance by ggreer on Saturday June 19, 2021 @01:53PM (#27562656)
On my laptop's Core i5-10210U with mitigations=off, the demo just prints "[!] error: could not infer memory layout" until it runs out of retries.

This is on Chromium 91.0.4472.106 and kernel 5.12.11-arch1-1. lscpu shows vulnerabilities:

    Itlb multihit:         KVM: Mitigation: VMX disabled
    L1tf:                  Not affected
    Mds:                   Not affected
    Meltdown:              Not affected
    Spec store bypass:     Vulnerable
    Spectre v1:            Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers
    Spectre v2:            Vulnerable, IBPB: disabled, STIBP: disabled
    Srbds:                 Mitigation; TSX disabled
    Tsx async abort:       Not affected
Re:Spectre mitigations murder userspace performance by diveanon on Saturday June 19, 2021 @07:40PM (#27565591)
I got the same result on a pretty similar system.
Re:Spectre mitigations murder userspace performance by magila on Saturday June 19, 2021 @11:39AM (#27561426)
The problem is that PoC is extracting data which the PoC itself created specifically to facilitate said extraction. AFAIK no one has created a PoC which can extract specific data which hasn't been constructed to facilitate the PoC.
Re:Spectre mitigations murder userspace performance by christophilus on Saturday June 19, 2021 @09:23AM (#27560249)
Yes, but your fans would start spinning like mad. I kill any browser that does that. You’d have to execute a successful attack within a few seconds to pull it off. I think that’s a risk I’ll take.
Re:Spectre mitigations murder userspace performance by titzer on Saturday June 19, 2021 @10:02AM (#27560532)
If this is your security mechanism (chuckle), then attackers will just slow themselves down by duty cycling. Say, only attacking for 100ms at a time, then sleeping a second. You'd never know.
Re:Spectre mitigations murder userspace performance by userbinator on Saturday June 19, 2021 @05:44PM (#27564733)
...making it even more unlikely the attack would find anything of value (or even recognisable as such) in a reasonable amount of time.

To use an analogy, these side-channel timing attacks are really a "looking for a needle in a haystack" (or heap...) situation, except that [1] you don't necessarily know what a needle looks like, and [2] the haystack is constantly changing. AFAIK all the PoCs shown so far relied on having a deep knowledge of the system and carefully constructed conditions.

If these attacks could undetectably dump all of your RAM in a few seconds, that would definitely be a huge concern. But they're more like being able to read a few bytes per second, from somewhere in the address space, with no idea what they are or where they're being read from, and no guarantee that they're even contiguous.

Re:Spectre mitigations murder userspace performance by xrisk on Saturday June 19, 2021 @09:31AM (#27560313)
I don’t think that’s a good safety heuristic.
Re:Spectre mitigations murder userspace performance by hjek on Saturday June 19, 2021 @09:46AM (#27560418)
I agree that it's not good, yet anecdotally I've realized that a device has been compromised by running `top`, on Windows and on Linux. It's not a good heurestic because it's only disvoverable post-compromise.
Re:Spectre mitigations murder userspace performance by jtbayly on Saturday June 19, 2021 @11:01AM (#27561002)
I’ve discovered a compromise before because of the fans going full speed on a server.
Re:Spectre mitigations murder userspace performance by jwif029jf209jf on Saturday June 19, 2021 @10:19AM (#27560633)
> Yes, but your fans would start spinning like mad. I kill any browser that does that.

Good lord, I hope this is satire.

Re:Spectre mitigations murder userspace performance by sp332 on Saturday June 19, 2021 @10:47AM (#27560867)
I think they mean the browser window/process. I also tend to kill off tabs that do this.
Re:Spectre mitigations murder userspace performance by BuyMyBitcoins on Saturday June 19, 2021 @09:17PM (#27566136)
I can’t tell you how many startup’s splash page animations have actually caused my PC fans to spin at maximum. What is this website possibly doing with all my available computing power?
Re:Spectre mitigations murder userspace performance by mhh__ on Saturday June 19, 2021 @09:32AM (#27560316)
Why would you fans start spinning? You can extract data at at least hundreds of MB/s with these exploits, you wouldn't know.
Re:Spectre mitigations murder userspace performance by formerly_proven on Saturday June 19, 2021 @09:38AM (#27560369)
That's the first time I have heard a number this high for these exploits. All prior numbers I've heard were many orders of magnitude smaller, more like byte/s. The article linked above cites 1 kB/s as novel.
Re:Spectre mitigations murder userspace performance by mhh__ on Saturday June 19, 2021 @09:43AM (#27560397)
That was a number I heard (Meltdown pre-mitigations) when the "oh shit" papers started dropping a few years ago, could be misremembering. I'm also still slightly inebriated so thank you for nerdsniping me (Lit Review time!)
Re:Spectre mitigations murder userspace performance by treis on Saturday June 19, 2021 @09:44AM (#27560405)
I thought the browsers had put in their own mitigations that stop spectre/meltdown attacks.
Re:Spectre mitigations murder userspace performance by eloff on Saturday June 19, 2021 @09:54AM (#27560466)
They tried. The V8 team eventually gave up and said it was unwinnable.

What they did do is move tabs to their own process so they can take average of the operating systems protections. Yes you can read the memory of the process hosting the JavaScript, but now there isn't anything interesting in it. Google's security team released a proof of concept attack that can read the memory in the renderer in many systems.

Re:Spectre mitigations murder userspace performance by jacquesm on Saturday June 19, 2021 @10:04AM (#27560547)
average -> advantage
Re:Spectre mitigations murder userspace performance by eloff on Saturday June 19, 2021 @01:42PM (#27562550)
Man mobile keyboards suck. Any idiot knows the word average doesn't work there (at minimum you'd have to preface it with the word "the"), so why can't my keyboard run an ML model that's not an idiot?
Re:Spectre mitigations murder userspace performance by richrichardsson on Sunday June 20, 2021 @05:18AM (#27568418)
Didn't even notice until reading this comment! I think my brain said, "starts with an A, got a V near the beginning, ends in AGE, must be ADVANTAGE in this context."
Re:Spectre mitigations murder userspace performance by krylon on Saturday June 19, 2021 @11:57AM (#27561595)
I've never thought about this, but how big are the performance penalties for Spectre mitigations vs not having Javascript JIT?

(Just to be clear, I'm perfectly happy with the performance of my old-ish machine, so I have no motivation to disable those mitigations.)

Re:Spectre mitigations murder userspace performance by netr0ute on Saturday June 19, 2021 @09:17AM (#27560205)
That's what JavaScript blockers like NoScript and uBlock Origin are for.
Re:Spectre mitigations murder userspace performance by diegocg on Saturday June 19, 2021 @11:15AM (#27561173)
Ad blockers can not know if a JavaScript algorithm is dangerous or not
Re:Spectre mitigations murder userspace performance by a1369209993 on Saturday June 19, 2021 @02:03PM (#27562766)
It doesn't matter if it's dangerous or not if it doesn't get to run in the first place.
Re:Spectre mitigations murder userspace performance by netr0ute on Saturday June 19, 2021 @01:48PM (#27562603)
People do, and the JS algorithms will get added to adblocker lists in no time.