Give the HWInference utility process its own executable so it can drop the JIT entitlement, on macOS
Categories
(Core :: Machine Learning: On Device, task)
Tracking
()
People
(Reporter: padenot, Unassigned)
References
Details
On macOS the HWInference utility process runs from the shared plugin-container executable, which carries the com.apple.security.cs.allow-jit entitlement (see security/mac/hardenedruntime/production/plugin-container.xml) because other utility process kinds can use SpiderMonkey. The new HWInference utility process does not need to write memory and then execute it, so it should not have that entitlement ().
:haik suggested in https://phabricator.services.mozilla.com/D268412 that we add a separate executable for utility process kinds that do not need JS, give it its own bundle ID and entitlements file, and point the HWInference kind at it. That also lets the macOS sandbox policy in SandboxPolicyHWInference.h keep its (moz-deny file-map-executable) without the entitlement undermining it, and gives the process a bundle-ID cache directory that is not shared with content processes. For HWInference, this can influence where the shader cache is located, which is instrumental to the performance story (notably the time to first token, that we need to keep as low as possible).
Windows already gets this: SandboxingKind::HW_INFERENCE uses GenericUtilitySandboxProps, whose delayed mitigations include MITIGATION_DYNAMIC_CODE_DISABLE. Hopefully we can keep it, we've has bad surprises in some Windows' software video decoders, hopefully this doesn't happen again if/when we switch to the OS' ORT on Windows.
Linux has no hooked-up equivalent, but https://bugzilla.mozilla.org/show_bug.cgi?id=2058461 has been file to investigate other avenues to tighten things up.
| Reporter | ||
Updated•4 months ago
|
Description
•