News for hackers. Stuff that matters.
Re:‘Zero-click’ hacks are growing in popularity by tptacek on Saturday February 19, 2022 @12:56PM (#30398995)
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.

Re:‘Zero-click’ hacks are growing in popularity by rrradical on Saturday February 19, 2022 @01:14PM (#30399138)
Well 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.

Re:‘Zero-click’ hacks are growing in popularity by phendrenad2 on Saturday February 19, 2022 @01:18PM (#30399183)
Abstractions are fun, security isn't. I doubt there are even that many programmers who enjoy writing (correct, safe) Rust.
Re:‘Zero-click’ hacks are growing in popularity by rrradical on Saturday February 19, 2022 @02:09PM (#30399600)
Wait, 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.
Re:‘Zero-click’ hacks are growing in popularity by dagmx on Saturday February 19, 2022 @02:15PM (#30399649)
In 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.

Re:‘Zero-click’ hacks are growing in popularity by e40 on Saturday February 19, 2022 @02:04PM (#30399565)
I 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?
Re:‘Zero-click’ hacks are growing in popularity by tuwtuwtuwtuw on Saturday February 19, 2022 @02:12PM (#30399627)
Forcing 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.

Re:‘Zero-click’ hacks are growing in popularity by e40 on Saturday February 19, 2022 @02:17PM (#30399662)
I 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.
Re:‘Zero-click’ hacks are growing in popularity by tuwtuwtuwtuw on Sunday February 20, 2022 @04:15AM (#30404365)
Let'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%?
Re:‘Zero-click’ hacks are growing in popularity by tptacek on Saturday February 19, 2022 @02:47PM (#30399898)
"Moving to a new stack" implies rewriting much of the code (and: a surprising amount of the code) built on the existing stack.
Re:‘Zero-click’ hacks are growing in popularity by shukantpal on Saturday February 19, 2022 @03:53PM (#30400442)
And 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.
Re:‘Zero-click’ hacks are growing in popularity by tptacek on Saturday February 19, 2022 @02:42PM (#30399847)
Start with the fact that practically all software development at Apple and Google would cease for multiple months while people dealt with the Rust learning curve, which is not gentle, and proceed from there to the fact that Rust demands (or, at least, urgently requests) architectural changes from typical programs designed in other languages.

Now: rewrite 20 years worth of code.

Let's make sure we're clear: I agree --- and, further, assert that every other serious person agrees --- that memory safety is where the industry needs to go, urgently.

Re:‘Zero-click’ hacks are growing in popularity by Tanjreeve on Saturday February 19, 2022 @03:31PM (#30400252)
When you say architectural changes how do you mean? Most of the memory stuff isn't particularly exotic there's a lot of different syntax/Functional programming influences but I'm curious why it would be wildly exotic compared to most C++ code or have I misunderstood?
Re:‘Zero-click’ hacks are growing in popularity by InvertedRhodium on Saturday February 19, 2022 @03:50PM (#30400420)
It doesn't matter how exotic something is when you're taking about rewriting an entire platform - the sheer amount of man hours required to reimplement something for an advantage the vast majority of customers simply don't value enough is the limiting factor.

In that context, even a small architectural difference can be seen as a high barrier.

Re:‘Zero-click’ hacks are growing in popularity by BoxOfRain on Saturday February 19, 2022 @03:47PM (#30400390)
It'd still be like replacing the engines of an aeroplane mid-flight surely? I know Rust can do C interop and it'd probably be done piecemeal but it'd still be an absolutely gargantuan task. I'd say there's a fair chance the sheer time and effort such an undertaking would involve would cost more than the memory safety bugs using C or C++ introduces.
Re:‘Zero-click’ hacks are growing in popularity by staticassertion on Saturday February 19, 2022 @04:12PM (#30400565)
You 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.

Re:‘Zero-click’ hacks are growing in popularity by littlestymaar on Saturday February 19, 2022 @03:34PM (#30400280)
I' 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.
Re:‘Zero-click’ hacks are growing in popularity by Dylan16807 on Saturday February 19, 2022 @02:10PM (#30399605)
They wrote it the first time, didn't they? C isn't special, and training isn't special.
Re:‘Zero-click’ hacks are growing in popularity by jeremygaither on Saturday February 19, 2022 @03:17PM (#30400132)
macOS runs the Darwin kernel (developed at NeXT using the Mach kernel, then at Apple). NeXTSTEP was based on a BSD UNIX fork. Development of BSD at Berkeley started in 1977. NeXT worked on their kernel and the BSD UNIX fork in the '80s and '90s before being purchased by Apple. NeXTSTEP formed the base of Mac OSX (which is why much of the Objective-C base libraries start with `NS-something`. There is 45 years worth of development on UNIX, and Linux is a completely different kernel with a completely different license. Linux kernel has been in development for about 31 years.

Languages and understanding them is not special, but decades of development of two different kernels is a huge time investment. Even though Linus Torvalds wrote the basic Linux kernel in 5 months, it was very simple at first.

I doubt writing an entire POSIX-compatible replacement for a kernel would be a small or quick endeavor, and Apple has shown resistance to adopting anything with a GPL 3 license iirc. That is why they switched to ZSH from Bash.

Re:‘Zero-click’ hacks are growing in popularity by Dylan16807 on Saturday February 19, 2022 @03:24PM (#30400191)
The earlier post seemed more focused on the userland, so we should very much consider excluding the kernel before we decide the idea is too hard.
Re:‘Zero-click’ hacks are growing in popularity by pvg on Saturday February 19, 2022 @02:46PM (#30399894)
Time 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.
Re:‘Zero-click’ hacks are growing in popularity by Dylan16807 on Saturday February 19, 2022 @03:17PM (#30400129)
> a constantly evolving target

That decreases the amount of code to replace, doesn't it?

Re:‘Zero-click’ hacks are growing in popularity by pvg on Saturday February 19, 2022 @03:50PM (#30400418)
How so? New not-in-safe-languages code is being added all the time.
Re:‘Zero-click’ hacks are growing in popularity by Dylan16807 on Saturday February 19, 2022 @04:54PM (#30400891)
For code added in the future, you need devs no matter what language they use, so switching their language is the easy part of this large hard project.

For code added in the past, more evolution means that for every X lines of code written, a smaller and smaller fraction of X still exists. Which means less work to replace the end product.

Re:‘Zero-click’ hacks are growing in popularity by tptacek on Saturday February 19, 2022 @02:42PM (#30399855)
It took decades.
Re:‘Zero-click’ hacks are growing in popularity by Dylan16807 on Saturday February 19, 2022 @03:13PM (#30400095)
So 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.

Re:‘Zero-click’ hacks are growing in popularity by tptacek on Saturday February 19, 2022 @03:28PM (#30400224)
As 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.
Re:‘Zero-click’ hacks are growing in popularity by closeparen on Saturday February 19, 2022 @04:16PM (#30400603)
Do 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?
Re:‘Zero-click’ hacks are growing in popularity by honkdaddy on Saturday February 19, 2022 @01:13PM (#30399131)
Is that more-so due to a lack of Rust engineers or a lack of firmware engineers capable of rebuilding the iOS stack?