12 ms·
Apple confirms iOS kernel code left unencrypted intentionally
- AdmiralAsshat 10y agoI suppose this is the only way to definitively stop any three-letter agencies from asking you to backdoor your kernel.
- alexandercrohde 10y agoOr perhaps the three-letter-agencies demanded they do such a backdoor (i.e. a deliberate but obscure security hole), so they are open-sourcing it so hackers can find it.
- umanwizard 10y agoNitpick: they are not open-sourcing it; they are just leaving the compiled binary unencrypted.
- samfisher83 10y agoThe OS X and iOS kernel are descendants of the nextStep kernel which is open source. http://en.wikipedia.org/wiki/XNU http://en.wikipedia.org/wiki/XNU
- dietrichepp 10y agoRight, but how much code does the last open-source xnu have in common with the latest?
- newhouseb 10y agoApple continues to open source their version of XNU, although there has been an increasing lag between the release of each OS version and the corresponding sources. The latest available sources are from 10.11.2, three minor versions behind. Apple has also shifted to pushing a lot of sensitive/proprietary code into kernel extensions (the new Apple File System being one example), for which they don't release source code (generally speaking).
- uxp 10y agoFilesystems, by and large, are supposed to be pushed into the kernel (via extension, or direct compilation). I'd hardly say that they've "shifted" into pushing code into their kernel, but that much of what differentiates Apple's XNU kernel vs FreeBSD's Kernel or Linux is what they choose the exclude.
- jevinskie 10y agoI believe the grandparent post is referring to the fact that HFS+ is available in the open source release of xnu [1] while the question of whether Apple will open source APFS kext, especially given their recent trend of moving functionality from xnu into closed source kexts. I think it would be smart for them to open source it, if not simply for the interoperability use cases. [1]: http://opensource.apple.com//source/xnu/xnu-2050.18.24/bsd/hfs/ http://opensource.apple.com//source/xnu/xnu-2050.18.24/bsd/h...
- newhouseb 10y agoYep. So far, they've committed to publishing "the APFS volume format" [1]. It'll be interesting if they fold it back (into the kernel proper) as part of making APFS bootable. [1] https://developer.apple.com/library/prerelease/content/documentation/FileManagement/Conceptual/APFS_Guide/UsingtheAppleFileSystem/UsingtheAppleFileSystem.html https://developer.apple.com/library/prerelease/content/docum...
- newhouseb 10y agoSorry, I wasn't totally clear. I was talking about shifting functionality _from_the_kernel_ into kernel extensions, not functionality from user space.
- colechristensen 10y agoAnd there are non-trivial bits of OS X which are open sourced http://opensource.apple.com/release/os-x-10112/ http://opensource.apple.com/release/os-x-10112/
- umanwizard 10y agoI know that. But who knows how much secret sauce they have in the iOS build? Also, even on OS X, it takes a while after new versions of the OS are released for new kernel source bundles to drop. So sometimes poking around with IDA is your only recourse.
- iheartmemcache 10y agoA non-trivial amount of the iOS platform has been rev-eng'd (incidentally, largely with IDA and those kernel sources to create binaries with intact symbols + binary comparison heuristics[1]). XNU is largely based on FreeBSD so I'd be surprised if that wasn't an additional vehicle people were using (In a similar vein, fail0verflow used the syscode table information from FreeBSD with WebKit and ROPgadgets to fully compromise the PS3.) RE: this specific exploit, here's the POC making it around the security sphere (thanks @heisecode!) https://github.com/heisecode/Bug_POCs https://github.com/heisecode/Bug_POCs [1] https://static.googleusercontent.com/media/www.zynamics.com/en//downloads/dimva_paper2.pdf https://static.googleusercontent.com/media/www.zynamics.com/...
- TickleSteve 10y agoXNU != BSD. XNU == MACH + BSD Personality.
- samfisher83 10y agoI get down voted for sharing some knowledge. What is the point of even posting?
- Corrado 10y agoThat's an interesting point of view that I hadn't considered before. Apple (or any company) doesn't have infinite eyeballs and can't possibly inspect every nuance to their systems. So, you release it to the world and have them surface any issues. If there are no trade secrets and everyone is honest and reliable, then it is a great way to increase your security footprint. :)
- matthewaveryusa 10y agoAlso, all you need is one insider kernel developer to get all the source code anyways. I always find these kinds of initiatives silly -- A lot of companies think that an insider is a side-channel attack when really it's the main vector.
- iofj 10y agoAlso, given enough money available, why ask people to build vulnerabilities in ? Does anyone seriously think Apple's (or anyone's) kernel team doesn't have a single guy/girl that made at least one mistake ?
- mtgx 10y agoAnd Apple, as well as Microsoft, Intel, and other companies have already voluntarily agreed to give the NSA and other agencies "early notice" of a vulnerability which can be exploited by the time it's fixed anyway. CISA also pretty much mandated it into law as well.
- duaneb 10y agoOf course there are bugs, but they are hugely expensive to find.
- panic 10y agoAlso, all you need is one insider kernel developer to get all the source code anyways. You mean this source code? http://opensource.apple.com/source/xnu/ http://opensource.apple.com/source/xnu/
- jevinskie 10y agoThat is, unfortunately, by no means "all the source code" of the kernel-level code that is running on your Mac, iPhone, iPad, iPod, Apple TV, or Apple Watch.
- StillBored 10y agoYah, I've had this discussion numerous times. Especially with regard to hiring people from a competitor. Often you wonder how much information is traveling via unintentional side channels (not just employees that are also on the payroll of a 3 letter agency). OTOH, there does seem to be a fair amount of competence where it matters though. In the couple companies I worked for the private keys used for signing things were very quietly kept hidden from the vast majority of the engineering teams/etc. AKA, it was possible to create an development/test builds all day long, but creating valid license keys/firmware updates/etc for the builds given to customers was limited to a formal process which contained the keys. The private keys were only available to a couple people tasked with maintaining the automation from which the builds/keys/etc came from. Those people rarely had a need to move/etc them either, and such activities were done in the open.
- justinsaccount 10y ago"The kernel cache doesn’t contain any user info, and by unencrypting it we’re able to optimize the operating system’s performance without compromising security," an Apple spokesperson told TechCrunch. "Apple confirms iOS kernel code left unencrypted intentionally" Which is it, cache (of what?) or code?
- JonathonW 10y agoCache of code. OS X and iOS maintain a cache containing the kernel and prelinked kernel extensions as a performance optimization-- this allows the system to avoid scanning the actual directory containing kernel extensions at boot. See: http://osxbook.com/book/bonus/misc/optimizations/#TWO http://osxbook.com/book/bonus/misc/optimizations/#TWO and https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/KernelProgramming/booting/booting.html https://developer.apple.com/library/mac/documentation/Darwin...
- jevinskie 10y agoThe spokesperson is talking out of their ass regarding performance. The kernel is decrypted by iBoot once at boot, using the hardware AES engine. It remains decrypted until the device is shutdown/rebooted. Decompressing and decrypting the kernel takes less than a second at boot. Also, TechCrunch fails to note that the kernelcache keys for most 32-bit kernels (and all iOS versions) are publicly available. Private individuals have dumped the keys for 64-bit kernels but they are not available publicly. Even without the keys, any jailbreak allows for dumping of the kernel. However, a kernel dump is missing very helpful MachO headers (handy for kloading) and, for 64-bit kernels, the EL3 TrustZone Watchtower module aka Kernel Patch Protection.
- culturestate 10y ago> The spokesperson is talking out of their ass regarding performance. I'm fairly certain that this statement was vetted by Craig Federighi himself or, at minimum, a high-level engineering manager.
- 10y ago
- peterkelly 10y agoIn other news: Google admits source code used in Android kernel can be accessed by hackers
- krastanov 10y agoI do not think they are talking about source code, rather about some compiled code cache. I am not completely certain that the author of the article knows what they are talking about (but I am quite confused myself and I will appreciate an explanation). Also, I thought a lot of the Darwin MacOS kernel had already publicly available source code.
- jevinskie 10y agoSome of the kernel is released months/years later as open source. You are correct about the releases being macOS only, iOS xnu has never been open sourced but it is, for the most part, identical. Apple has also been moving code out of the open source kernel releases and into private, closed source kexts. Kernel extensions like Sandbox have never been released.
- jevinskie 10y agoI forgot to mention launchd. It was open source then was closed and split into launchd/libxpc. It has always been a critical security component of macOS/iOS. Many CVEs have been written about it even after it was closed via binary reversing and fuzzing. Having the source again would be nice.
- NEDM64 10y agoMust be a revolutionary new feature called "jailbreak bait"...
- gcr 10y agoIs there any modern kernel in widespread use that runs while encrypted in RAM? What kind of attacks would encrypting a running kernel prevent? The kernel and hardware work together to enforce memory safety, so it can't be to prevent a rogue process from reading kernel memory... Edit: Is this talking about encrypting the kernel image in permanent storage, or encrypting a running kernel in RAM? When booting Linux for example, the boot loader will load the Linux kernel image into memory as a gzip-compressed blob. The kernel's first instructions are a small decompressor program that unpack the rest of the kernel image into memory and then jumps into the uncompressed kernel. Did previous iOS versions do something similar to their saved kernel image?
- jevinskie 10y agoPermanent storage. The kernelcache is lzss compressed and encrypted with AES. I forget the details of signature verification at the moment, but that is done using RSA. The iBoot bootloader handles all of the decompression, decryption, and signature verification.
- crypty 10y ago> encrypting a running kernel in RAM How is that supposed to work? Ok, the CPU can fetch an encrypted instruction, decrypt it and execute it, but when it needs to jump, how is it supposed to know where to jump? Also encrypting each instruction separately and independently would be trivial to reverse. Is there any system that really runs encrypted code from RAM? Any papers describing such a system?
- evgen 10y agoA company that Facebook acquired a couple of years ago (PrivateCore) realized that the L1 cache had grown large enough that you could run a hypervisor out of it. You use a TPM secure boot chain to ensure you are booting the code you need into the hardware you expect, load up the hypervisor and its keys, and then this hypervisor is used to encrypt _everything_. Now you have encrypted RAM, so physical possession of a running device gets you nothing at all.
- ericmsimons 10y agoCould this be an invitation for researchers to find a backdoor the NSA required Apple to put in there? Or are they just utilizing the crowd to help secure against NSA attacks?
- manicdee 10y agoIs there any way to use this information to confirm that the current kernel on a phone is legit?
- godzillabrennus 10y agoThat would make sense. They have been on the offensive for protecting their customers. Trouble is auditing TrueCrypt cost $25k and it took massive rumors of a backdoor to raise that. I'm not sold that auditing this will happen anytime soon.
- n42 10y agoSlightly off topic; but does anyone have any resources that go into a higher level detail (I'm not very knowledgable of low-level programming type stuff) of how an audit like the one done on TrueCrypt or a hypothetical security audit on the iOS kernel works? How can anyone know with that degree of certainty that software is secure and someone else won't find some exploitable bit?
- prirun 10y agoOr could this be an invitation to make it possible for the XXX to hack the kernel? Seems it could go either way.
- comex 10y agoThe kernel and the root FS are now unencrypted - but not other things, such as the bootloaders (iBoot, LLB) and the firmware for the SEP (Secure Enclave Processor, used to handle things like Touch ID).
- dguido 10y agoThis is stupid. Anyone interested in writing jailbreaks for iOS would have already had access to these binaries. People are blowing this way out of proportion.
- willstrafach 10y agonot true. 64-bit kernel was previously not possible to examine. additionally: we now know what Watchtower looks like, something that was previously a mystery and even incorrectly thought to be something that ran on SEP instead of the AP.
- dguido 10y agoIf Stefan says it will you believe me? https://twitter.com/i0n1c/status/745922795977187329 https://twitter.com/i0n1c/status/745922795977187329 You just used a kernel privesc that you probably already had to read it. NOT A BIG DEAL.
- jevinskie 10y agoThat gets you a kernel dump, a decrypted kernelcache gives you very handy MachO headers. And as Will said, the well known kernel dumping methods do not dump Watchtower. I'm not sure if anyone has privately been able to dump Watchtower with a kernel privsec or if it has only been possible with the kernelcache keys.
- headShrinker 10y agoA move like this fits with a more general ideology Apple has been advocating for the last three years. Privacy, security, and ultruism. Tim Cook has put is mark on the company. One of the first things he did was apologize, (for maps) something unheard of in Apple's culture. I haven't drank the cool-aid and Apple has a lot of issues. I do see they however are making attempts at differentiating from the general corporate behavior of the telecoms and Google. Cook is differentiating from Jobs as well.
- hackuser 10y agoI don't know enough about their new ethical approach to say whether it's PR, whether it's just a few well-publicized decisions, or whether it's broad-based and substantial. I'm not saying either way; I just don't know. But it could make me a loyal customer much more than cool design and fashionable cache ever would.
- nostromo 10y agoWhen they took on the FBI I decided that it was more than just vacuous PR. A PR person would bristle at the idea of denying to unlock the phone of a terrorist. It took real cojones for Apple to stand up for privacy at such a time.
- smnscu 10y agoWow, how gullible you are. It's obviously Apple and FBI are actually best buddies and this was just a PR move to sell more iPhones. Wake up, sheeple. /s Seriously, the cynicism in this thread is deplorable even for HN standards.
- piyush_soni 10y agoLanguage aside, the cynicism might not be entirely invalid too. It might be naive to believe any one side of the two (i.e., entirely PR, or entirely for 'the greater public good')
- 10y ago
- fowl2 10y agoHopefully they didn't tie their integrity/authenticity enforcement to their encryption... Although I'm guessing the whole segment is loaded into ram and verified by the bootloader at boot then never touched again.
- gionn 10y ago“The kernel cache doesn’t contain any user info, and by unencrypting it we’re able to optimize the operating system’s performance without compromising security,” This is probably the only true part of the article, it means that they disabled a kernel feature of cache encryption to speed-up performances. It has nothing to do with source code nor binaries of the kernel.
- spiderfarmer 10y agoDoes the same count for the watchOS kernel? I mean, the performance enhancements they claim to have realized have to come from somewhere.
- gionn 10y agoby disabling encryption as said?
- djrogers 10y ago> the performance enhancements they claim to have realized have to come from somewhere Even in the first beta, the performance enhancements are real. Numerous Apple folks, including Craig Federighi, have said that with WatchOS1 and 2 they 'overshot' how conservative they needed to be with RAM and CPU (out of respect for battery life), and with WatchOS 3 they have rebalanced that. Time will tell how much of a hit battery life will take from this, but for a beta things look good so far.
- NEDM64 10y agoThis, and they also realized they had leftover RAM.
- chronid 10y ago> The kernel manages security and limits the ways applications on an iPhone or iPad can access the hardware of the device, making it a crucial part of the operating system. The kernel technically is the OS, TC! Come on... :)
- majewsky 10y ago> This would have been an incredibly glaring oversight, like forgetting to put doors on an elevator You mean a paternoster? :)
- rimantas 10y agoFor the not familiar/lazy: https://en.wikipedia.org/wiki/Paternoster https://en.wikipedia.org/wiki/Paternoster