4 ms·
7 vulnerabilities with impact "may be able to execute arbitrary code with kernel privileges" :-( Are these things in Objective-C or Swift? Does Swift memory ma
by cyounkins 5y ago
7 vulnerabilities with impact "may be able to execute arbitrary code with kernel privileges" :-(
Are these things in Objective-C or Swift? Does Swift memory management make buffer overflows and use-after-free mistakes harder to make?
- fay59 5y agoThere is no Swift or Objective-C in the xnu kernel, so the answer to the first question has to be "no". To the second question, Swift is generally safe against these bugs except (1) in the face of race conditions and (2) when the developer uses things that have "unsafe" in the name.
- d1str0 5y agoIts probably less to do with buffer overflows and use-after-free of these applications, and more to do with the underlying OS APIs, and I assume most of the OS is still C, C++ and Obj-C.
- pjmlp 5y agoYes, Swift is memory safe in this regard (as long as Unsafe.... isn´t being used), however most code on macOS is still mostly C, C++ and Objective-C.
- guessbest 5y agoObjC and Swift are just application level programming languages. The XNU system kernel for macOS is written in mostly C with some C++. Anyway Swift is written in C++ last I checked and ObjC is a superset of C anyway. Everything done with ObjC can be done in C if the developer is feeling adventurous enough. https://github.com/apple/darwin-xnu https://github.com/apple/darwin-xnu C 82.5% C++ 8.7% Python 2.3% Roff 2.3% Assembly 1.4% HTML 1.1% Other 1.7%
- alwillis 5y agoRegarding WebKit, where there are several CVEs, is written in C++.