3 ms·
For everyone complaining about Apple taking away something or other that was important to you: please consider what SIP/"rootless" actually is. What Apple have
by derefr 11y ago
For everyone complaining about Apple taking away something or other that was important to you: please consider what SIP/"rootless" actually is.
What Apple have done here is not anything like the "dev mode" switch on Android, or the Gatekeeper "signed code only" setting. This change isn't another of the litany of changes that expand the gap between developers and regular users. This change is, instead, about creating a different model for how OS modifications happen.
For a while now, there have been two copies of OSX on a Mac: the "regular use" one, and the "recovery" partition. Both are full OSX, and can run arbitrary OSX software; it's basically like having a copy of the Linux Live CD you installed Linux from copied to your disk alongside the actual Linux install.
With SIP/rootless, Apple has effectively made it so that instead of the actively-running copy of the OS ever modifying itself, the OS will only ever modify the other copy of the OS on-disk. So you need to have the recovery OS running to modify the files of the "regular use" OS†; and you need to be running in the "regular use" OS to apply a recovery update (i.e. an update to the recovery OS.)
The procedures for getting around SIP by disabling it and then running things, are as arcane as they are because they're quite divorced from the reason for SIP. SIP isn't supposed to be a system for blocking and whitelisting kernel-hooking apps; it's a mechanism for making the OS into something more like CoreOS or the Wii's IOS: a system with two separate on-disc OS images, where at least one is always a Last-Known-Good configuration, and where you reboot into the "spare" one when you want to replace the previously-"active" one. You never fiddle with the "in-use" OS image; you consider it locked.
You still have root on the computer. You just have to be in OS-A to do root-level things to OS-B, and vice-versa.
An analogy: remember how it was impossible (and still is, on some OSes) to resize the boot partition you're running from, requiring you to instead boot from a USB to do that? That's basically what is happening here, except without the need for the USB. You can't do stupid things to the active OS; it's locked. You modify the OS by mounting it as a slave from another copy of the OS.
---
† I'm not actually sure how system updates from the "regular use" side work with SIP enabled. They could have a special exception in the SIP infrastructure, but I doubt it.
I would guess they work like iOS updates do: the update package gets downloaded by the running OS, and then a UEFI flag is written to tell the OS to reboot into the recovery OS in "update" mode. The recovery OS then unpacks and shoves the update, and reboots back.
If there is an exception in SIP for the Installer, it was likely considered more as an optimization over the above process—something to avoid making OSX feel like Windows XP, rebooting five times to get anything done.
- Cieplak 11y agoThanks for explaining this; it makes a lot more sense in that context and is definitely _good_ engineering.
- X-Istence 11y ago> I'm not actually sure how system updates from the "regular use" side work with SIP enabled. They could have a special exception in the SIP infrastructure, but I doubt it. Apple Signed (with Apple's special key) Installers are allowed to modify system paths, including the current running system to install updaets.
- derefr 11y agoInteresting. I'm guessing that only gets used by minor "feature" updates (to e.g. Webkit, or iTunes), and not the full "OSX Update 10.11.x" releases. My suspicion is for anecdotal reasons: I recently Internet-restored my MBP. This pushed it back down to OSX 10.11.0, so it had quite a few OS point-updates to go install. But before I let it do any of those, I enabled FileVault2 and let it finish encrypting. I then had the "pleasure" of watching this sequence of events repeat itself several times, a sequence of events which had never occurred before El Capitan: 1. The OS asks to restart to install an update. 2. The OS reboots and sits at the (UEFI?) drive-unlock pretend-login screen until I enter my password. 3. The OS boots into something that looks like my "regular use" OS—the Menu Bar appears, the cursor appears and starts working, and my regular wallpaper is rendered—but the Finder doesn't start, nor do any of my account's Startup Items or LaunchAgents (not sure about global LaunchDaemons.) 4. The screen (still with HID cursor control enabled!) gets covered in a fullscreen window (not a fullscreened app taking up a Space; wrong transition effect) that has the appearance of a big black screen with an Apple logo and a progress bar. You know, like the boot screen, or iOS's update mode, or a Mac's UEFI firmware update mode. But it's definitely just an app, running within whatever instance of OSX this is. 5. Having completed the update, the computer reboots again, I enter my drive-unlock password again, and I'm back into my regular-use session. --- Previous to El Capitan, OSX Update packages would trigger a much simpler process, equivalent to the process Windows currently goes through: 1. Ask the user to "reboot"; 2. instead of rebooting, stop all userland processes and enter a single-user/maintenance runlevel; 3. run some special privileged (kext?) code that installs/unpacks/shoves the update and directly manipulates the framebuffer to render a progress bar; 4. actually reboot. --- It wouldn't make sense to change from the old process to the current one if it was just for the sake of putting the system into an SIP-disabled mode. Like you said, Apple-signed installers can flout SIP restrictions. It only makes sense to add the extra reboot to the process if you're rebooting into the recovery OS, because having the recovery OS do the work is itself the goal, rather than just an idea born out of necessity. If you're wondering about the "still has my wallpaper" part, though: it's not unprecedented for the recovery OS to be "fed" data from the regular-use OS, so that there's a continuity of control when you reboot into the recovery OS. For example, the recovery OS will receive a copy of any wi-fi AP keys you entered into the System keychain in the regular-use OS, so that you can re-install OSX even if you don't remember your wi-fi password. (I say "will receive a copy" instead of "accesses" because it gets these even if the regular-use OS is sitting in the FileVault2 "locked" state from the recovery OS's perspective—or has already been blown away entirely—where it couldn't possibly just mount the volume to read your System keychain. It seems to be more that the regular-use OS will push a copy of these thing over into the recovery OS when you update them.)