2 ms·
To me this is quite depressing. The sure amount of bounds errors and whatnot in things like font handling, audio, images, etc mean that evil websites/email/etc
by azinman2 10y ago
To me this is quite depressing. The sure amount of bounds errors and whatnot in things like font handling, audio, images, etc mean that evil websites/email/etc have a strong chance of owning your device for years to come.
Highlights the value of languages like Swift or Rust that build in bounds checking into the language itself, preventing such attacks (as long as you don't call any explicitly unsafe bits). I do wonder if Apple is considering re-writing any of these core services in a safer language.
- inertial 10y agoAnd it all happens silently (in the background). You could very well have long random passwords with 2FA, but a device that's been pwned would render all that useless. Considering how much crucial data exists on my mobile, it's very depressing to see a long list of things that can compromise security.
- pjmlp 10y agoAnd it is not an unknown thing, for decades! "A consequence of this principle is that every occurrence of every subscript of every subscripted variable was on every occasion checked at run time against both the upper and the lower declared bounds of the array. Many years later we asked our customers whether they wished us to provide an option to switch off these checks in the interests of efficiency on production runs. Unanimously, they urged us not to--they already knew how frequently subscript errors occur on production runs where failure to detect them could be disastrous. I note with fear and horror that even in 1980 language designers and users have not learned this lesson. In any respectable branch of engineering, failure to observe such elementary precautions would have long been against the law." -- C. A. R. Hoare, Turing award lecture in 1981, http://cacm.acm.org/magazines/1981/2/10949-the-emperors-old-clothes/pdf http://cacm.acm.org/magazines/1981/2/10949-the-emperors-old-... > I do wonder if Apple is considering re-writing any of these core services in a safer language. Apple already uses C++ for device drivers, which allows for more safety oriented programming as straight C. In any case, even if it isn't fully ready today, they view Swift as a C and Objective-C replacement in the long term. "Fast. Swift is intended as a replacement for C-based languages (C, C++, and Objective-C). " -- https://swift.org/about/ https://swift.org/about/ "Swift is a successor to both the C and Objective-C languages." -- https://developer.apple.com/swift/ https://developer.apple.com/swift/ The dock and launchd in Sierra were rewritten in Swift.
- huxley 10y ago> Apple already uses C++ for device drivers, which allows for more safety oriented programming as straight C Just to qualify that a bit, IOKit uses a restricted form of C++ based on Embedded C++ https://en.wikipedia.org/wiki/Embedded_C%2B%2B https://en.wikipedia.org/wiki/Embedded_C%2B%2B https://developer.apple.com/library/content/documentation/DeviceDrivers/Conceptual/WritingDeviceDriver/CPluPlusRuntime/CPlusPlusRuntime.html https://developer.apple.com/library/content/documentation/De...
- pjmlp 10y agoIt still is C++ and way safer than plain C, assuming devs care to use RAII, reference parameters, string and array wrappers with bounds checking, enums.