microsoft / Network-Adapter-Class-Extension

Network Adapter Class Extension to WDF (NetAdapter Cx) makes it easy to write high quality and high speed drivers for Network Interface Controllers
MIT License
54 stars 17 forks source link

NetAdapterCx.sys does not set BytesRead for OID Set operations #14

Open dmiller-nmap opened 1 year ago

dmiller-nmap commented 1 year ago

When an NDIS component such as a LWF originates an OID Set request such as OID_GEN_CURRENT_PACKET_FILTER, NetAdapterCx reads the NDIS_OID_REQUEST, extracts the necessary information from the InformationBuffer, and calls the client driver's EVT_NET_ADAPTER_SET_RECEIVE_FILTER callback. Even though it reads from InformationBuffer, it does not set the NDIS_OID_REQUEST.DATA.SET_INFORMATION.BytesRead member, which has been causing issues (i.e. nmap/npcap#628) for our NDIS LWF that was being strict about checking this member. We are relaxing our code to work around the issue, but NetAdapterCx ought to update it to avoid issues in the future. https://github.com/microsoft/Network-Adapter-Class-Extension/blob/ca1e33c85a0270077a9d527f745897be3e5f6443/netcx/translator/nxtranslationapp.cpp#L1022-L1048

tylerretzlaff commented 1 year ago

thank you for reporting the problem, i've created an internal bug to investigate. we'll report back when information is available.