Title: NEFilterDataProvider — fail-closed behaviour after provider crash or suspension
I'm investigating the documented failure behaviour of NEFilterDataProvider on macOS.
For a content filter handling outbound socket flows:
- If the data provider process crashes, is terminated, or disconnects unexpectedly, what happens to existing allowed, paused and partially released flows?
- If the provider is suspended or its callback queue stops making progress, does macOS retain existing verdicts indefinitely, block further data, or apply some other behaviour?
- Can an existing
passBytesallowance remain usable after the provider becomes unavailable? - Is there a supported mechanism for independently confirming that all relevant existing flows and outstanding release allowances have been fenced?
I'm particularly interested in documented guarantees, rather than implementation behaviour observed in individual tests.
Any relevant Apple API documentation or technical clarification would be appreciated.
I’m glad you asked these questions because it gave me an opportunity to clarify my own understanding of this.
There are some general principles here:
- If the filter provider isn’t available — for example, it crashed before the system could pass it the flow — the system will drop the flow.
- If the filter provider allows a flow and then crashes, that will have no effect on the flow. It’ll keep on… ah… um… flowing (-:
- If the system passes a flow to the filter provider and the filter provider crashes before it’s resolved the flow — so, no deny or allow verdict — then the system will drop the flow.
It sounds like this matches what you were hoping for, so that’s good news. However, I suspect that this is a case where the combined behaviour of your product and the system is critical to the security guarantees of your product, and my standard advice is such cases is to add your own integration tests to ensure that you get the behaviour you want.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"