In macOS 10.11 through 10.13, you didn't have to disable all of SIP in order to use mach_inject in Apple's apps. All that was necessary was to disable debug protections, i.e. csrutil enable --without debug.
Starting in 10.14, in order to inject into Apple processes it is also necessary to disable filesystem protections as well, i.e. csrutil enable --without debug --without fs. With debug protections disabled but filesystem protections enabled, using mach_inject on an Apple process will lead to that process crashing, and using mach_inject on non-Apple processes still works. I thought this was odd as mach_inject doesn't modify the filesystem at all, much less a protected part of it.
I'm not sure if this counts as a bug or if there's anything to be done about it, but I figured I'd bring it up here.
In macOS 10.11 through 10.13, you didn't have to disable all of SIP in order to use mach_inject in Apple's apps. All that was necessary was to disable debug protections, i.e.
csrutil enable --without debug.Starting in 10.14, in order to inject into Apple processes it is also necessary to disable filesystem protections as well, i.e.
csrutil enable --without debug --without fs. With debug protections disabled but filesystem protections enabled, using mach_inject on an Apple process will lead to that process crashing, and using mach_inject on non-Apple processes still works. I thought this was odd as mach_inject doesn't modify the filesystem at all, much less a protected part of it.I'm not sure if this counts as a bug or if there's anything to be done about it, but I figured I'd bring it up here.