Remix.run Logo
promiseofbeans 15 hours ago

They made C memory safe? This is a big thing to gloss over in a single paragraph. Does anyone have extra details on this?

> On devices with iOS 14 and iPadOS 14 or later, Apple modified the C compiler toolchain used to build the iBoot bootloader to improve its security. The modified toolchain implements code designed to prevent memory- and type-safety issues that are typically encountered in C programs. For example, it helps prevent most vulnerabilities in the following classes:

> • Buffer overflows, by ensuring that all pointers carry bounds information that’s verified when accessing memory

> • Heap exploitation, by separating heap data from its metadata and accurately detecting error conditions such as double free errors

> • Type confusion, by ensuring that all pointers carry runtime type information that’s verified during pointer cast operations

> • Type confusion caused by use after free errors, by segregating all dynamic memory allocations by static type

1over137 14 hours ago | parent | next [-]

>They made C memory safe?

They made a dialect of C with bounds safety, see:

https://clang.llvm.org/docs/BoundsSafety.html#overview

13 hours ago | parent [-]
[deleted]
bri3d 14 hours ago | parent | prev | next [-]

Many years ago. It’s called Firebloom. I think it’s similar in theory and lineage to Fil-C.

https://saaramar.github.io/iBoot_firebloom/

vsgherzi 15 hours ago | parent | prev | next [-]

Sort of. From my understanding they’ve been heavily using clang with fbounds checks to insert checks into functions. I think there was work done to try to insert them into existing code as well. They memory tagging in new processors help avoid overflow exploitation. Maybe someone can jump in and add more details

pjmlp 3 hours ago | parent | prev [-]

Yes, that is however a dialect, and one of the goals to Swift Embedded roadmap is to replace it.