5 ms·
It's worth engaging with the fact that essentially nobody disagrees with this (someone will here, but they don't matter), and that it's not happening not becaus
by tptacek 5y ago
It's worth engaging with the fact that essentially nobody disagrees with this (someone will here, but they don't matter), and that it's not happening not because Apple and Google don't want it to happen, but because it's incredibly, galactically hard to pull off. The Rust talent pool required to transition the entire attack surface of an iPhone from C, C++, and ObjC to Rust (substitute any other memory safe language, same deal) doesn't exist. The techniques required to train and scale such a talent pool are nascent and unproven.
There is probably not a check Apple can write to fix this problem with memory safe programming languages. And Apple can write all possible checks. There's something profound about that.
- honkdaddy 5y agoIs that more-so due to a lack of Rust engineers or a lack of firmware engineers capable of rebuilding the iOS stack?
- rrradical 5y agoWell to some extent these companies are self sabotaging by centering interviews around algorithm problems, not only by selecting a certain kind if talent for further investment of resources, but also by signaling to the market the kinds of training needed to land a good job. If instead, the talent pool were incentivized to increase their ability to understand abstractions, and we selected for that kind of talent, it might not be so hard to use new languages.
- phendrenad2 5y agoAbstractions are fun, security isn't. I doubt there are even that many programmers who enjoy writing (correct, safe) Rust.
- rrradical 5y agoWait, this whole thread is about moving to languages that eliminate classes of security holes by virtue of the language itself. The premise is that being a security conscious programmer is not by itself enough to achieve good security.
- e40 5y agoI honestly don't understand this. If Google or Apple wanted it to happen, they could force those developers to learn Rust. Are you saying the people that wrote the products in question can't learn Rust well enough to achieve the goal?
- tuwtuwtuwtuw 5y agoForcing their employees to learn rust doesn't mean Google has the capacity to rewrite all their software in rust. They have tons and tons of code which would need to be rewritten from scratch. Of course if they dropped all other development and told their employees to rewrite to rust, they may end up with a piece of software written in rust but no customers.
- e40 5y agoI agree, but there's so many people at Google (132,000 if you can believe the search results), it's hard for me to believe they couldn't devote a small percentage of them to moving to a secure stack.
- tptacek 5y ago"Moving to a new stack" implies rewriting much of the code (and: a surprising amount of the code) built on the existing stack.
- shukantpal 5y agoAnd you don't realize their codebase must also be really large like their number of employees. They must have a lot of code per employee.
- tuwtuwtuwtuw 5y agoLet's say 50 000 write code and a small percentage is 10%. So then your idea is that 45 000 would continue to write code in the unsafe languages and 5 000 would rewrite old and newly written code in rust? How many years do you think it would take for the 10% of developers to write all the old code and all the newly written by the 90%?
- Dylan16807 5y agoThey wrote it the first time, didn't they? C isn't special, and training isn't special.
- tptacek 5y agoIt took decades.
- Dylan16807 5y agoSo make the initial goal a portion. It's not like Apple is going to go away any time soon. The second best time to start is now. And a lot of that was design work that still holds, and a lot of that was code that has been obsoleted.
- tptacek 5y agoAs far as I'm aware, every major company in the industry is working on exactly this. I'm telling you why we don't just have an all-memory-safe iPhone right now, despite Apple's massive checking account. I'm not arguing with you that the industry shouldn't (or isn't) moving towards memory safety.
- pvg 5y agoTime is pretty special. iOS alone is over a decade old and a constantly evolving target and it's itself a direct descendant of a 30+ year old system.
- Dylan16807 5y ago> a constantly evolving target That decreases the amount of code to replace, doesn't it?
- pvg 5y agoHow so? New not-in-safe-languages code is being added all the time.
- dagmx 5y agoIn Apple's case they wouldn't need to move everything to Rust. Swift is a little bit higher level and a lot of stuff could be moved into it, with Rust as the lower level layer to replace ObjC / C / C++. Still a gargantuan effort, but for them it doesn't require everyone learn Rust, just to learn Swift, which is kind of table stakes for a lot of user facing dev I'm sure there.
- littlestymaar 5y agoI' don't think the real question is “how feasible is it to rewrite everything in Rust”, because as you say, the answer to this question is clearly “not a all”. But “rewriting all parsers and media codec implementation” is a much smaller goal, and so is “stop writing new codec implementation in memory unsafe language”, yet none of those two more achievable are being pursued either, which is sincerely disappointing.
- staticassertion 5y agoYou don't need to move the entire attack surface of the iphone to Rust. There are plenty of smaller areas that tend to have the most vulnerabilities. They could absolutely write a check to radically reduce these sorts of issues. It'll take years to have impact, but so what? They can start now, they have the money. > nobody disagrees with this (someone will here, but they don't matter) There are so many people out there who don't understand the basics. HN can be sadly representative.
- closeparen 5y agoDo you think Apple is already at the frontier of what can be done to detect or refactor out these bugs in their existing languages? Static analysis, Valgrind, modern C++, etc?