4 ms·
Android is moving away from C and towards more secure languages. From one of their recent blog posts, the majority of code written for android is now in memory
by Gigachad 3y ago
Android is moving away from C and towards more secure languages. From one of their recent blog posts, the majority of code written for android is now in memory safe languages.
- berbec 3y agoIs the programming language likely the issue here?
- carstenhag 3y agoWell, theoretically all can be secure (in regards to buffer overflows etc). Some just forbid to shoot you in the arm. And head.
- tialaramex 3y agoOf course, it's not necessary to use a language where "Give control of your phone to remote attackers" is one of the possibilities at all. General purpose languages, whether that's something like C or Rust or even Javascript are not the appropriate tool. Turing Completeness is a bad idea from a security point of view, not a wonderful feature.
- Gigachad 3y agoYes, almost all of these major exploits are memory safety related and would be mostly impossible in a memory safe language.
- btilly 3y agoThat's like asking whether it is the lack of a seatbelt that was the issue after sometime died in a car crash. Well, of course the real issue was the car crash. But wearing a seatbelt would have sure helped!
- nielsbot 3y agoApple also has memory-safer languages it is moving to: Swift: A memory-safer systems programming language: https://www.swift.org https://www.swift.org Firebloom: A memory-safer C variant: https://support.apple.com/en-il/guide/security/sec30d8d9ec1/web https://support.apple.com/en-il/guide/security/sec30d8d9ec1/... Not sure what the answer is for existing memory-unsafe code.
- ctz 3y ago> Not sure what the answer is for existing memory-unsafe code. It's an engineering approach that involves writing "A buffer overflow issue was addressed with improved memory handling" an awful lot. Hopefully one day they will finish improving the memory handling!
- saagarjha 3y agohttps://www.youtube.com/watch?v=lgivCGdmFrw https://www.youtube.com/watch?v=lgivCGdmFrw
- tialaramex 3y agoAnd for this problem specifically Android can use WUFFS. WUFFS is a special purpose language for Wrangling Untrusted File Formats Safetly. Trading away generality (the ability to write a program which say, sends email) gets them complete safety and excellent performance. In Rust we can't trivially write a bounds miss by mistake. But in WUFFS we just can't write a bounds miss at all. Like, that's not a thing in WUFFS, it doesn't compile. You can write your own bounds checks and show WUFFS that works, or you can write code which clearly can't have a bounds miss with no checks, that works too. But you can't just "forget" or "screw up" those won't compile. This would be frustrating in a general purpose language. WUFFS doesn't have a "Hello, World" program because it lacks both strings and the idea of outputing to the screen. But WUFFS isn't a general purpose language, however it's the correct way to write the code that takes image files we got from some dubious source and processes them. When Apple announced they wanted to provide proper security for vulnerable iPhone users, this is what that would look like coming from a company which actually cared about security. What you got is what it looks like from a company which prioritised marketing.
- saagarjha 3y agoWould any of your comment change if I told you the bug was in a Google image parser that they currently also ship to production?
- teaearlgraycold 3y agoGoogle at large is slowly banning use of non memory safe languages. Android in particular is doing well at adopting Rust.