Build ebpfcore as a DLL for testing (#2744)

* Update to use latest usersim

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* build ebpfcore under usersim

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update usersim to latest

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix compilation

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Work around analysis warnings

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix installer project

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix memory issues in libbpf implementation

Found my latest usersim code

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update usersim to latest

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix mismatched calloc/free function in ubpf_user.c

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix mismatched alloc/free in verifier_fuzzer

The verifier_fuzzer used ebpf_allocate() but then called free()

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Temporarily use ubpf branch with memory fix

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix memory issues in ebpfsvc

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* PR feedback from Anurag

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
This commit is contained in:
Dave Thaler 2023-08-17 15:55:15 -07:00 коммит произвёл GitHub
Родитель e57858ffc2
Коммит 4e6bed34e8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
32 изменённых файлов: 658 добавлений и 73 удалений

Просмотреть файл

@ -225,6 +225,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbtf", "external\ebpf-ver
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "usersim_dll_skeleton", "external\usersim\usersim_dll_skeleton\usersim_dll_skeleton.vcxproj", "{1937DB41-F3EB-4955-A636-6386DCB394F6}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "usersim_dll_skeleton", "external\usersim\usersim_dll_skeleton\usersim_dll_skeleton.vcxproj", "{1937DB41-F3EB-4955-A636-6386DCB394F6}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EbpfCore_Usersim", "ebpfcore\usersim\EbpfCore_Usersim.vcxproj", "{1FDAD2FD-EBD8-462A-B285-ED5174E55079}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64 Debug|ARM64 = Debug|ARM64
@ -301,6 +303,7 @@ Global
{675B59F8-089E-40B5-8388-56254447CFA3}.FuzzerDebug|ARM64.Build.0 = FuzzerDebug|x64 {675B59F8-089E-40B5-8388-56254447CFA3}.FuzzerDebug|ARM64.Build.0 = FuzzerDebug|x64
{675B59F8-089E-40B5-8388-56254447CFA3}.FuzzerDebug|ARM64.Deploy.0 = FuzzerDebug|x64 {675B59F8-089E-40B5-8388-56254447CFA3}.FuzzerDebug|ARM64.Deploy.0 = FuzzerDebug|x64
{675B59F8-089E-40B5-8388-56254447CFA3}.FuzzerDebug|x64.ActiveCfg = FuzzerDebug|x64 {675B59F8-089E-40B5-8388-56254447CFA3}.FuzzerDebug|x64.ActiveCfg = FuzzerDebug|x64
{675B59F8-089E-40B5-8388-56254447CFA3}.FuzzerDebug|x64.Build.0 = FuzzerDebug|x64
{675B59F8-089E-40B5-8388-56254447CFA3}.FuzzerDebug|x86.ActiveCfg = FuzzerDebug|x64 {675B59F8-089E-40B5-8388-56254447CFA3}.FuzzerDebug|x86.ActiveCfg = FuzzerDebug|x64
{675B59F8-089E-40B5-8388-56254447CFA3}.FuzzerDebug|x86.Build.0 = FuzzerDebug|x64 {675B59F8-089E-40B5-8388-56254447CFA3}.FuzzerDebug|x86.Build.0 = FuzzerDebug|x64
{675B59F8-089E-40B5-8388-56254447CFA3}.FuzzerDebug|x86.Deploy.0 = FuzzerDebug|x64 {675B59F8-089E-40B5-8388-56254447CFA3}.FuzzerDebug|x86.Deploy.0 = FuzzerDebug|x64
@ -354,6 +357,7 @@ Global
{26E7ED0B-C128-4D7C-A90E-C246DEF40AD3}.FuzzerDebug|ARM64.ActiveCfg = FuzzerDebug|ARM64 {26E7ED0B-C128-4D7C-A90E-C246DEF40AD3}.FuzzerDebug|ARM64.ActiveCfg = FuzzerDebug|ARM64
{26E7ED0B-C128-4D7C-A90E-C246DEF40AD3}.FuzzerDebug|ARM64.Build.0 = FuzzerDebug|ARM64 {26E7ED0B-C128-4D7C-A90E-C246DEF40AD3}.FuzzerDebug|ARM64.Build.0 = FuzzerDebug|ARM64
{26E7ED0B-C128-4D7C-A90E-C246DEF40AD3}.FuzzerDebug|x64.ActiveCfg = FuzzerDebug|x64 {26E7ED0B-C128-4D7C-A90E-C246DEF40AD3}.FuzzerDebug|x64.ActiveCfg = FuzzerDebug|x64
{26E7ED0B-C128-4D7C-A90E-C246DEF40AD3}.FuzzerDebug|x64.Build.0 = FuzzerDebug|x64
{26E7ED0B-C128-4D7C-A90E-C246DEF40AD3}.FuzzerDebug|x86.ActiveCfg = FuzzerDebug|x64 {26E7ED0B-C128-4D7C-A90E-C246DEF40AD3}.FuzzerDebug|x86.ActiveCfg = FuzzerDebug|x64
{26E7ED0B-C128-4D7C-A90E-C246DEF40AD3}.FuzzerDebug|x86.Build.0 = FuzzerDebug|x64 {26E7ED0B-C128-4D7C-A90E-C246DEF40AD3}.FuzzerDebug|x86.Build.0 = FuzzerDebug|x64
{26E7ED0B-C128-4D7C-A90E-C246DEF40AD3}.FuzzerDebug|x86.Deploy.0 = FuzzerDebug|x64 {26E7ED0B-C128-4D7C-A90E-C246DEF40AD3}.FuzzerDebug|x86.Deploy.0 = FuzzerDebug|x64
@ -857,7 +861,8 @@ Global
{FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|ARM64.ActiveCfg = Debug|ARM64 {FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|ARM64.ActiveCfg = Debug|ARM64
{FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|ARM64.Build.0 = Debug|ARM64 {FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|ARM64.Build.0 = Debug|ARM64
{FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|ARM64.Deploy.0 = Debug|ARM64 {FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|ARM64.Deploy.0 = Debug|ARM64
{FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|x64.ActiveCfg = Debug|x64 {FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|x64.ActiveCfg = FuzzerDebug|x64
{FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|x64.Build.0 = FuzzerDebug|x64
{FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|x86.ActiveCfg = Debug|x64 {FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|x86.ActiveCfg = Debug|x64
{FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|x86.Build.0 = Debug|x64 {FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|x86.Build.0 = Debug|x64
{FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|x86.Deploy.0 = Debug|x64 {FC3F9998-4085-4767-8386-5453F07C3AAD}.FuzzerDebug|x86.Deploy.0 = Debug|x64
@ -2640,9 +2645,8 @@ Global
{3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|ARM64.ActiveCfg = Debug|x64 {3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|ARM64.ActiveCfg = Debug|x64
{3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|ARM64.Build.0 = Debug|x64 {3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|ARM64.Build.0 = Debug|x64
{3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|ARM64.Deploy.0 = Debug|x64 {3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|ARM64.Deploy.0 = Debug|x64
{3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|x64.ActiveCfg = Debug|x64 {3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|x64.ActiveCfg = FuzzerDebug|x64
{3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|x64.Build.0 = Debug|x64 {3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|x64.Build.0 = FuzzerDebug|x64
{3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|x64.Deploy.0 = Debug|x64
{3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|x86.ActiveCfg = Debug|x64 {3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|x86.ActiveCfg = Debug|x64
{3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|x86.Build.0 = Debug|x64 {3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|x86.Build.0 = Debug|x64
{3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|x86.Deploy.0 = Debug|x64 {3569E946-C8B4-49EE-A89D-EDD09DC9F36E}.FuzzerDebug|x86.Deploy.0 = Debug|x64
@ -2703,9 +2707,9 @@ Global
{AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|ARM64.ActiveCfg = Debug|x64 {AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|ARM64.ActiveCfg = Debug|x64
{AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|ARM64.Build.0 = Debug|x64 {AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|ARM64.Build.0 = Debug|x64
{AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|ARM64.Deploy.0 = Debug|x64 {AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|ARM64.Deploy.0 = Debug|x64
{AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|x64.ActiveCfg = Debug|x64 {AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|x64.ActiveCfg = FuzzerDebug|x64
{AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|x64.Build.0 = Debug|x64 {AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|x64.Build.0 = FuzzerDebug|x64
{AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|x64.Deploy.0 = Debug|x64 {AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|x64.Deploy.0 = FuzzerDebug|x64
{AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|x86.ActiveCfg = Debug|x64 {AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|x86.ActiveCfg = Debug|x64
{AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|x86.Build.0 = Debug|x64 {AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|x86.Build.0 = Debug|x64
{AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|x86.Deploy.0 = Debug|x64 {AA933B9F-B5D8-4AA8-AC18-98FE1A161E8A}.FuzzerDebug|x86.Deploy.0 = Debug|x64
@ -2796,48 +2800,6 @@ Global
{030A7AC6-14DC-45CF-AF34-891057AB1402}.RelWithDebInfo|x64.Build.0 = Release|x64 {030A7AC6-14DC-45CF-AF34-891057AB1402}.RelWithDebInfo|x64.Build.0 = Release|x64
{030A7AC6-14DC-45CF-AF34-891057AB1402}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 {030A7AC6-14DC-45CF-AF34-891057AB1402}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
{030A7AC6-14DC-45CF-AF34-891057AB1402}.RelWithDebInfo|x86.Build.0 = Release|Win32 {030A7AC6-14DC-45CF-AF34-891057AB1402}.RelWithDebInfo|x86.Build.0 = Release|Win32
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.Debug|ARM64.ActiveCfg = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.Debug|ARM64.Build.0 = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.Debug|x64.ActiveCfg = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.Debug|x64.Build.0 = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.Debug|x86.ActiveCfg = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.Debug|x86.Build.0 = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.FuzzerDebug|ARM64.ActiveCfg = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.FuzzerDebug|ARM64.Build.0 = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.FuzzerDebug|x64.ActiveCfg = FuzzerDebug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.FuzzerDebug|x64.Build.0 = FuzzerDebug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.FuzzerDebug|x86.ActiveCfg = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.FuzzerDebug|x86.Build.0 = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.MinSizeRel|ARM64.ActiveCfg = MinSizeRel|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.MinSizeRel|ARM64.Build.0 = MinSizeRel|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.MinSizeRel|x86.ActiveCfg = MinSizeRel|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.MinSizeRel|x86.Build.0 = MinSizeRel|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.NativeOnlyDebug|ARM64.ActiveCfg = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.NativeOnlyDebug|ARM64.Build.0 = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.NativeOnlyDebug|x64.ActiveCfg = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.NativeOnlyDebug|x64.Build.0 = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.NativeOnlyDebug|x86.ActiveCfg = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.NativeOnlyDebug|x86.Build.0 = Debug|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.NativeOnlyRelease|ARM64.ActiveCfg = Release|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.NativeOnlyRelease|ARM64.Build.0 = Release|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.NativeOnlyRelease|x64.ActiveCfg = Release|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.NativeOnlyRelease|x64.Build.0 = Release|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.NativeOnlyRelease|x86.ActiveCfg = Release|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.NativeOnlyRelease|x86.Build.0 = Release|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.Release|ARM64.ActiveCfg = Release|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.Release|ARM64.Build.0 = Release|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.Release|x64.ActiveCfg = Release|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.Release|x64.Build.0 = Release|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.Release|x86.ActiveCfg = Release|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.Release|x86.Build.0 = Release|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.RelWithDebInfo|ARM64.ActiveCfg = RelWithDebInfo|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.RelWithDebInfo|ARM64.Build.0 = RelWithDebInfo|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64
{BC45D39C-F956-3951-BD46-44EAE20EC7C9}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x64
{249E3FBC-0098-3E3E-80AE-C8F8EF6AB0E5}.Debug|ARM64.ActiveCfg = Debug|x64 {249E3FBC-0098-3E3E-80AE-C8F8EF6AB0E5}.Debug|ARM64.ActiveCfg = Debug|x64
{249E3FBC-0098-3E3E-80AE-C8F8EF6AB0E5}.Debug|ARM64.Build.0 = Debug|x64 {249E3FBC-0098-3E3E-80AE-C8F8EF6AB0E5}.Debug|ARM64.Build.0 = Debug|x64
{249E3FBC-0098-3E3E-80AE-C8F8EF6AB0E5}.Debug|x64.ActiveCfg = Debug|x64 {249E3FBC-0098-3E3E-80AE-C8F8EF6AB0E5}.Debug|x64.ActiveCfg = Debug|x64
@ -2922,6 +2884,62 @@ Global
{1937DB41-F3EB-4955-A636-6386DCB394F6}.RelWithDebInfo|x64.Build.0 = Release|x64 {1937DB41-F3EB-4955-A636-6386DCB394F6}.RelWithDebInfo|x64.Build.0 = Release|x64
{1937DB41-F3EB-4955-A636-6386DCB394F6}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 {1937DB41-F3EB-4955-A636-6386DCB394F6}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
{1937DB41-F3EB-4955-A636-6386DCB394F6}.RelWithDebInfo|x86.Build.0 = Release|Win32 {1937DB41-F3EB-4955-A636-6386DCB394F6}.RelWithDebInfo|x86.Build.0 = Release|Win32
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Debug|ARM64.ActiveCfg = Debug|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Debug|ARM64.Build.0 = Debug|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Debug|x64.ActiveCfg = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Debug|x64.Build.0 = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Debug|x64.Deploy.0 = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Debug|x86.ActiveCfg = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Debug|x86.Build.0 = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Debug|x86.Deploy.0 = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.FuzzerDebug|ARM64.ActiveCfg = Debug|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.FuzzerDebug|ARM64.Build.0 = Debug|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.FuzzerDebug|x64.ActiveCfg = FuzzerDebug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.FuzzerDebug|x64.Build.0 = FuzzerDebug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.FuzzerDebug|x64.Deploy.0 = FuzzerDebug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.FuzzerDebug|x86.ActiveCfg = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.FuzzerDebug|x86.Build.0 = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.FuzzerDebug|x86.Deploy.0 = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.MinSizeRel|ARM64.ActiveCfg = NativeOnlyRelease|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.MinSizeRel|ARM64.Build.0 = NativeOnlyRelease|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.MinSizeRel|x64.ActiveCfg = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.MinSizeRel|x64.Build.0 = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.MinSizeRel|x64.Deploy.0 = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.MinSizeRel|x86.ActiveCfg = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.MinSizeRel|x86.Build.0 = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.MinSizeRel|x86.Deploy.0 = Debug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyDebug|ARM64.ActiveCfg = NativeOnlyDebug|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyDebug|ARM64.Build.0 = NativeOnlyDebug|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyDebug|x64.ActiveCfg = NativeOnlyDebug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyDebug|x64.Build.0 = NativeOnlyDebug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyDebug|x64.Deploy.0 = NativeOnlyDebug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyDebug|x86.ActiveCfg = NativeOnlyDebug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyDebug|x86.Build.0 = NativeOnlyDebug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyDebug|x86.Deploy.0 = NativeOnlyDebug|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyRelease|ARM64.ActiveCfg = NativeOnlyRelease|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyRelease|ARM64.Build.0 = NativeOnlyRelease|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyRelease|x64.ActiveCfg = NativeOnlyRelease|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyRelease|x64.Build.0 = NativeOnlyRelease|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyRelease|x64.Deploy.0 = NativeOnlyRelease|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyRelease|x86.ActiveCfg = NativeOnlyRelease|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyRelease|x86.Build.0 = NativeOnlyRelease|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.NativeOnlyRelease|x86.Deploy.0 = NativeOnlyRelease|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Release|ARM64.ActiveCfg = Release|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Release|ARM64.Build.0 = Release|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Release|x64.ActiveCfg = Release|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Release|x64.Build.0 = Release|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Release|x64.Deploy.0 = Release|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Release|x86.ActiveCfg = Release|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Release|x86.Build.0 = Release|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.Release|x86.Deploy.0 = Release|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.RelWithDebInfo|ARM64.ActiveCfg = Release|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.RelWithDebInfo|ARM64.Build.0 = Release|ARM64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.RelWithDebInfo|x64.Build.0 = Release|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.RelWithDebInfo|x64.Deploy.0 = Release|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.RelWithDebInfo|x86.ActiveCfg = Release|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.RelWithDebInfo|x86.Build.0 = Release|x64
{1FDAD2FD-EBD8-462A-B285-ED5174E55079}.RelWithDebInfo|x86.Deploy.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -2992,6 +3010,7 @@ Global
{030A7AC6-14DC-45CF-AF34-891057AB1402} = {69CDB6A1-434D-4BC9-9BFF-D12DF7EDBB6B} {030A7AC6-14DC-45CF-AF34-891057AB1402} = {69CDB6A1-434D-4BC9-9BFF-D12DF7EDBB6B}
{249E3FBC-0098-3E3E-80AE-C8F8EF6AB0E5} = {69CDB6A1-434D-4BC9-9BFF-D12DF7EDBB6B} {249E3FBC-0098-3E3E-80AE-C8F8EF6AB0E5} = {69CDB6A1-434D-4BC9-9BFF-D12DF7EDBB6B}
{1937DB41-F3EB-4955-A636-6386DCB394F6} = {69CDB6A1-434D-4BC9-9BFF-D12DF7EDBB6B} {1937DB41-F3EB-4955-A636-6386DCB394F6} = {69CDB6A1-434D-4BC9-9BFF-D12DF7EDBB6B}
{1FDAD2FD-EBD8-462A-B285-ED5174E55079} = {97D3096A-20FB-4ACB-A038-88E652FE61E3}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3D5F862D-74C6-4357-9F95-0B152E33B7B8} SolutionGuid = {3D5F862D-74C6-4357-9F95-0B152E33B7B8}

Просмотреть файл

@ -0,0 +1,298 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) Microsoft Corporation
SPDX-License-Identifier: MIT
-->
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="FuzzerDebug|ARM64">
<Configuration>FuzzerDebug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="FuzzerDebug|x64">
<Configuration>FuzzerDebug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="NativeOnlyDebug|ARM64">
<Configuration>NativeOnlyDebug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="NativeOnlyDebug|x64">
<Configuration>NativeOnlyDebug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="NativeOnlyRelease|ARM64">
<Configuration>NativeOnlyRelease</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="NativeOnlyRelease|x64">
<Configuration>NativeOnlyRelease</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1FDAD2FD-EBD8-462A-B285-ED5174E55079}</ProjectGuid>
<TemplateGuid>{1bc93793-694f-48fe-9372-81e2b05556fd}</TemplateGuid>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
<Configuration>Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
<RootNamespace>EbpfDriver</RootNamespace>
<ProjectName>EbpfCore_Usersim</ProjectName>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<DriverType>KMDF</DriverType>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation>
<EnableASAN>false</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<DriverType>KMDF</DriverType>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation>
<EnableASAN>false</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyDebug|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<DriverType>KMDF</DriverType>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation>
<EnableASAN>false</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<DriverType>KMDF</DriverType>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation>
<EnableASAN>false</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyRelease|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<DriverType>KMDF</DriverType>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation>
<EnableASAN>false</EnableASAN>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|x64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyDebug|x64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyRelease|x64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ResourceCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SolutionDir)include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</ResourceCompile>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories);$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\wdf\kmdf\1.15;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\execution_context;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;$(SolutionDir)resource</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32_WINNT=0x0a00;%(PreprocessorDefinitions);_AMD64_;BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
<DisableSpecificWarnings>4324</DisableSpecificWarnings>
</ClCompile>
<Midl>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</Midl>
<Link>
<AdditionalDependencies>usersim.lib;uuid.lib;bcrypt.lib;legacy_stdio_definitions.lib;ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>ntdll.lib</IgnoreSpecificDefaultLibraries>
</Link>
<DriverSign>
<FileDigestAlgorithm>SHA256</FileDigestAlgorithm>
</DriverSign>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyRelease|x64'">
<ResourceCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SolutionDir)include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</ResourceCompile>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories);$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\wdf\kmdf\1.15;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\execution_context;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;$(SolutionDir)resource</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32_WINNT=0x0a00;%(PreprocessorDefinitions);_AMD64_;BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
<DisableSpecificWarnings>4324</DisableSpecificWarnings>
</ClCompile>
<Midl>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</Midl>
<Link>
<AdditionalDependencies>usersim.lib;uuid.lib;bcrypt.lib;legacy_stdio_definitions.lib;ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir);$(OutDir)..\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>ntdll.lib</IgnoreSpecificDefaultLibraries>
</Link>
<DriverSign>
<FileDigestAlgorithm>SHA256</FileDigestAlgorithm>
</DriverSign>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ResourceCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SolutionDir)include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</ResourceCompile>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories);$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\wdf\kmdf\1.15;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\execution_context;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;$(SolutionDir)resource</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32_WINNT=0x0a00;%(PreprocessorDefinitions);_AMD64_;BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
<DisableSpecificWarnings>4324</DisableSpecificWarnings>
</ClCompile>
<Midl>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</Midl>
<Link>
<AdditionalDependencies>usersim.lib;uuid.lib;bcrypt.lib;legacy_stdio_definitions.lib;ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>ntdll.lib</IgnoreSpecificDefaultLibraries>
</Link>
<DriverSign>
<FileDigestAlgorithm>SHA256</FileDigestAlgorithm>
</DriverSign>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|x64'">
<ResourceCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SolutionDir)include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</ResourceCompile>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories);$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\wdf\kmdf\1.15;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\execution_context;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;$(SolutionDir)resource</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32_WINNT=0x0a00;%(PreprocessorDefinitions);_AMD64_;BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
<DisableSpecificWarnings>4324</DisableSpecificWarnings>
</ClCompile>
<Midl>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</Midl>
<Link>
<AdditionalDependencies>usersim.lib;uuid.lib;bcrypt.lib;legacy_stdio_definitions.lib;ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>ntdll.lib</IgnoreSpecificDefaultLibraries>
</Link>
<DriverSign>
<FileDigestAlgorithm>SHA256</FileDigestAlgorithm>
</DriverSign>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyDebug|x64'">
<ResourceCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SolutionDir)include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</ResourceCompile>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories);$(WindowsSdkDir)Include\10.0.22621.0\km;$(WindowsSdkDir)Include\wdf\kmdf\1.15;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\execution_context;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;$(SolutionDir)resource</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32_WINNT=0x0a00;%(PreprocessorDefinitions);_AMD64_;BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
<DisableSpecificWarnings>4324</DisableSpecificWarnings>
</ClCompile>
<Midl>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</Midl>
<Link>
<AdditionalDependencies>usersim.lib;uuid.lib;bcrypt.lib;legacy_stdio_definitions.lib;ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir);$(OutDir)..\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>ntdll.lib</IgnoreSpecificDefaultLibraries>
</Link>
<DriverSign>
<FileDigestAlgorithm>SHA256</FileDigestAlgorithm>
</DriverSign>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\ebpf_drv.c">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">USERSIM_DLLMAIN;%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|x64'">USERSIM_DLLMAIN;%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='NativeOnlyDebug|x64'">USERSIM_DLLMAIN;%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='NativeOnlyRelease|x64'">USERSIM_DLLMAIN;%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">USERSIM_DLLMAIN;%(PreprocessorDefinitions);BINARY_COMPATIBLE=0;NT;UNICODE;_UNICODE;NDIS60;POOL_NX_OPTIN_AUTO</PreprocessorDefinitions>
</ClCompile>
</ItemGroup>
<ItemGroup>
<FilesToPackage Include="$(TargetPath)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\external\usersim\src\usersim.vcxproj">
<Project>{030a7ac6-14dc-45cf-af34-891057ab1402}</Project>
</ProjectReference>
<ProjectReference Include="..\..\external\usersim\usersim_dll_skeleton\usersim_dll_skeleton.vcxproj">
<Project>{1937db41-f3eb-4955-a636-6386dcb394f6}</Project>
</ProjectReference>
<ProjectReference Include="..\..\libs\execution_context\kernel\execution_context_kernel.vcxproj">
<Project>{26e7ed0b-c128-4d7c-a90e-c246def40ad3}</Project>
</ProjectReference>
<ProjectReference Include="..\..\libs\platform\kernel\platform_kernel.vcxproj">
<Project>{fc3f9998-4085-4767-8386-5453f07c3aad}</Project>
</ProjectReference>
<ProjectReference Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='FuzzerDebug' Or '$(Configuration)'=='Release'" Include="..\..\libs\ubpf\kernel\ubpf_kernel.vcxproj">
<Project>{675b59f8-089e-40b5-8388-56254447cfa3}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\resource.h" />
<ClInclude Include="ntddk.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\resource\ebpf_resource.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

Просмотреть файл

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) Microsoft Corporation
SPDX-License-Identifier: MIT
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Driver Files">
<UniqueIdentifier>{8E41214B-6785-4CFE-B992-037D68949A14}</UniqueIdentifier>
<Extensions>inf;inv;inx;mof;mc;</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\ebpf_drv.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ntddk.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\resource\ebpf_resource.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

15
ebpfcore/usersim/ntddk.h Normal file
Просмотреть файл

@ -0,0 +1,15 @@
// Copyright (c) Microsoft Corporation
// SPDX-License-Identifier: MIT
// The system headers generate lots of warnings, so disable those around the ntddk.h inclusion.
// TODO(https://github.com/microsoft/usersim/issues/79): move this file to usersim
#pragma warning(push)
#pragma warning(disable : 6387)
#pragma warning(disable : 28160)
#pragma warning(disable : 28230)
#pragma warning(disable : 28252)
#pragma warning(disable : 28253)
#pragma warning(disable : 28285)
#pragma warning(disable : 28301)
#include "../km/ntddk.h"
#pragma warning(pop)

Просмотреть файл

@ -0,0 +1,5 @@
// Copyright (c) Microsoft Corporation
// SPDX-License-Identifier: MIT
#define EBPF_FILE_DESCRIPTION "eBPF For Windows Execution Context"
#define EBPF_FILE_NAME "ebpfcore.sys"

Просмотреть файл

@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation // Copyright (c) Microsoft Corporation
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "ebpf_platform.h"
#include "svc_common.h" #include "svc_common.h"
#include <winsock2.h> #include <winsock2.h>
@ -117,11 +118,11 @@ Exit:
_Must_inspect_result_ _Ret_maybenull_ _Post_writable_byte_size_(size) void* __RPC_USER _Must_inspect_result_ _Ret_maybenull_ _Post_writable_byte_size_(size) void* __RPC_USER
MIDL_user_allocate(_In_ size_t size) MIDL_user_allocate(_In_ size_t size)
{ {
return malloc(size); return ebpf_allocate(size);
} }
void __RPC_USER void __RPC_USER
MIDL_user_free(_Pre_maybenull_ _Post_invalid_ void* p) MIDL_user_free(_Pre_maybenull_ _Post_invalid_ void* p)
{ {
free(p); ebpf_free(p);
} }

2
external/ubpf поставляемый

@ -1 +1 @@
Subproject commit f5eb3010bd1de0632b67ba962afa0e37c11d17af Subproject commit 89b84c6fc4d740b05e6bf7a19f6d2116b1469c7f

2
external/usersim поставляемый

@ -1 +1 @@
Subproject commit 6d6f6e23105358844e140ebf5c9fdaffb197e9cf Subproject commit f9ca4039e8e36909b896a685dd985bedf56d0b5f

Просмотреть файл

@ -222,10 +222,10 @@ SPDX-License-Identifier: MIT
export_program_info.exe requires it. export_program_info.exe requires it.
--> -->
<Component Id="USERSIM.DLL" DiskId="1" Guid="{739017F0-9E33-48FF-A33F-C1434AC757BE}"> <Component Id="USERSIM.DLL" DiskId="1" Guid="{739017F0-9E33-48FF-A33F-C1434AC757BE}">
<File Id="USERSIM.DLL" Name="usersim.dll" Source="$(var.SolutionDir)$(var.Platform)\$(var.Configuration)\usersim.dll" /> <File Id="USERSIM.DLL" Name="usersim.dll" Source="$(var.usersim.TargetPath)" />
</Component> </Component>
<Component Id="USERSIM.PDB" DiskId="1" Guid="{BCE1BF99-6A3D-48A6-A382-4E87A2B20FB2}"> <Component Id="USERSIM.PDB" DiskId="1" Guid="{BCE1BF99-6A3D-48A6-A382-4E87A2B20FB2}">
<File Id="USERSIM.PDB" Name="usersim.pdb" Source="$(var.SolutionDir)$(var.Platform)\$(var.Configuration)\usersim.pdb" /> <File Id="USERSIM.PDB" Name="usersim.pdb" Source="$(var.usersim.TargetDir)usersim.pdb" />
</Component> </Component>
</ComponentGroup> </ComponentGroup>
@ -801,12 +801,18 @@ SPDX-License-Identifier: MIT
<Component Id="DROPPACKET_UNSAFE.O" DiskId="1" Guid="{40156401-DDEA-4435-B559-E7071D251395}"> <Component Id="DROPPACKET_UNSAFE.O" DiskId="1" Guid="{40156401-DDEA-4435-B559-E7071D251395}">
<File Id="DROPPACKET_UNSAFE.O" Name="droppacket_unsafe.o" Source="$(var.SolutionDir)$(var.Platform)\$(var.Configuration)\droppacket_unsafe.o" /> <File Id="DROPPACKET_UNSAFE.O" Name="droppacket_unsafe.o" Source="$(var.SolutionDir)$(var.Platform)\$(var.Configuration)\droppacket_unsafe.o" />
</Component> </Component>
<?if $(var.Configuration) = Debug ?> <Component Id="EBPFCORE_USERSIM.DLL" DiskId="1" Guid="{860B3D19-02BE-482F-930A-B5B5CFAD2B82}">
<Component Id="EMPY_UM.DLL" DiskId="1" Guid="{321F2303-53CC-4CF2-8D92-5FCA988BDCB5}"> <File Id="EBPFCORE_USERSIM.DLL" Name="ebpfcore_usersim.dll" Source="$(var.EbpfCore_Usersim.TargetPath)" />
<File Id="EMPY_UM.DLL" Name="empty_um.dll" Source="$(var.SolutionDir)$(var.Platform)\$(var.Configuration)\empty_um.dll" />
</Component> </Component>
<Component Id="EMPY_UM.PDB" DiskId="1" Guid="{5A07EE87-FF00-47AB-BC15-0C8E1A5EF04F}"> <Component Id="EBPFCORE_USERSIM.PDB" DiskId="1" Guid="{DD7FB772-A974-4D2C-880A-B17C2F69D063}">
<File Id="EMPY_UM.PDB" Name="empty_um.pdb" Source="$(var.SolutionDir)$(var.Platform)\$(var.Configuration)\empty_um.pdb" /> <File Id="EBPFCORE_USERSIM.PDB" Name="ebpfcore_usersim.pdb" Source="$(var.EbpfCore_Usersim.TargetDir)ebpfcore_usersim.pdb" />
</Component>
<?if $(var.Configuration) = Debug ?>
<Component Id="EMPTY_UM.DLL" DiskId="1" Guid="{321F2303-53CC-4CF2-8D92-5FCA988BDCB5}">
<File Id="EMPTY_UM.DLL" Name="empty_um.dll" Source="$(var.SolutionDir)$(var.Platform)\$(var.Configuration)\empty_um.dll" />
</Component>
<Component Id="EMPTY_UM.PDB" DiskId="1" Guid="{5A07EE87-FF00-47AB-BC15-0C8E1A5EF04F}">
<File Id="EMPTY_UM.PDB" Name="empty_um.pdb" Source="$(var.SolutionDir)$(var.Platform)\$(var.Configuration)\empty_um.pdb" />
</Component> </Component>
<?endif?> <?endif?>
<Component Id="ENCAP_REFLECT_PACKET.O" DiskId="1" Guid="{767274A3-97F5-4F35-BB27-1A7166708AD8}"> <Component Id="ENCAP_REFLECT_PACKET.O" DiskId="1" Guid="{767274A3-97F5-4F35-BB27-1A7166708AD8}">

Просмотреть файл

@ -78,6 +78,14 @@ SPDX-License-Identifier: MIT
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups> <RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir> <RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\ebpfcore\usersim\EbpfCore_Usersim.vcxproj">
<Name>EbpfCore_Usersim</Name>
<Project>{1fdad2fd-ebd8-462a-b285-ed5174e55079}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Condition="'$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Release'" Include="..\ebpfsvc\eBPFSvc.vcxproj"> <ProjectReference Condition="'$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Release'" Include="..\ebpfsvc\eBPFSvc.vcxproj">
<Name>ebpfsvc</Name> <Name>ebpfsvc</Name>
<Project>{ba065b6a-38f8-4197-8f66-87c84afad513}</Project> <Project>{ba065b6a-38f8-4197-8f66-87c84afad513}</Project>
@ -86,6 +94,14 @@ SPDX-License-Identifier: MIT
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups> <RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir> <RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\external\usersim\src\usersim.vcxproj">
<Name>usersim</Name>
<Project>{030a7ac6-14dc-45cf-af34-891057ab1402}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\libs\api\api.vcxproj"> <ProjectReference Include="..\libs\api\api.vcxproj">
<Name>api</Name> <Name>api</Name>
<Project>{c8bf60c3-40a9-43ad-891a-8aa34f1c3a68}</Project> <Project>{c8bf60c3-40a9-43ad-891a-8aa34f1c3a68}</Project>

Просмотреть файл

@ -15,7 +15,7 @@ bpf_link__pin(struct bpf_link* link, const char* path)
return libbpf_err(-EBUSY); return libbpf_err(-EBUSY);
} }
link->pin_path = strdup(path); link->pin_path = ebpf_strdup(path);
if (!link->pin_path) { if (!link->pin_path) {
return libbpf_err(-ENOMEM); return libbpf_err(-ENOMEM);
} }

Просмотреть файл

@ -345,7 +345,11 @@ __bpf_program__pin_name(struct bpf_program* prog)
{ {
char *name, *p; char *name, *p;
name = p = strdup(prog->section_name); name = p = ebpf_strdup(prog->section_name);
if (name == nullptr) {
return nullptr;
}
while ((p = strchr(p, '/')) != NULL) { while ((p = strchr(p, '/')) != NULL) {
*p = '_'; *p = '_';
} }
@ -368,7 +372,12 @@ bpf_object__pin_programs(struct bpf_object* obj, const char* path)
char buf[PATH_MAX]; char buf[PATH_MAX];
int len; int len;
len = snprintf(buf, PATH_MAX, "%s/%s", path, __bpf_program__pin_name(prog)); char* pin_name = __bpf_program__pin_name(prog);
if (!pin_name) {
return libbpf_err(-ENOMEM);
}
len = snprintf(buf, PATH_MAX, "%s/%s", path, pin_name);
ebpf_free(pin_name);
if (len < 0) { if (len < 0) {
err = -EINVAL; err = -EINVAL;
goto err_unpin_programs; goto err_unpin_programs;
@ -390,7 +399,12 @@ err_unpin_programs:
char buf[PATH_MAX]; char buf[PATH_MAX];
int len; int len;
len = snprintf(buf, PATH_MAX, "%s/%s", path, __bpf_program__pin_name(prog)); char* pin_name = __bpf_program__pin_name(prog);
if (!pin_name) {
continue;
}
len = snprintf(buf, PATH_MAX, "%s/%s", path, pin_name);
ebpf_free(pin_name);
if (len < 0) { if (len < 0) {
continue; continue;
} else if (len >= PATH_MAX) { } else if (len >= PATH_MAX) {
@ -417,7 +431,12 @@ bpf_object__unpin_programs(struct bpf_object* obj, const char* path)
char buf[PATH_MAX]; char buf[PATH_MAX];
int len; int len;
len = snprintf(buf, PATH_MAX, "%s/%s", path, __bpf_program__pin_name(prog)); char* pin_name = __bpf_program__pin_name(prog);
if (!pin_name) {
return libbpf_err(-ENOMEM);
}
len = snprintf(buf, PATH_MAX, "%s/%s", path, pin_name);
ebpf_free(pin_name);
if (len < 0) { if (len < 0) {
return libbpf_err(-EINVAL); return libbpf_err(-EINVAL);
} else if (len >= PATH_MAX) { } else if (len >= PATH_MAX) {

Просмотреть файл

@ -35,6 +35,17 @@ __drv_allocatesMem(Mem) _Must_inspect_result_ _Ret_writes_maybenull_(size) void*
return ebpf_allocate_with_tag(size, EBPF_POOL_TAG_DEFAULT); return ebpf_allocate_with_tag(size, EBPF_POOL_TAG_DEFAULT);
} }
_Must_inspect_result_ _Ret_maybenull_z_ char*
ebpf_strdup(_In_ PCSTR source)
{
size_t size = strlen(source) + 1;
char* destination = (char*)ebpf_allocate(size);
if (destination) {
strcpy_s(destination, size, source);
}
return destination;
}
void void
ebpf_free(_Frees_ptr_opt_ void* memory) ebpf_free(_Frees_ptr_opt_ void* memory)
{ {

Просмотреть файл

@ -117,6 +117,14 @@ extern "C"
/** /**
* @brief Allocate memory. * @brief Allocate memory.
* @param[in] source String to duplicate.
* @returns Pointer to duplicated string, or null on failure.
*/
_Must_inspect_result_ _Ret_maybenull_z_ char*
ebpf_strdup(_In_ PCSTR source);
/**
* @brief Duplicate a string.
* @param[in] size Size of memory to allocate. * @param[in] size Size of memory to allocate.
* @returns Pointer to memory block allocated, or null on failure. * @returns Pointer to memory block allocated, or null on failure.
*/ */

Просмотреть файл

@ -11,7 +11,10 @@
#include <ntifs.h> #include <ntifs.h>
#include <netioddk.h> #include <netioddk.h>
#include <ntddk.h> #include <ntddk.h>
#pragma warning(push)
#pragma warning(disable : 28196) // Inconsistent annotation for '_umul128'
#include <ntstrsafe.h> #include <ntstrsafe.h>
#pragma warning(pop)
#include <stdint.h> #include <stdint.h>
#include <wdm.h> #include <wdm.h>

Просмотреть файл

@ -9,6 +9,14 @@
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="FuzzerDebug|ARM64">
<Configuration>FuzzerDebug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="FuzzerDebug|x64">
<Configuration>FuzzerDebug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64"> <ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
@ -94,6 +102,16 @@
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation> <Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation>
<EnableASAN>false</EnableASAN> <EnableASAN>false</EnableASAN>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
<CharacterSet>Unicode</CharacterSet>
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation>
<EnableASAN>false</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion> <TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
@ -111,6 +129,14 @@
<DriverTargetPlatform>Universal</DriverTargetPlatform> <DriverTargetPlatform>Universal</DriverTargetPlatform>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|ARM64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion> <TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
@ -129,6 +155,9 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(SolutionDir)\libs\store_helper</IncludePath> <IncludePath>$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(SolutionDir)\libs\store_helper</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|x64'">
<IncludePath>$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(SolutionDir)\libs\store_helper</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(SolutionDir)\libs\store_helper</IncludePath> <IncludePath>$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(SolutionDir)\libs\store_helper</IncludePath>
</PropertyGroup> </PropertyGroup>
@ -144,6 +173,18 @@
<AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(ConfigurationName)\</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(ConfigurationName)\</AdditionalLibraryDirectories>
</Lib> </Lib>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|x64'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;_KRPCENV_;_NO_CRT_STDIO_INLINE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)libs\execution_context;$(SolutionDir)include;$(SolutionDir)libs\platform;$(SolutionDir)libs\platform\kernel;$(SolutionDir)libs\epoch;$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\kernel;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Midl>
<PreprocessorDefinitions>_KRPCENV_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</Midl>
<Lib>
<AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(ConfigurationName)\</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;_KRPCENV_;_NO_CRT_STDIO_INLINE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;_KRPCENV_;_NO_CRT_STDIO_INLINE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -161,6 +202,11 @@
<PreprocessorDefinitions>_DEBUG;WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile> </ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|ARM64'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>

Просмотреть файл

@ -142,4 +142,4 @@
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

Просмотреть файл

@ -3,6 +3,7 @@
#pragma once #pragma once
// TODO(#2677): remove the following include, which should be private to usersim.dll.
#include "..\..\..\external\usersim\src\framework.h" #include "..\..\..\external\usersim\src\framework.h"
#include "usersim\ex.h" #include "usersim\ex.h"
#include "usersim\ke.h" #include "usersim\ke.h"

Просмотреть файл

@ -60,7 +60,7 @@ verify_byte_code(
info.type = get_program_type_windows(*program_type); info.type = get_program_type_windows(*program_type);
} catch (std::runtime_error e) { } catch (std::runtime_error e) {
error << "error: " << e.what(); error << "error: " << e.what();
*error_message = allocate_string(error.str()); *error_message = allocate_string(error.str(), error_message_size);
return EBPF_VERIFICATION_FAILED; return EBPF_VERIFICATION_FAILED;
} }

Просмотреть файл

@ -9,6 +9,10 @@
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="FuzzerDebug|x64">
<Configuration>FuzzerDebug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="NativeOnlyDebug|x64"> <ProjectConfiguration Include="NativeOnlyDebug|x64">
<Configuration>NativeOnlyDebug</Configuration> <Configuration>NativeOnlyDebug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
@ -42,6 +46,15 @@
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<EnableASAN>false</EnableASAN> <EnableASAN>false</EnableASAN>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<EnableASAN>false</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyDebug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyDebug|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion> <TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
@ -80,6 +93,10 @@
<IncludePath>$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(SolutionDir)\include;$(SolutionDir)\libs\store_helper\kernel;$(SolutionDir)\libs\platform\kernel;$(SolutionDir)\external\ebpf-verifier\src</IncludePath> <IncludePath>$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(SolutionDir)\include;$(SolutionDir)\libs\store_helper\kernel;$(SolutionDir)\libs\platform\kernel;$(SolutionDir)\external\ebpf-verifier\src</IncludePath>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|x64'">
<IncludePath>$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(SolutionDir)\include;$(SolutionDir)\libs\store_helper\kernel;$(SolutionDir)\libs\platform\kernel;$(SolutionDir)\external\ebpf-verifier\src</IncludePath>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyDebug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyDebug|x64'">
<IncludePath>$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(SolutionDir)\include;$(SolutionDir)\libs\store_helper\kernel;$(SolutionDir)\libs\platform\kernel;$(SolutionDir)\external\ebpf-verifier\src</IncludePath> <IncludePath>$(IncludePath);$(KMDF_INC_PATH)$(KMDF_VER_PATH);$(SolutionDir)\include;$(SolutionDir)\libs\store_helper\kernel;$(SolutionDir)\libs\platform\kernel;$(SolutionDir)\external\ebpf-verifier\src</IncludePath>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
@ -105,6 +122,20 @@
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyDebug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='NativeOnlyDebug|x64'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>

Просмотреть файл

@ -9,6 +9,10 @@
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="FuzzerDebug|x64">
<Configuration>FuzzerDebug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64"> <ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
@ -29,7 +33,13 @@
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<EnableASAN>false</EnableASAN> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion> <TargetVersion>Windows10</TargetVersion>
@ -37,7 +47,6 @@
<PlatformToolset>v143</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<EnableASAN>false</EnableASAN>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
@ -51,6 +60,11 @@
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath> <LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|x64'">
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(SolutionDir)\include;$(SolutionDir)\libs\store_helper\user;$(SolutionDir)\libs\platform;$(SolutionDir)\libs\platform\user;$(SolutionDir)\external\ebpf-verifier\src;$(SolutionDir)external\usersim\inc</IncludePath>
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(SolutionDir)\include;$(SolutionDir)\libs\store_helper\user;$(SolutionDir)\libs\platform;$(SolutionDir)\libs\platform\user;$(SolutionDir)\external\ebpf-verifier\src;$(SolutionDir)external\usersim\inc</IncludePath> <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(SolutionDir)\include;$(SolutionDir)\libs\store_helper\user;$(SolutionDir)\libs\platform;$(SolutionDir)\libs\platform\user;$(SolutionDir)\external\ebpf-verifier\src;$(SolutionDir)external\usersim\inc</IncludePath>
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath> <LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
@ -69,6 +83,20 @@
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='FuzzerDebug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;USER_MODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>

Просмотреть файл

@ -19,6 +19,12 @@
#include <endian.h> #include <endian.h>
#define UBPF_STACK_SIZE 512 #define UBPF_STACK_SIZE 512
#include <stdlib.h>
#define malloc(X) ebpf_allocate((X))
#define calloc(X, Y) ebpf_allocate((X) * (Y))
#define free(X) ebpf_free(X)
#pragma warning(push) #pragma warning(push)
#pragma warning(disable : 4100) // unreferenced formal parameter #pragma warning(disable : 4100) // unreferenced formal parameter
#pragma warning(disable : 4211) // nonstandard extension used: redefined extern to static #pragma warning(disable : 4211) // nonstandard extension used: redefined extern to static

Просмотреть файл

@ -18,6 +18,8 @@ $source_directory="."
"EbpfApi.pdb", "EbpfApi.pdb",
"EbpfCore.sys", "EbpfCore.sys",
"EbpfCore.pdb", "EbpfCore.pdb",
"EbpfCore_usersim.dll",
"EbpfCore_usersim.pdb",
"ebpfforwindows.wprp", "ebpfforwindows.wprp",
"ebpfnetsh.dll", "ebpfnetsh.dll",
"ebpfnetsh.pdb", "ebpfnetsh.pdb",

Просмотреть файл

@ -20,8 +20,10 @@
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <chrono> #include <chrono>
#include <io.h> #include <io.h>
#include <lsalookup.h>
#include <mstcpip.h> #include <mstcpip.h>
#include <mutex> #include <mutex>
#define _NTDEF_ // UNICODE_STRING is already defined
#include <ntsecapi.h> #include <ntsecapi.h>
#include <thread> #include <thread>
#include <vector> #include <vector>

Просмотреть файл

@ -40,6 +40,8 @@ target_link_libraries("bpf2c_tests" PRIVATE
"bpf2c_driver" "bpf2c_driver"
"bpf2c_dll" "bpf2c_dll"
"ubpf_user" "ubpf_user"
"platform_user"
"usersim"
"Mincore.lib" "Mincore.lib"
) )

Просмотреть файл

@ -221,9 +221,15 @@
<ProjectReference Include="..\..\external\ebpf-verifier\build\ebpfverifier.vcxproj"> <ProjectReference Include="..\..\external\ebpf-verifier\build\ebpfverifier.vcxproj">
<Project>{7d5b4e68-c0fa-3f86-9405-f6400219b440}</Project> <Project>{7d5b4e68-c0fa-3f86-9405-f6400219b440}</Project>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\external\usersim\src\usersim.vcxproj">
<Project>{030a7ac6-14dc-45cf-af34-891057ab1402}</Project>
</ProjectReference>
<ProjectReference Include="..\..\libs\elf_spec\elf_spec.vcxproj"> <ProjectReference Include="..\..\libs\elf_spec\elf_spec.vcxproj">
<Project>{c3d2cd73-bf4c-47df-8808-2a9996124d5b}</Project> <Project>{c3d2cd73-bf4c-47df-8808-2a9996124d5b}</Project>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\libs\platform\user\platform_user.vcxproj">
<Project>{c26cb6a9-158c-4a9e-a243-755ddd98e5fe}</Project>
</ProjectReference>
<ProjectReference Include="..\libs\util\test_util.vcxproj"> <ProjectReference Include="..\libs\util\test_util.vcxproj">
<Project>{d6725f19-b9bf-435f-80f2-c5f3ef0f4b8f}</Project> <Project>{d6725f19-b9bf-435f-80f2-c5f3ef0f4b8f}</Project>
</ProjectReference> </ProjectReference>

Просмотреть файл

@ -35,7 +35,9 @@ namespace ebpf {
#include <array> #include <array>
#include <cguid.h> #include <cguid.h>
#include <chrono> #include <chrono>
#include <lsalookup.h>
#include <mutex> #include <mutex>
#define _NTDEF_ // UNICODE_STRING is already defined
#include <ntsecapi.h> #include <ntsecapi.h>
#include <thread> #include <thread>

Просмотреть файл

@ -344,7 +344,7 @@ _Requires_lock_not_held_(_service_path_to_context_mutex) static void _unload_all
if (context->dll != nullptr) { if (context->dll != nullptr) {
FreeLibrary(context->dll); FreeLibrary(context->dll);
} }
ebpf_free(context); delete context;
} }
_service_path_to_context_map.clear(); _service_path_to_context_map.clear();
} }
@ -633,7 +633,7 @@ _Requires_lock_not_held_(_service_path_to_context_mutex) uint32_t Glue_delete_se
// Delete the service if it has not been loaded yet. Otherwise // Delete the service if it has not been loaded yet. Otherwise
// mark it pending for delete. // mark it pending for delete.
if (!context->loaded) { if (!context->loaded) {
ebpf_free(context); delete context;
_service_path_to_context_map.erase(path); _service_path_to_context_map.erase(path);
} else { } else {
context->delete_pending = true; context->delete_pending = true;

Просмотреть файл

@ -19,8 +19,8 @@ FUZZ_EXPORT int __cdecl LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
const char* error_message = nullptr; const char* error_message = nullptr;
ebpf_api_elf_verify_section_from_memory( ebpf_api_elf_verify_section_from_memory(
reinterpret_cast<const char*>(data), size, "", nullptr, false, &report, &error_message, nullptr); reinterpret_cast<const char*>(data), size, "", nullptr, false, &report, &error_message, nullptr);
free(const_cast<char*>(report)); ebpf_free_string(report);
free(const_cast<char*>(error_message)); ebpf_free_string(error_message);
} catch (std::runtime_error&) { } catch (std::runtime_error&) {
} }

Просмотреть файл

@ -0,0 +1,11 @@
// Copyright (c) Microsoft Corporation
// SPDX-License-Identifier: MIT
#include "catch_wrapper.hpp"
TEST_CASE("DriverEntry", "[usersim]")
{
HMODULE module = LoadLibraryW(L"ebpfcore_usersim.dll");
REQUIRE(module != nullptr);
FreeLibrary(module);
}

Просмотреть файл

@ -227,6 +227,7 @@
<ClCompile Include="..\end_to_end\end_to_end.cpp" /> <ClCompile Include="..\end_to_end\end_to_end.cpp" />
<ClCompile Include="..\end_to_end\netsh_test.cpp" /> <ClCompile Include="..\end_to_end\netsh_test.cpp" />
<ClCompile Include="..\end_to_end\test_helper.cpp" /> <ClCompile Include="..\end_to_end\test_helper.cpp" />
<ClCompile Include="ebpfcore_test.cpp" />
<ClCompile Include="export_program_info_test.cpp" /> <ClCompile Include="export_program_info_test.cpp" />
<ClCompile Include="libbpf_test.cpp" /> <ClCompile Include="libbpf_test.cpp" />
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -52,6 +52,9 @@
<ClCompile Include="..\..\libs\platform\ebpf_tracelog.c"> <ClCompile Include="..\..\libs\platform\ebpf_tracelog.c">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="ebpfcore_test.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\end_to_end\helpers.h"> <ClInclude Include="..\end_to_end\helpers.h">