You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So we crash trying to invoked paged code while at dispatch.
The reason why we are invoking this code path in dispatch is because ebpf_pinning_table_delete calls _ebpf_pinning_entry_free while holding pinning_table->lock thus elevating the irql to dispatch. The _ebpf_pinning_entry_free function eventually tries to detach the program from the hook which results in NmrDeregisterClient --> detach handler in netebpfext which tries to free WFP filters by calling an API in paged code.
Solution:
At first I thought the solution was to change the netebpf extension detach handler to delete WFP filters in a passive work item and complete detach operation asynchronously. But this will not solve the problem as currently the ebpf_extension_unload function invokes NmrWaitForClientDeregisterComplete which is passive only.
status = NmrDeregisterClient(client_context->nmr_client_handle);
if (status == STATUS_PENDING) {
status = NmrWaitForClientDeregisterComplete(client_context->nmr_client_handle);
So I suppose the soluition would be to change ebpf_extension_unload to do the NMR deregistration in passive. Not sure, what that means for the EC program detach function call though.
The text was updated successfully, but these errors were encountered:
Why does it need to call _ebpf_pinning_entry_free while holding the lock? Move the call to freeing this entry outside the lock and the problem goes away?
We are hitting this crash in Fix port_quota app usage by dthaler · Pull Request #1184 · microsoft/ebpf-for-windows (github.com).
Crash details:
Function
FwpmFilterDeleteById
is marked as paged#pragma alloc_text(PAGE, FwpmFilterDeleteById)
So we crash trying to invoked paged code while at dispatch.
The reason why we are invoking this code path in dispatch is because
ebpf_pinning_table_delete
calls_ebpf_pinning_entry_free
while holdingpinning_table->lock
thus elevating the irql to dispatch. The_ebpf_pinning_entry_free
function eventually tries to detach the program from the hook which results inNmrDeregisterClient
--> detach handler in netebpfext which tries to free WFP filters by calling an API in paged code.Solution:
At first I thought the solution was to change the netebpf extension detach handler to delete WFP filters in a passive work item and complete detach operation asynchronously. But this will not solve the problem as currently the
ebpf_extension_unload
function invokesNmrWaitForClientDeregisterComplete
which is passive only.So I suppose the soluition would be to change ebpf_extension_unload to do the NMR deregistration in passive. Not sure, what that means for the EC program detach function call though.
The text was updated successfully, but these errors were encountered: