Better HN
topnewbestaskshowjobs
Log inSign up

staticassertion

13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions

@insanitybit
Submissions

comment 5y ago · link · parent

No, I was right. Not that it matters, feel free to replace latency with bandwidth. Or replace it with nothing and focus on capacity. It's a blip on my point, which is that the architecture has changed considerably to allow for progress in other areas.

comment 5y ago · link · parent

TBH I think right now it's more of an incentive thing. Consider that:

a) Attackers would have to develop the POC. This will require a somewhat different skillset than typical exploitation, so there's effort involved.

b) Rowhammer is best for privilege escalation. For desktop users (where the most money is) privesc is already pretty trivial - no need for fancy exploits, you can pretty much just ask for root or use a much more straightforward exploit.

c) Exploit devs don't typically like a lot of attention. You don't want to be the first person selling rowhammer exploits unless you can charge out the ass for it, because you're gonna get way more attention for it.

These incentives aren't super technical, they're mostly market driven, and it's why we don't see fancier attacks in practice, even if they're practical. As one attacker I know was saying to me, they wish they had an excuse to do the fancy thing, but it's never worth the investment when you can own boxes way more easily. Another hacker said "I don't want a Krebs article on me because I did something clever".

NSA's incentives are not super difference, except they're not as directly financial. They also have crazy resources to fuck around with this stuff, so it would make sense that they'd demo it in a lab. Would they actually deploy it? Eh, doubtful. Against another advanced defender rowhammer should be pretty detectable by monitoring ECC metrics, and again, why would you do something fancy when you can just buy 0days - the USG purchases hundreds a year from private companies and develops more themselves.

comment 5y ago · link · parent

I've met so many people through web forums and whatnot. People think I'm absolutely insane when I mention that, I forget that it's not normal.

comment 5y ago · link · parent

Yeah I wasn't trying to imply it would cost nothing to add ECC.

comment 5y ago · link · parent

> Now you've turned specific access patterns into "attack attempts",

We already have error correction detection available to us and it's in use today.

> RAM should always hold what was last written to it, under all conditions of software accesses.

OK? That's what anyone who is advocating for ECC is already advocating for. ECC is error correcting up to 1 bit and error detecting up to 2 bits. The goal is to ensure that the property you've described holds.

> It only got created because the RAM companies have forsaken correctness,

This problem exists because... physics. Do you actually have a design for RAM that can match today's cell density while somehow providing perfect isolation? Saying this problem didn't exist 15 years ago is like saying that malware didn't impact the abacus - RAM 15 years ago was designed completely differently, and had considerably lower capabilities in terms of storage and latency.

And for reference, hamming codes (which back ECC) were created in the 1950s for error correction in punch cards. This is not a new problem.

ECC is the existing, obvious solution to this problem, it just wasn't built for this threat - but it's an excellent, proven method for correcting bit flips. Even without being designed to prevent rowhammer it already makes the attack much slower, less likely to succeed, and easier to detect (just monitor for a massive spike in ecc corrections).

Trying to design high density RAM that maintains perfect isolation seems pointless. Improving ECC or ECC-like approaches is likely going to be much more effective.

comment 5y ago · link · parent

Maybe while both ECC and non-ECC are both being sold, but that would be a temporary situation. The goal would be to have non-ECC memory be effectively deprecated, so the next revision of the spec enforces ECC as a requirement.

comment 5y ago · link · parent

I don't think that's true at all. ECC wasn't designed specifically with this attack in mind, and it's still a pretty effective mitigation.

There's nothing defective about RAM, it's never going to be the case that errors won't happen, it's just that before we were worried about heat and radiation and now we have to worry about attackers too.

comment 5y ago · link · parent

Not an expert, but I feel like the answer is not much. ECC RAM is not, to my knowledge, considerably more expensive to produce - the reason it costs more is because it only works with specific devices, so it's more of a market cost.

ECC RAM is pretty effective as-is against rowhammer, and imo you could very likely tweak ECC's approach to get even further.

The 'worst case' solution wouldn't be more than 2x, right? Since you'd just have to keep a clone of RAM, but obviously shuffled so that the same errors wouldn't occur in the same places. So 2x seems like the sort of absurd upper bound, but I feel like we could do a lot better.

comment 5y ago · link · parent

The price of ECC is artificially inflated because it's not available to consumers.

comment 5y ago · link · parent

> My point was if you’re exposing your build system to untrusted individuals inputting untrusted data then you’ve already lost the game.

This is how the vast majority of build systems are configured. If I have owned a dev and can push code to a branch I can likely execute code in their build environment. If they then parse that build output with something like awk, that's attack surface.

Is it the first thing I'd try to attack? Nope. But I do wonder what the cumulative impact of every binary on your system being memory safe would be. I'd definitely feel better.

comment 5y ago · link · parent

ECC won't necessarily shut the system down as it can actually repair single bit errors, and mismatches can be monitored for as well. But your point stands - for an attacker to do damage they'll likely end up flipping bits in unintended ways first.

comment 5y ago · link · parent

Nice, that's impressive.

comment 5y ago · link · parent

Agreed. Rowhammer is just one more example of this, but it's frustrating that ECC is not widely deployed.

comment 5y ago · link · parent

It's really worth noting that ECC does impact Rowhammer effectiveness, even if it is not enough to prevent the attack 100% of the time.

comment 5y ago · link · parent

Why even go to a site like HN if your goal is purely to make money? You can make lots of money without reading 99% of the content here.

This is Hacker news. It's news for people who want to fuck around with tech.

comment 5y ago · link · parent

If I know what it's written in I can infer a lot. If it's written in Python I know I don't want to call it in a loop, I have to care about my interpreter version if it isn't packaged with one, etc. If it's written in Rust I can infer that it'll start up quickly and likely perform well.

comment 5y ago · link · parent

It's way too hard to build evidence for something like that. Virtually all research into PL effectiveness ends up not account for the absurd number of variables.

comment 5y ago · link · parent

For CLI programs Rust is a really nice alternative to languages that require a runtime. I've significantly sped up the time for my bashrc to execute (my bashrc is heavy) by replacing certain tools with Rust tools.

If I wanted my IDE to execute something like ShellCheck on every save, or even every few character presses, I feel like I'd much rather not have to spin up a big runtime.

comment 5y ago · link · parent

Seems like this relies on tons of big assumptions. Like that climate change will negatively impact rich people in power in a reasonable timeline.

Rich people may even benefit from climate change in the short term, since during an economic downturn they can move their assets around, take risks, buy cheaper labor, etc, while everyone else is scrambling.

comment 5y ago · link · parent

That may be due to the fact that your software (like your OS) was built for a world of slow spinning disks, or maybe semi-slow SSDs at best. Not a lot of code is written with the assumption that disks are actually fast, and it's not too common to see people organizing sequential read/writes in their programs (except for dbs).

comment 5y ago · link · parent

Dropbox moved to AMD quite a while ago. Seems popular.

comment 5y ago · link · parent

> Meh, the future is higher and higher abstraction layers and higher level business logic with more and more details managed for you by the runtime.

Historically this doesn't seem entirely true. We haven't gotten much higher level than Java, outside of non-eng niches where we haven't gotten much higher level than Python (which is arguably lower level than R, which has been unseated).

So I don't think it holds true that we'll continue to chase a higher abstraction layer. We recognize the cost of doing so, and it hasn't been worth paying so far.

Besides that, Rust is quite capable of providing high level abstractions. I myself am building a sandboxing mechanism in Rust that will be entirely managed for you but with no runtime cost (it's generated statically) - it is Rust's low level power that lets me build such high level abstractions.

comment 5y ago · link · parent

I'm not sure this actually makes them wrong, if you take their statement as "ECC makes the attack more difficult/ statistically less likely". The attack you're describing is sort of akin to a heap spray attack to improve your chances of hitting your shell code.

But dropping the analogies entirely and stating explicitly is a lot better. ECC makes rowhammer less likely to succeed and slower to exploit.

comment 5y ago · link · parent

Thinking a bit about it, I suppose some advantages would be that there's less exposure by default. It's also going to be easy to audit for port 22 being hit, which an attacker might try. I could see some benefits.

comment 5y ago · link · parent

If you're really looking for a second factor for SSH, why not just use a standard 2FA approach, like a yubikey? Or even just TOTP with PAM? It seems way more effective and way less complex.

comment 5y ago · link · parent

Security by obscurity is when you hide implementation details to improve security. Secrets are not obscurity, randomness is not obscurity.

comment 5y ago · link · parent

I think it's a misdemeanor here.

comment 5y ago · link · parent

It's just a matter of your threat model.

comment 5y ago · link · parent

If you're running 3rd party code that more or less moves you into the namespace/container world or the LSM world. You aren't going to want to maintain a seccomp filter for 3rd party software.

It's going to really depend on what you're going for, but probably something along the lines of "docker + best practices" is the most bang for your buck solution.

comment 5y ago · link · parent

> - AppArmor > - SELinux > - LSM

Let's group these three up. LSM is how Apparmor and SELinux are implemented.

LSMs were the de-facto way to accomplish mandatory or role based access control on Linux, as opposed to the default user/group "discretionary" access control (DAC).

SELinux was developed for building very very powerful policies, often to its detriment as it was not unusual for policies to be flawed due to that complexity. These days though I think it's doing pretty well on Android.

Apparmor is much simpler, though less powerful. It leverages a per-process sandboxing model, mostly focusing on read/write/execute permissions for the filesystem for a given process.

> - seccomp > - seccomp-bpf

The OG seccomp gave a program access to four system calls. 'exit', 'sigreturn', 'read', and 'write'.

Basically if you had, say, a parser, you could fork and exec it within a seccomp sandbox. All it could do is read/write to the inherited pipes - so, it could read stdin, write to stdout.

Really cool, but limited.

seccomp-ebpf was an extension of the idea behind seccomp - that is, policies on system calls.

The main idea is that system calls are the way that shit gets done, whether it's exploiting the kernel or actually just performing malicious actions. So, we want to limit them.

This works by pushing policies up to the ebpf kernel virtual machine, and that thing makes decisions about what to allow or not. It's very powerful and effective, but it's hard to maintain because you have to know your syscalls ahead of time.

> - cgroups > - cgroupsV2

cgroups are less about sandboxing and more about restricting resource usage.

> - namespaces

Namespaces give a program its own view of some slice of your system. In a pid namespace it won't see other processes, unless they're in that same namespace. In a network namespace the process will think it's got its own network to itself.

This is obviously quite useful for containers.

There's even more than that though, way more.

There's Yama, another LSM. There's chroots, chroot jails. There's the entire DAC system with users and groups. Root "capabilities".

Windows isn't a ton better fwiw, it has jobs, integrity (including undocumented hidden integrity levels), virtual desktops, DAC, AppContainer (or something?), AppLocker, UAC virtualization, etc.

In terms of what to use, that depends. Apparmor and SELinux are distro-specific, but IMO Apparmor is pretty trivial to write and maintain so it's sort of a harmless thing to deliver alongside a service/application.

Seccomp is arguably the most powerful, I think in particular if it's combined with namespaces (since you can't do things like filter on pointer arguments to system calls, so filtering on file path etc is out) this is really damn powerful, assuming a tight seccomp filter. But you'll want really good test coverage so that you can determine ahead of time if you accidentally introduced a new system call.

The main thing imo is to take the dangerous part of your program and isolate it into a small component. That's just the most important thing to do, and from there sandboxing becomes (more or less) trivial. That component can run as an unprivileged user, or in a namespace with no access, or in a seccompv1 jail with nothing but a pipe for reading/ and writing.

1
959697
164