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

> As a professional software engineer I'm not sure the idea of "safe" or "unsafe" programming languages is a coherent idea, or if it is then all languages are unsafe in my eyes.

I agree, though that's not intractable. There's security compliance like ISO27001, which can't say "you're secure", but can say "you've got a threat model and you take measures to address it". It's then something you document and provide evidence for as part of your compliance obligations.

If we applied the same thing to a programming language I think it could be very clear to see the differences between languages.

That's not at all to say that I think ISO27001 is a good model for security, just that we already have systems that handle very nuanced ideas, so a formal definition, or proof, etc, is not really as necessary as it may seem.

comment 5y ago · link · parent

Saying that Java is safe therefor you can write safe C is not actually sensible. The JVM is a virtual machine that runs user's programs, and those programs are in a memory safe language. That doesn't mean the JVM is memory safe... at all.

It's like saying "llvm is in C++, and llvm is used to compile Rust, therefor C++ is as safe as Rust". It's just not a tractable argument.

As for the rest of your post, sure, you can create a new revision of C/C++ that's memory safe - feel free to do so. It'll basically be a new language, but that's fine and has nothing to do with the parent's point, which is that we should incentivize memory safety - they didn't say it had to be a new language.

As for why people don't take that approach, it's because: it'll be a massive breaking change, so it's really no different from a completely new language. If you're going to create a completely new language you may as well take the time to fix a bunch of other issues while you're there.

edit: The above applies to libraries too. There are libraries that enforce stronger security in C++ (I want to say... IronC++? Something like that), and it basically ends up being, give or take, the cognitive overhead of a new language, but with the added bonus of no one actually using it.

> From a security perspective creating a new language reduces security because it will never have been as thoroughly vetted as the old languages.

This is unsubstantiated, and I highly doubt it is the case.

comment 5y ago · link · parent

Support for an architecture would be a minor release, no? That's "adding a feature". It wouldn't be a breaking change.

comment 5y ago · link · parent

> You can't just do SHA256(key + message) to generate a safe MAC.

Can you explain this?

comment 5y ago · link · parent

So what are the next steps for cryptographic hash functions? Is it going to just be "make even faster" ? Or are we chasing new properties, or stronger guarantees (or hopes?) of existing properties?

comment 5y ago · link · parent

Yeah, it's actually less correct, not less descriptive - I mispoke.

comment 5y ago · link · parent

> that bugs in Rust code are physically impossible

This isn't a real thing either. I see it asserted all the time on HN and it's hilarious.

> Anyone hinting that bugs are still possible in Rust gets downvoted to oblivion (as here).

90% of the time it's because the person is making a stupid point. 10% of the time it's the community being annoying.

So just to reiterate, you're basing this on being barely an observer on forums, and I'm basing this on multiple years of professional rust development.

comment 5y ago · link · parent

I'm really failing to see how that's any clearer. If you're looking at SQS you probably already know it's an AWS service, and pubsub seems less descriptive than queue...

comment 5y ago · link · parent

What's in a name? Really, is "Amazon Virtual Servers" much better than "Elastic Compute" ? Maybe slightly. But at the end of the day you have to go look at it and see wtf that means no matter what, and the 'elastic' verbiage is fairly consistent across AWS products.

IAM is similarly not that bad - Identity Access Management pretty much tells me what it is.

When we have a field where things are named in extremely unclear ways - kubernetes, docker, kafka, prometheus, etc etc etc - these really don't seem that bad by comparison.

comment 5y ago · link · parent

I mean, what would you call it? It's basically a 'push/pop' interface with timeouts. Like, do you think 'Kafka' is more descriptive? Or Prometheus? Or any of the essentially randomly generated names that various projects and products choose?

By the standard of tech names SQS seems, relatively speaking, extremely descriptive.

comment 5y ago · link · parent

> If the demonstrated complacency of Rust coders toward potential bugs

lol what?

This is so very the opposite of my 6+ years of experience in Rust, where the community has a serious focus on testing, and great tooling support for it as well.

I honestly can't take anyone seriously who thinks that adding Rust to the kernel will increase security bugs. I just can't imagine they know anything about Rust, security, or the kernel.

comment 5y ago · link · parent

YeahI get all of that fwiw I would consider design issues programming errors but it doesn't really matter.

comment 5y ago · link · parent

That depends on the runtime that the containers are using. At my company we explicitly do not consider docker + runc as a security boundary due to the shared Linux kernel - but you can hedge against this with technology like gvisor, or executing via kvm + firecracker containers (kata containers do this iirc), etc.

So it's less about "docker" and more about the container runtime. They could also be leveraging seccomp or some other mechanism.

It's unclear in this case if they're relying on just default Docker. If they are, that's concerning to me.

They do mention apparmor, gotta dig in more. This also relies on a path traversal, so it may be reasonable.

comment 5y ago · link · parent

You've built a straw-man for my statement and you've completely mischaracterized Linus.

Linus had multiple statements that won him pwnies, but what I'm referring to is decades of mailing list posts where he's insulted researchers, or decades of him and Greg rejecting CVEs and hiding vulnerabilities, etc. This has persisted even today, mostly from Greg, but in a less public way than it once was due to cultural shifts.

Make no mistake, Linus and Greg have always had a hostile relationship with security researchers.

> many specialists hate that because they think their field is the most important and all others should be second.

Another straw man. I never said anything like this; that security should be the number one priority or that anything else shouldn't be a priority.

> would Linux really have become the de-facto base on which high security orgs (banks, 3 letter gov agencies, etc) deploy? I doubt it very much.

Is this satire? Are we really going with "Banks deploy Linux... therefor it's secure" ? Did you know banks also run Windows XP on their ATMs?

Linux has had external contributions to security, yes. Much of that has been despite upstream, and with immense work across decades to get upstream to play ball.

> However I think it's silly to suggest that the Linux kernel has a history of not even considering security.

Sorry but the only way for this to be the case is to simply not know the history of the Linux kernel.

comment 5y ago · link · parent

No, Windows has by far more investment into security and a far better culture. Linux has a multiple-decades-long history of saying that security is not important and has had to be dragged kicking and screaming to modernity.

SELinux is just an LSM built decades ago, I wouldn't say that somehow proves that upstream cares about security.

comment 5y ago · link · parent

No, what we have here is definitely more of an exception - sort of like an RFC for larger changes that could take months or years to play out. The vast majority of code changes do not go through this.

comment 5y ago · link · parent

I agree, though I wondered if that was actually true - I don't think so? But I don't know.

comment 5y ago · link · parent

That isn't really true.

comment 5y ago · link · parent

> Since most of our CVE type problems are usually programming mistakes nowadays, the lack of review could contribute to an increase in programming fault type bugs which aren't forbidden by the safer memory model.

That's an odd statement. What CVEs aren't due to programming mistakes? I'm not sure if the majority of CVEs for the Linux kernel come down to memory safety, though I would not be surprised, but certainly a huge number are.

> without a clear and obvious benefit beyond promises that can only truly be fully fulfilled with a whole kernel written in Rust.

That's not true, really. You don't need a completely safe kernel to have an improvement to safety. If every device driver were memory safe tomorrow we'd be better off.

That said, I think this will be an interesting, possibly losing, battle. The Linux Kernel is extremely monolithic, it has a lack of testing and code review, decades of dug-in investments, and a strong history of not prioritizing security or even considering it to be a legitimate goal. Fixing that seems like it will itself take decades, whereas the current approach really feels like it's trying to get it done ASAP.

If they can do it, cool. As a Linux user I'll possibly benefit. I'm curious to see how it plays out.

comment 5y ago · link · parent

This isn't exactly news.

comment 5y ago · link · parent

The PRs are really helpful when you do actually want to update.

comment 5y ago · link · parent

It seems to primarily be a frontend thing. I get tons and tons of them, it's really annoying.

comment 5y ago · link · parent

Yeah, same, what if I accidentally end up in North Korea giving a talk on money laundering? It could happen to anyone. I'm petrified.

comment 5y ago · link · parent

If you want "k8s but less" I highly recommend Nomad from Hashicorp and the Hashi-stack in general. It's so damn good.

comment 5y ago · link · parent

> Thank you for refraining from repeating this absurd hyperbole.

To be fair, I wouldn't quite label it as "absurd", though it is hyperbole. With near-extreme levels of discipline you can write very solid C code - this involves having ~100% MCDC coverage, using sanitizers, static analysis tools, and likely outright banning a few functions. It's doable, especially if your project doesn't have to move fast or has extreme requirements (spaceships).

> Can you guide me to some Rust programs that are smaller than their C counterparts.

Rust has a big standardlib compared to C++ so by default you end up with a lot of "Extra" stuff that helps deal witht hings like unicode, etc. If you drop std and dynamically link your libraries you can drop a lot of space and get down to C levels.

There are a number of examples like this: https://cliffle.com/blog/bare-metal-wasm/

> is the (apparently) enormous size of the development environment relative to a GCC toolchain.

I can't really relate to this. I have a 1TB SSD, 32GB of ram, and an 8 core CPU. My rust build tools are a single command to install and I don't know or care how much space they take up. If you do, I don't really know why, but sure that's a difference maybe.

> All programmers are not created equal no matter what languages they use

While this is true, it doesn't matter practically.

1. We can't restrict who writes C, so even if programmer skill was the kicker, it isn't enforceable.

2. There are lots of projects that invest absolutely incredible amounts of time and money, cutting edge research, into writing safe low level code. Billions are spent on this. And the problem persists. Very very few projects seem to be able to achieve "actually looks safe" C code.

> Memory-safe languages are great but it seems like they just enable people to become far too ambitious in what they think they can take on.

I don't really see how Rust is any different from Python, Java, or anything else in that regard.

comment 5y ago · link · parent

Yeah, mobile platforms are moderately better.

comment 5y ago · link · parent

You're making their point for them.

comment 5y ago · link · parent

What linux calls capabilities is a misnomer that isn't particularly effective - it's sort of splitting root up into smaller pieces.

This is totally different from the actual capabilities security model, which is closer to a "if you can name a resource you can access that resource". So, for example, imagine every file on your system has a path with a uuid, and there is no "ls" - you'd only be able to access files whose names had been told to you/ that you created yourself.

That's a capabilities model, and Linux does not have that.

1
838485
164