From 03e8c109ce714d0f12a603fb9631dd82a86805d5 Mon Sep 17 00:00:00 2001 From: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:07:32 -0700 Subject: [PATCH] Fix AV in netebpfext (#3769) * fix * fix * fix --- netebpfext/net_ebpf_ext_sock_addr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/netebpfext/net_ebpf_ext_sock_addr.c b/netebpfext/net_ebpf_ext_sock_addr.c index 6b15bd0c41..712c462502 100644 --- a/netebpfext/net_ebpf_ext_sock_addr.c +++ b/netebpfext/net_ebpf_ext_sock_addr.c @@ -991,15 +991,17 @@ _Requires_exclusive_lock_held_(_net_ebpf_ext_sock_addr_blocked_contexts #pragma warning(suppress : 6001) /* entry and list entry are non-null */ RemoveEntryList(&entry->list_entry); + uint64_t transport_endpoint_handle = entry->transport_endpoint_handle; BOOLEAN result = RtlDeleteElementGenericTableAvl(&_net_ebpf_ext_sock_addr_blocked_contexts.blocked_context_table, entry); ebpf_assert(result); + entry = NULL; _net_ebpf_ext_sock_addr_blocked_contexts.blocked_context_count--; NET_EBPF_EXT_LOG_MESSAGE_UINT64( NET_EBPF_EXT_TRACELOG_LEVEL_VERBOSE, NET_EBPF_EXT_TRACELOG_KEYWORD_SOCK_ADDR, "_net_ebpf_ext_purge_block_connect_contexts: Delete", - entry->transport_endpoint_handle); + transport_endpoint_handle); } // Free entries from low-memory list.