337 points · by ameshkov · 6y ago · 328 comments
The company I worked for and our competitor VMWare both had to create small kexts to enable on-the-fly capture of USB devices. We both accessed USB devices from user-space, but we needed to put small kexts in the kernel to prevent class drivers from being automatically attached to general USB devices. There was really no race-free user-space way of doing this and Apple ignored our messages on their dev forums when we asked for assistance.
I wonder if they’ve added an interface for this? Or maybe promiscuous USB device control just isn’t going to be possible now?
I've since moved back to Windows, but I hope Parallels might make a Windows version. The Windows competitors aren't as good as their Mac versions, and painfully slow compared to Parallels running on my ancient MBP 2012.
Edit: Windows XP, because I still remember its Product Key. Ha. I probably reinstalled XP in my PC as a kid about a hundred times.
I still do all my work on one, fast as the day I bought it.
See here: https://communities.vmware.com/servlet/JiveServlet/download/...
Are there any details about DriverKit that are available?
I used to be a Mac driver developer ~10 years ago or so. I did one of the first 10G drivers for Macos, and MacOS performance was always terrible compared to Linux or BSD, but I can't imagine that moving it into userspace is going to help anything. MacOS boundary crossing (eg, syscall, ioctl, and Mach traps) performed even worse than their network stack as compared to Linux/BSD.
https://developer.apple.com/videos/play/wwdc2019/702/
https://developer.apple.com/documentation/driverkit?language...
https://developer.apple.com/system-extensions/
Regarding performance, on the other hand Linux/BSD still don't match macOS real time audio capabilities.
Got a source for that? I use a Debian machine for an audio workstation. I moved there from OSX and am using the same DAW and get less latency now. Especially because I can run a real-time kernel...
They don't have to customise their kernel on the newly bought Window/macOS laptop.
Yes, they're on the documentation site. Here's NetworkingDriverKit:
https://developer.apple.com/documentation/networkingdriverki...
With the fancy new userspace networking stack, I wouldn't assume that a DriverKit implementation is necessarily slower. At least compared to the old networking stack.
(It says it's meant to be used "to develop drivers for USB Ethernet adapter", but I don't believe there's anything specifically tying it to USB. DriverKit currently doesn't support PCI access; I don't know if that's coming, but the PCI APIs for kexts are not deprecated, so at minimum you could write a kext just to map the device into userspace.)
I was toying with trying to port the Linux Mellanox ConnectX drivers to macOS to avoid having to pay 2-3x the price for ATTO FastFrame cards. You need a special entitlement from Apple to sign network csrd drivers though.
FWIW I can only get about 60Gbps out of the ATTO FastFrame on macOS versus easily 98Gbps for Mellanox ConnectX on Linux.
% kextstat | grep -v com.apple
Index Refs Address Size Wired Name (Version) UUID <Linked Against>
185 0 0xffffff7f84cc0000 0x5000 0x5000 org.pqrs.driver.Karabiner.VirtualHIDDevice.v061000 (6.10.0) 4D004D1A-ED2F-3780-AD53-A10F286EC759 <51 6 5 3 1>
% Index Refs Address Size Wired Name (Version) UUID <Linked Against>
109 0 0xffffff7f83eb3000 0x7000 0x7000 net.sf.tuntaposx.tun (1.0) 95DD963D-E23D-3B0F-8DE8-A4D2F6BFA5CC <8 6 5 1>
110 0 0xffffff7f83eba000 0x7000 0x7000 net.sf.tuntaposx.tap (1.0) 23FDB715-3D0D-3A26-ACBA-E3794C231CB7 <8 6 5 1>
111 3 0xffffff7f83ec1000 0xf0000 0xf0000 org.virtualbox.kext.VBoxDrv (6.0.12) 79AB3317-5F6D-3FE0-965C-92E45277AA0D <8 6 5 3 1>
112 0 0xffffff7f83fb1000 0x29000 0x29000 com.intel.kext.intelhaxm (7.5.1) D0CC7B8F-1F62-33B1-BE6B-B5573D2A607B <8 6 5 3 1>
117 0 0xffffff7f84000000 0x8000 0x8000 org.virtualbox.kext.VBoxUSB (6.0.12) B1285DF7-2D17-3497-A948-40825951123A <116 111 54 8 6 5 3 1>
180 0 0xffffff7f84964000 0x5000 0x5000 org.virtualbox.kext.VBoxNetFlt (6.0.12) C1B5DFEA-CB4C-30BD-9A92-C92391F7BDE0 <111 8 6 5 3 1>
184 0 0xffffff7f84a2f000 0x6000 0x6000 com.valvesoftware.SteamInput (4357.73.42) 17B6ECD0-A50A-3D6A-B350-9C70805EE129 <44 6 5 3>
191 0 0xffffff7f85b19000 0x6000 0x6000 org.virtualbox.kext.VBoxNetAdp (6.0.12) F8D3E46F-C4EA-397A-ACB1-EF2BF77C0506 <111 6 5 1>
193 0 0xffffff7f85b2e000 0x6000 0x6000 com.getdropbox.dropbox.kext (1.10.3) F29DD0CB-48D6-311A-9B69-E39CF775493C <8 6 5 2 1>
- Dropbox- Virtualbox
- Tuntap for VPN
- Valve controller support
- Intel haxm for Android Emulator
If it doesn't get updated, I'll have to start looking at custom mechanical keyboards. Their controllers (some small Arduino variant) allow any random key mapping.
Thankfully PCB was QMK and VIA compatible so nice GUI to flash the firmware with my desired keyboard layout.
Might be worth noting that Karabiner Elements can be sponsored through GitHub - I would very much encourage anyone who finds it as invaluable as I do, to consider giving what they feel it is worth to them!
The good news is that there appear to be multiple options for taking KE into this new kernel world, and the only cost is dropping support for older versions of macOS. Unfortunate, but not unexpected.
$ kextstat | grep -v com.apple
Index Refs Address Size Wired Name (Version) UUID <Linked Against>
140 0 0xffffff7f83ac2000 0x4000 0x4000 com.intel.driver.EnergyDriver (2.0) 7FE9AF4A-A8C2-3099-A956-971DDC86A467 <8 6 5 3>
171 0 0xffffff7f843eb000 0x29000 0x29000 com.intel.kext.intelhaxm (7.5.1) D0CC7B8F-1F62-33B1-BE6B-B5573D2A607B <8 6 5 3 1>
173 0 0xffffff7f84c3b000 0x6000 0x6000 ch.tripmode.TripModeNKE (2.0.2) 1D30A109-766F-3620-B617-EA67C07823A9 <6 5 1>
183 0 0xffffff7f8283f000 0x6000 0x6000 com.getdropbox.dropbox.kext (1.10.3) F29DD0CB-48D6-311A-9B69-E39CF775493C <8 6 5 2 1>
195 0 0xffffff7f84d15000 0x15000 0x15000 com.vmware.kext.vmnet (1501.84.42) 1ED47440-F016-3E97-A701-E889165CCD39 <6 5 3 1>
196 0 0xffffff7f84d2a000 0x13000 0x13000 com.vmware.kext.vmx86 (1501.84.42) 3327B843-5057-3EAA-B149-E1E6FF7B4F91 <8 6 5 3 1>
197 0 0xffffff7f83ced000 0x7000 0x7000 com.vmware.kext.vmioplug.18.7.0 (18.7.0) 53E03BEC-2BFD-3A6D-B092-A2116987781F <61 6 5 3 1>
Edited, with a list of apps:- VMWare Fusion (mostly just for fun things like trying out Linux distros and messing with TempleOS and old versions of Windows, mainly);
- Dropbox (Smart Sync);
- Trip Mode (for certain WiFi networks, namely tethering, enforces a whitelist of things allowed to use the network);
- Intel's Power Gadget thing (can give power usage and clock speed stats from the Intel CPU & Platform; I don't use this much).
Okay this is bad: I can not imagine NOT having Little Snitch watching over my shoulder.
https://blog.obdev.at/little-snitch-and-possible-deprecation...
Panic got some special exemptions to be in the Mac App Store previously, but they are not allowed to talk about it in detail. Perhaps LS is going a similar route and it will be revealed when Apple releases the next version of macOS.
>But what happens if Apple will not or cannot provide the required features? NKEs will be deprecated, but not Kernel Extensions in general. We can still implement a Kernel Extension to augment the functionality of the NE framework.
System Version: macOS 10.14.6 (18G2022)
kextstat -l | grep -v com.apple | tr -s ' ' | cut -f 7,8 -d ' '
com.logitech.manager.kernel.driver (6.62.1)
com.samsung.portablessd.driver (1.5.02)
com.intel.driver.EnergyDriver (3.7.0)
com.bitgapp.eqMac2Driver (2.0)
com.objective-see.lulu (1.2.3)
com.Cycling74.driver.Soundflower (2)
org.virtualbox.kext.VBoxDrv (6.1.2)
com.intel.kext.intelhaxm (7.5.1)
org.virtualbox.kext.VBoxUSB (6.1.2)
org.virtualbox.kext.VBoxNetFlt (6.1.2)
org.virtualbox.kext.VBoxNetAdp (6.1.2)Also, I was expecting to see a kext from VMWare, because I use VMWare Fusion, but there wasn't one.
[1] https://www.obdev.at/products/littlesnitch/index.html [2] https://objective-see.com/products/kextviewr.html
com.vmware.kext.vmnet
com.vmware.kext.vmx86
com.vmware.kext.vmioplug.18.7.0
This is the key part, as presented during the WWDC 2019 talks, the long term roadmap is to make macOS into a proper mikro-kernel OS.
This is just the start.
These changes from Apple have forced this vendor to completely rewrite their product the right way.
I suppose avoiding kernel panics is an improvement but let’s be real: these enterprise vendors have always made shit software and rarely keep up with OS releases or updates. They’re not about to change any time soon.
https://developer.apple.com/videos/play/wwdc2019/702/
From the transcript:
"MacOS 10.15 Catalina will be the last release to fully support Kernel Extensions without compromises." Specifically, for the capabilities supported by System Extensions and the device families supported by DriverKit, using a Kernel Extension to do that same job is now deprecated and a future release of macOS will not load Kernel Extensions of these kinds. In future releases, we will add more kinds of System Extensions and more device families to DriverKit.
In turn, Kernel Extensions of those kinds will also be deprecated."
Apple-approved developers are still going to be loading whatever crap they want into kernel space, incl AMD or nVidia graphics drivers and the lot. It's not like they can convert XNU into an actual microkernel in less than a decade or two.
This just means that if you're not on the Apple-whitelist then macOS becomes a yet even more close platform for you. Wanted to developed a driver for a PCIe network card? Sorry, no can do!
>A System Extension is part of your app that extends the functionality of the operating system in ways similar to a Kernel Extension but running in user space outside the kernel.
>DriverKit is a new SDK with all new frameworks based on IOKit but updated and modernized, designed for building Driver Extensions in user space outside the kernel.
You can build and test certain types of drivers in Catalina, but they won't be required until the next version of the OS ships.
>In Catalina, you can control USB, Serial, Network Interface, and Human Interface devices.
They will announce support for more kinds of user space drivers over time.
If there is not an available user space option for a particular use case, the existing kernel space option will continue to work.
I definitely do not miss the kernel panics from unplugging an older FTDI based Arduino while it was sending serial data!
Works fine with the FTDI driver and pre-Mavericks Apple drivers.
(I'd far rather use the Apple driver, which is much better at reliably detecting the device without needing to reinsert it, so this is a bit tiresome...)
(there's a bit of history there - a company developed it for a commercial product, Google ended up forking the open source parts for the android emulator which eventually resulted in them contributing it back to qemu upstream).
OpenCore Reference Manual https://github.com/acidanthera/OpenCorePkg/blob/master/Docs/...
OpenCore Vanilla Guide https://khronokernel.github.io/Opencore-Vanilla-Desktop-Guid...
> more than 60 seconds, so you can’t dynamically page in large files anymore
certain vendors with legacy engines they've ported 10 years into the future are in trouble. But, assuming a 10.17 release, which they've worked out with apple? They'll be fine, mostly.
They say that future OS releases will no longer load deprecated KPIs, but they do not note the VFS KPIs as deprecated in their list.
It let me browse and copy files off. I had a few directories that were password-protected and I wasn't able to access them. There might be a way to do so but they just weren't important enough to me to do more investigation.
https://www.maketecheasier.com/mount-access-ext4-partition-m... is the instructions I followed. I've since removed the components since I don't have any other old Linux drives lurking around. Removal seems to have worked just fine.
* Driver for RTL815X that works with my USB Ethernet adapter from RTL.
The standard Apple driver refused to run at 1G, only at 100Mb. It'll be interesting to see if they update the drivers any time soon.
* Tripmode that controls network I/O (I don't use it)
* Karabiner Elements to handle my custom keyboard
I use the (excellent) Karbiner-Elements to handle my keyboard and it has a kext that sets up a virtual keyboard and virtual pointer as HID devices. So I'm guessing that's going to need to be converted from a kext to something using the HIDDriverKit.
> In macOS 10.15.4, use of deprecated KPIs triggers a notification to the user that the software includes a deprecated API and asks the user to contact the developer for alternatives.
Yes, the documentation is scanty in places, and there is some missing functionality at the moment. And the support burden on these companies, once 10.15.4 ships, will be a pain ("It's OK, the software still works, don't worry about that alert message"). But it is incorrect to say that Apple has not given developers time to react.
I'm treading extremely old ground, but fwiw:
I don't fault Apple for pulling 64 bit Carbon from Leopard. It makes sense—the OS had already been delayed and they had to cut stuff in order to ship.
But I find it totally bizarre that they never shipped 64 bit Carbon. Why wasn't it in Snow Leopard? Heck, Lion even.
Catalina's nixing of 32 bit would be a lot less painful if Carbon apps had some kind of upgrade path.
I don't. Carbon was a >20-year-old codebase which had always ran on a 32-bit system. I wouldn't be surprised at all if they simply determined that there was too much code which would have to be rewritten to run correctly on 64-bit.
Certainly but the problem is that such changes should be announced years in advance.
Cocoa, OpenGL, ObjC... all are going to die some day and Apple will probably announce it 1 year before it happens, at the most.
Unless you’re suggesting that Apple will only give 1 year’s notice when they remove deprecated features - in which case, they might only give 0.25 years (at WWDC), which happens quite frequently.
Also, why half a year? Do you think it will take them that much to release 10.15.4?
I'm joking but documentation (and tech support) do seem to be dying things at Apple and elsewhere.
How is that enough time?
It's been really worrying to see large enterprises that have moved from Windows to macOS and carry their thinking that the need to install a third party AV product (which in turn often acts as a near-unrestricted way into the kernel).
JAMF uses the MDM APIs that Apple provides. It also can't access personal data via those APIs. Your anti-virus may use kernel extensions, in which case it will stop working.
Probably, "die." I'm not sure we'll miss them; that whole market is sketchy, and more obsolete every year as the OS gets more secure on its own.
I would like to know what is the alternative today, not 10 years from now.
Also, do you mean XProtect? https://eforensicsmag.com/72717-2/
If Apple still made great software and even better hardware then I wouldn't care, but that hasn't been the case for years.
Reasons to stick with them: company purchasing policy.
...for now.
and kexts [will] have a userspace alternate.
...which is unlikely to have the same performance and control benefits as running "on the hardware", and I bet they will also gradually lobotomise the APIs in userspace too.
Apple's control-freak attitude is nothing new. This is just another step along their plan to turn desktops and laptops into the same dumbed-down walled-garden platform as mobile devices.
I suspect that even Linux will be adopting a more restrictive (if decentralized and overridable) model for third party binaries sooner than later.
Can you tell what is a better hardware and/or software for you?
Did you had any 32-bit software that don't exist as 64-bit versions?
I have at least a dozen off the top of my head. Probably more if I actually checked (which is why I'm not upgrading)
The title as written deserves a (2019) since they announced this to developers last year.
Additionally, they _announced_ the deprecation at WWDC, but that did not take immediate effect. The point of this post is that they are as of right now no longer supported.
So now that Catalina is officially released, they are following up on this.
They are still supported in Catalina and they will be unsupported to varying degrees after Catalina, same as they said last year.
I don't want to and can't speak for Microsoft, and I did not make the final decision, but:
* The user space alternatives (NSFileProvider, EndpointSecurity) are not up to the job for various reasons.
* Porting everything to the much more involved VFS KPI would have been a large amount of work, and with a near-100% risk of having the rug pulled out under it yet again.
The macOS port uses the KAUTH listener API, which was indeed deprecated with 10.15.
It sounds like FileProvider would be perfectly suited to the job if it weren't pulled.
Not currently. Not that I can find.
lol which one of you? i fully sympathize but oof, guess you lost that fight
It could be compared to changes that Chrome plans (or already introduced?) to restrict extensions that filter sites which affect adblockers and you're at mercy of Google what you can block and what you cannot.
Similarly here, you will only be able to hook to interfaces Apple provided, but if you plan to do something that wasn't thought of, or Apple does not approve, tough luck.
This doesn’t change anything w.r.t. running your own software on hardware you bought from them.
They want MacOS to be stable and secure. Disallowing kernel extensions is a step towards that.
It goes into two steps.
1 - A new user space API for what was previously kernel API gets introduced
2 - There is one OS release where the kernel API gets deprecated
3 - The release thereafter removes the kernel API
Long term roadmap is to make macOS into a proper micro-kernel OS.
8 hackintosh related kexts, out of which one is for the temperature sensors that i can live without.
What worries me is stuff like Paragon NTFS, intel haxm for Android emulation, osxfuse used by pCloud...
Hopefully people will find new ways to support macOS on PC hardware, since Apple doesn't really seem interested in the prosumer desktop market.
This means for the moment, I don't have an upgrade path that works for me...
Is there any alts for virtualbox?
I've looked at doing some similar stuff, and I think they'll have to reimplement it as a "VPN", where the VPN is really just a user space process that performs the desired filtering. It'll be interesting to see how the Little Snitch guys approach it.
1. https://developer.apple.com/documentation/networkextension
I mean porting kernel extensions would probably be a big deal, so deprecating them would be the first step.
Guess Apple really wants to keep me locked in an old OS for as long as possible.
- FUSE
- XQuartz
- LittleSnitch
$ kextstat -l | grep -v com.apple | tr -s ' ' | cut -f 7,8 -d ' ' at.obdev.nke.LittleSnitch (5430)
It does use a kernel extention.
How well that will work in practice remains to be seen. But they aren't simply deprecating all kernel extensions.
Far from a comprehensive test, but, yeah, there's probably a reason Parallels defaults to their custom kext.
* VMWare Fusion * Little Snitch * Dropbox
plus one for a firewall I don't run anymore and could get rid of.
Think System Integrity Protection (SIP), the read-only system volume introduced in Catalina, etc.
All good for security and your typical macOS user. That these changes are also frustrating for hackers is just a side-effect they are willing to accept.
Edit: I'm completely, totally, and utterly wrong, don't mind me.