Skip to content

Fixes to WFP object lifetime. - #349

Merged
Shankar Seal (shankarseal) merged 4 commits into
microsoft:mainfrom
shankarseal:shankarseal-wfp-lifetime-fixes
Nov 17, 2026
Merged

Shankar Seal (shankarseal) merged 4 commits into
microsoft:mainfrom
shankarseal:shankarseal-wfp-lifetime-fixes

Conversation

@shankarseal

Copy link
Copy Markdown
Collaborator

Summary

This PR fixes #344 and #345 by improving filter and flow-context lifetime management in the mock WFP component.

  • Makes flow-context lookup and removal atomic under the engine lock. FwpsFlowRemoveContext0 returns STATUS_NOT_FOUND if the association was already removed, preventing duplicate flow-delete notifications.
  • Uses shared ownership to keep filter context alive through classify callback completion, deferring the filter-delete notification until outstanding references are released.
  • Refactors packet and ALE classification helpers to invoke the same shared callout function.

Validation

  • WFP tests passed: 152 assertions across 2 test cases.
  • eBPF-for-Windows netebpfext unit tests passed with fault injection.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants