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

> What a load of bollocks. For new projects this only matters if libraries aren't ported, which they are for the most part.

Except when they aren't. And then what?

I've run into this multiple times. Sometimes there's a branch of the project for 3 that's underway, and I sit and wait. Other times it means dropping the project or committing to reimplementing a library.

comment 9y ago · link · parent

It's too hard. The fact that there was a culture of disabling it means that it was a total failure as a tool to secure the average server.

I think it's found its niche, finally, on Android because you can't really break an Android phone the way you can a linux server. You don't have root, the system doesn't change much, certainly not at the linux layer.

comment 9y ago · link · parent

Wouldn't a cooperative event loop handle that? You divide CPU time between event handlers, so one event handler can't block others.

comment 9y ago · link · parent

What are the event-loop-specific issues you're referring to? I don't like node but I find the event model interesting.

comment 9y ago · link · parent

Read the Hacking Team writeup? I don't know their personality, but the person behind that hack is definitely a very talented hacker and the attack was certainly targeted. He got in with a 0day and it was politically motivated.

That 'good hacker' exists.

comment 9y ago · link · parent

Note that if you can compile the kernel yourself there are benefits to doing so. It's been a while so I forget the details but grsecurity uses some randomization at compile time, and an attacker with access to the public image would be able to get around those defenses. If you own the seed, and delete it after compilation, an attacker will not be able to bypass those defenses.

Naturally you still benefit a ton without those, but the ideal situation involves compiling it.

comment 9y ago · link · parent

Grsecurity does not allow unprivileged namespaces, so this would only be exploitable by a root user.

comment 9y ago · link · parent

> you need to ensure that there is an explicit memory barrier yourself when you transfer the object.

To be clear, you need to write the code yourself, but the compiler won't let you transfer ownership between threads without doing so.

There is no way to compile your code without proving to the compiler that you're data race free.

comment 9y ago · link · parent

I guess, but that doesn't seem that bad.

> maddeningly and frightenly hard to do efficiently.

It definitely doesn't seem maddening or frightening. I'm not saying a GC isn't stricly better (because I'm unsure either way) but arc doesn't seem like some awful thing.

comment 9y ago · link · parent

> Reference counting does not scale to multi-threaded programs well. Keeping reference counts up to date across multiple threads is maddeningly and frightenly hard to do efficiently.

Is this not just a matter of using an atomic reference count?

comment 9y ago · link · parent

> I suggest you uninstall Chrome if that is your view, it too will lead to a full system compromise in the future, I mean it will in the future yet again.

Chrome developers take active measures (sandboxing, research, patching, bug bounties) to secure their browser. They have done amazing work and really, in my mind, pushed some solid technology that we've all benefited from (seccomp, as an example).

AV has gone out of its way to disable modern security technologies like ASLR/Stack Cookies.

There is no comparison here in terms of effort to avoid exploitation. As Justin said - find me a single AV that sandboxes its parsers.

> For most people, yes it does.

Even if this were true, and it is not, Chrome doesn't - it runs in a sandbox. Therefor a compromise of an AV is not just a jump to Admin but a jump out of the sandbox.

> The browser pretty much wins here too.

Not really. The majority of attack surface in a browser like Chrome is isolated and hardened. Web browsers avoid malicious content where possible. AV goes out of its way to interact with malicious content.

> But no, it's AV vendors fault your browser is such a risk.

It's AV vendors fault that they avoid writing secure software. And, yeah actually, it is AV vendors fault that the browser is vulnerable when the browser takes every step to stay secure and AV vendors shit all over that.

comment 9y ago · link · parent

> Most of the software you use is complete and utter shit full of shoddy, high-risk code. Do we need to bring that up every time when we are talking about something specific?

Most software doesn't run with full system privileges, go out of its way to interact with malicious content, and inject itself all over the system. The difference between AV and any other shitty software is that AV is massively more useful and abundant as attack surface.

The hooks into the browser are nothing. It isn't the hooking, though that's not great. Imagine Chrome provided an API. OK, so now the AV listens to the API. It sees you open some file in the browser that's XML - it parses the XML. It gets exploited, trivially, because many vendors explicitly disable security features like stack cookies. Now the attacker went from a sandboxed environment to a full system privileges process.

comment 10y ago · link · parent

The unsafety still originates in the unsafe code, thus you can audit the use of the unsafe code or the unsafe code itself just the same.

comment 10y ago · link · parent

The vast majority of exploits of that nature take less than 60 seconds. It is nothing at all interesting or special or rare that it took < 60 seconds. Just clickbait, like every year when pwn2own rolls around.

comment 10y ago · link · parent

"pwned in 60 seconds" is a hugely misleading statement. Every time there's a hacking competition you see "Chrome, Firefox, IE fall in seconds" - ignoring the weeks or months that it takes to find the vulnerabilities and develop exploits for them.

comment 10y ago · link · parent

I'm also a fan of this approach, and am currently learning Erlang because of it. However, I do not feel that the approaches are exclusive.

Erlang is dynamically typed and it is robust because Actors act as isolation boundaries and are managed by supervisors. So the approach is "bugs happen, always recover". You can also use type annotations in Erlang to get "bugs happen less, always recover".

comment 10y ago · link · parent

I don't think I want to get into what is or is not security, but what I will say is that rust's security does not interfere with safety net features, like sandboxing.

I've found that sandboxing rust is quite easy, as easy as C or C++. I find it much easier than Java/ Python, which have runtimes that can often make things difficult (you certainly would not want to use seccomp in either).

Take a look at DropBox's Brotli - it's a great example of this. It makes use of seccomp, but seccomp is not available on all platforms, so it also relies on rust's safety.

comment 10y ago · link · parent

To compare Ada's history to Rust's is silly. Even if the languages have a common goal of safety, the projects themselves are fundamentally different in many many ways. One of which is the fact that Ada was designed by the DoD for the DoD, and required a verified compiler, etc etc etc.

They're totally different projects, even if the languages have a small number of shared goals.

comment 10y ago · link · parent

> It seems like the argument is because the language doesn't force you to use static types, in the long run it could be bad.

Not so much 'in the long run' but moreso 'as soon as you end the exploratory phase'.

> I think the limitation is more in whether you do so or not, not in the language

Perhaps if the type systems were equal in power, but they are not.

> If anything, by not forcing you to use static types, the language provides more options, which seems like a good thing...

The problem here is that touching an untyped interface can break inference, and break assumptions about types, meaning that by having the type system be optional you potentially poke holes in it.

But to be clear, I think that the typed python approach is valid, and can be a great way to help with these problems. I am not saying to ditch python and go with another typed language - just saying that the untyped approach has caveats. Maybe you're right and optional systems are better, but I think the point to get across is that a typed understanding of your data helps a lot.

comment 10y ago · link · parent

https://www.youtube.com/watch?v=lY10kTcM8ek

We talk about technical debt in data science and how rust (and the type system) can help.

comment 10y ago · link · parent

Absolutely, and we did this in fact in some of our code. But at that point you're solving the problem with types, which is my point. And it involves a pattern, not something that's enforced across a codebase.

comment 10y ago · link · parent

This was the subject of the talk that I gave with a cospeaker at RustConf. Effectively, the shortcomings of dynamic type systems when it comes to building data science oriented services.

You mention that it's much omre laborious to write a struct that matches your data exactly - however, I've found that, at this stage in the process you already have some sort of schema (mental or formal) of what your data is, and it's fairly trivial to write out a structured representation of it.

What this then buys you is a semantic understanding, in your code, of what 'bad data' is and how it's handled. You know that if you get a string where you expected an int, that's a problem. You also know that if data is missing, eg: null, that you'll handle it.

In Python, a function can erroneously return None. To your data, this is just a missing value, not a bug. But there is a semantic difference, and a cost associated with that bug.

All of these problems, limited strictly to working with data, are far easier to react to and deal with in a static language.

We absolutely conceded the exploratory phase to Python. It is, and will likely remain, an excellent and near-ideal tool for that phase.

comment 10y ago · link · parent

Been using rust for months now and I never knew the [-] did that. I never even thought to click it.

Seems like there's some UX improvements that could happen there.

comment 10y ago · link · parent

Feel free to stop by the IRC and ask questions/ seek help - lots of people there who are willing to answer your questions.

Or the rust forums: users.rust-lang.org

Or the rust subreddit: reddit.com/r/rust

comment 10y ago · link · parent

Well... how do you know the code is safe otherwise? Exhaustive tesitng is unreasonable. How do you ensure that you have achieved the end goal of safe software?

comment 10y ago · link · parent

In that case you may want "expect" over unwrap.

comment 10y ago · link · parent

Even in a library there are valid use cases for an unwrap. If you can literally guarantee that the value is present it's fine.

In libraries one should be wary about it, and never use it if the unwrap might actually panic, but otherwise you're good to go.

comment 10y ago · link · parent

Thanks a lot.

comment 10y ago · link · parent

> This is not quite accurate as stated: the problem is the combination of a data structure that is not amenable to type inference with an API that would only be efficient if type inference had perfect knowledge of the contents of a DataFrame.

Sorry if I implied otherwise - what I meant is that the current DF structure is hard for the JIT to optimize, not that this is a fundamental limitation of Julia. Just that JIT's are limited. I shouldn't have said Julia is only a small step forward, I think. A JIT gets you a long way.

> There is a lot of work being done to develop a new API that has none of these problems and provides very high performance, which demonstrates that Julia's JIT is up to the task so long as you choose an appropriate API.

Can you link to information on this? I'd love to see information on the design around this.

comment 10y ago · link · parent

I think that if this were true, the data science libraries in Python wouldn't all be written in C under the hood, linking to Fortran, etc. Language can have a huge impact on performance with big data.

Julia is just a small step forward. It still has performance problems where the JIT can't help much - like the DataFrame structure, which is effectively a black box and therefor hard to optimize.

1
160161162163164