Better HN
topnewbestaskshowjobs
Log inSign up

staticassertion

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

@insanitybit
Submissions

comment 9y ago · link · parent

Should be able to escape docker with this. Docker provides host kernel access, so if you get the kernel you're good to go.

comment 9y ago · link · parent

That makes no sense.

comment 9y ago · link · parent

I don't understand what you're getting at. One program is vulnerable, therefor make all programs vulnerable?

comment 9y ago · link · parent

The non-zero performance impact on ASLR is basically 0, and impacts link-time performance more than anything else, which most devs should not care about. So before you start going for the tiniest of microoptimizations maybe profile.

Yes, there is absolutely reason to use ASLR. This attack assumes that an attacker can get the target program to eval arbitrary code. This is not something most programs do. If you are remotely exploiting a vulnerable SSH, or some service, this attack provides nothing to you. ASLR is still very effective for this use case.

This is why I find this paper so frustrating.

comment 9y ago · link · parent

Not really seeing the contradiction. ASLR is still effective where it was always intended to be effective. ASLR is ineffective given an attacker with more control than ASLR was designed to be useful against.

comment 9y ago · link · parent

ASLR is a mitigation for ROP given certain constraints - the ability to arbitrarily execute code, allocate memory, would break those constraints. This is true of any mitigation technique, there are capabilities an attacker can have that will make it less relevant or irrelevant.

ASLR is still totally viable for defending against an attacker who can not already execute arbitrary code. This article makes it sound like ASLR has been completely defeated, but it's only defeated in a context where the attacker has significant control - even if that's a likely scenario.

comment 9y ago · link · parent

Developers generally can't make informed decisions about security. It should remain in developer control, I guess, but most developers have no business disabling it.

comment 9y ago · link · parent

What? Which part is not the case? This attack does require executing arbitrary JS on the victim system. This attack is not viable if you're exploiting some RCE against a C program that doesn't evaluate code.

comment 9y ago · link · parent

Entropy isn't obscurity.

comment 9y ago · link · parent

> I'm just happy it's easy to disable for performance reasons

If you're disabling ASLR over this post, please don't. Especially for performance reasons - ASLR is very very cheap, and the impact on performance tends to be in places you won't care much about.

The paper is fine, they did cool work. More importantly, ASLR is totally valid still - their attack scenario is an attacker who already can execute arbitrary code on your system, even if it's in a sandbox, which is NOT The scenario ASLR was designed to defend against.

Nothing about this attack is going to impact the effectiveness of ASLR in the cases it was designed for.

comment 9y ago · link · parent

Not really. We can simply expand it to "All code has bugs", and then we're simply at Rice's theorem. In C, the class of bugs that can not be proven to not exist are also quite dangerous - remote code execution, as an exemplar consequence. In rust, you're limited to a program that can crash, or that has other semantic faults.

So it's clearly not wrong, and is actually a totally well established idea well outside of the context of rust or C.

comment 9y ago · link · parent

I would agree if I felt that the industry were moving towards "better" software - as in, as an industry, we said "Wow, we need to seriously take a step back and start writing systems more reliably, more securely, etc".

I do not think we're going in this direction, necessarily.

comment 9y ago · link · parent

This is the #1 misconception I see surrounding pure functional programming - that once you run into mutable state, you run into problems.

It is entirely the opposite. PFP exposes the murky aspects of mutability, provides abstractions around it, and ensures that you're not tripping over yourself in regards to mutability.

comment 9y ago · link · parent

A little less than half, assuming the popular vote is representative. And considering that the top 3 largest cities were overwhelmingly pro-Hillary it seems very sensible, given that I assume that's who their target consumer is.

comment 9y ago · link · parent

You can easily see this as marketing. I'm certainly more inclined to use their services now.

comment 9y ago · link · parent

Optional forces the null check (at the cost of a pointer dereference :( but that's Java for you). That's the difference.

It also provides some nice combinator syntax for handling that null beyond .isPresent, but if you were to just get .isPresent it would be a win.

Documentation is optional (hah) and therefor shouldn't be relied on.

Optional as a return type means there's no need to check for documentation, there's no need for @Nullable, and you get some pretty syntax to boot.

comment 9y ago · link · parent

Take submissions for summaries and require that new content/ pull requests provide one. For the record, I'm enjoying everything I've read so far from the list, so thank you.

comment 9y ago · link · parent

I think we like to say things like "C has no GC so it's good for kernels, Python has a GC so it's good for blah blah". In reality, we've definitely written plenty of "python level" (application level) software in C, and the same is happening in Rust.

comment 9y ago · link · parent

About two weeks to get the majority of language features - iterators, some aspects of ownership, structs, stop fighting the borrow checker for the common cases. I was using threads to parallelize my work within the first few days, and that was particularly cool for me.

I'd say another two weeks before I was using lifetimes properly, traits, enums, etc in 'idiomatic' ways.

All in all, 4 weeks before I felt productive.

I come from C++, which helped and hurt. On the one hand, move semantics weren't new - but C++ move semantics felt like

nothing* compared to Rust's. It actually really helped me internalize why you would want them in C++.

I knew that returning a pointer to the stack was bad in C++. In rust, I actually started doing that (just parent stacks), but safely.

* Such as

    self.foo(&self.bar)

comment 9y ago · link · parent

Zero cost abstraction has never meant anything other than 0 cost at runtime, so I don't see why you would get annoyed at it being used accuratcly.

comment 9y ago · link · parent

> Erlang, which is known for its reliability gets this right: kill the whole Erlang process in a clean fashion so that we can get transactional semantics. (It's not that performant though.)

This is also the rust way - panics kill the thread they occur in.

comment 9y ago · link · parent

This is an excellent blog post - thanks a lot for writing it up. Solid use cases defined, I particularly enjoyed how you dealt with the shortcomings of joining a relatively young language.

The 'belligerent refactoring' resonated with me - I have worked on untyped and statically typed codebases of varying sizes and when making huge changes there is no better tool for me personally than an expressive type system.

comment 9y ago · link · parent

Hmmmm. Note to self - actually try to audit a reasonably sized project's unsafe code to see how reasonable it is.

comment 9y ago · link · parent

Panics do not violate memory safety. In C that code would be undefined behavior.

comment 9y ago · link · parent

In safe rust it is definitely not trivial to overflow a buffer in a way that violates memory safety.

comment 9y ago · link · parent

> How do you suppose runtime bounds checks are done in Rust? They certainly also incur a performance penalty in not-trivial cases.

Certainly. I didn't intend to imply otherwise.

> Also, "safe by grep audit" means "safe according to a human."

Again, totally correct here.

> The argument of course is that it lowers the surface area of what a human must be trusted to verify. I'm still not convinced by that argument, because human error is a thing. And for actual systems programming, "very rare" may not be true.

Well, given a codebase where both safe and unsafe code exists, the amount of unsafe code is strictly less than the amount of both safe and unsafe code. So it does reduce the amount of code needed to audit, even in a very atypical case where a ton of the code is unsafe.

It's true that a project may use egregious amounts of unsafe. That would be unfortunate. Rust is still safer than C in that case, since it just defines more behavior (like arithmetic overflow), but I certainly wouldn't pretend that the rust code should be trusted.

When writing rust one should certainly strive to write less unsafe code, and to always document the invariants required for unsafe code to be safe.

Rust is not 100% safe 100% of the time, I'm only arguing that safe defaults are critical, and that grep auditing is a powerful tool.

comment 9y ago · link · parent

Ah, I see. For what it's worth C will perform similar optimizations to Rust, which is why I expect similar performance. And thank you.

comment 9y ago · link · parent

While this is technically true, it isn't practically true. "Easy" is certainly false.

I really enjoyed these posts by strncat:

https://www.reddit.com/r/programming/comments/5krztf/rust_vs...

> It's scary how unfamiliar C programmers are with the rules of the language they're using... it's very difficult to write correct / secure C code without undefined behavior even when you know the rules.

[...]

> It's not feasible to avoid undefined behavior at scale in C or C++ projects. It's simply infeasible. They are not usable as safe tools without using a very constrained dialect of the languages where nearly all real world code would be treated as invalid, with annotations required to prove things to the compiler and communicate information about APIs to it.

comment 9y ago · link · parent

I think this is addressed in the article when they talk about the potential pitfall of Go's GC.
1
160161162163164