Skip to content

Commit 8ab54bd

Browse files
shpalanishankarsealsaxena-anurag
authored
Release v0.14.1 (#3265)
* fix check for static initialization of hash-of-maps key length. (#3260) * fix check for static initialization of hash-of-maps key length. * Delete tests/bpf2c_tests/expected/xdp_adjust_head_unsafe_dll.c * Delete tests/bpf2c_tests/expected/xdp_adjust_head_unsafe_raw.c * Delete tests/bpf2c_tests/expected/xdp_adjust_head_unsafe_sys.c * fix build failure --------- Co-authored-by: Anurag Saxena <[email protected]> * Revert "Helper reallocate packet (#3110)" (#3263) This reverts commit 13eed74. * bump version to 0.14.1 * fix test --------- Co-authored-by: Shankar Seal <[email protected]> Co-authored-by: Anurag Saxena <[email protected]>
1 parent d050ad7 commit 8ab54bd

File tree

160 files changed

+676
-483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+676
-483
lines changed

docs/eBpfExtensions.md

-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ Helper function IDs for different program types need not be unique.
130130
* `return_type`: Set the appropriate value for the `ebpf_return_type_t` enum that represents the return type of the
131131
helper function.
132132
* `arguments`: Array of (at most) five helper function arguments of type `ebpf_argument_type_t`.
133-
* `reallocate_packet`: Flag indicating if this helper function performs packet reallocation.
134133

135134
#### `ebpf_argument_type_t` Enum
136135
This enum describes the various argument types that can be passed to an eBPF helper function. This is defined in the

include/ebpf_program_types.h

-5
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@
77

88
#include <guiddef.h>
99
#if !defined(NO_CRT) && !defined(_NO_CRT_STDIO_INLINE)
10-
#include <stdbool.h>
1110
#include <stdint.h>
1211
#else
1312
typedef unsigned char uint8_t;
1413
typedef unsigned int uint32_t;
1514
typedef unsigned long long uint64_t;
1615
typedef unsigned short wchar_t;
17-
#define bool _Bool
1816
#endif
1917

2018
#define EBPF_MAX_PROGRAM_DESCRIPTOR_NAME_LENGTH 256
@@ -29,15 +27,12 @@ typedef struct _ebpf_program_type_descriptor
2927
char is_privileged;
3028
} ebpf_program_type_descriptor_t;
3129

32-
#define HELPER_FUNCTION_REALLOCATE_PACKET 0x1
33-
3430
typedef struct _ebpf_helper_function_prototype
3531
{
3632
uint32_t helper_id;
3733
const char* name;
3834
ebpf_return_type_t return_type;
3935
ebpf_argument_type_t arguments[5];
40-
bool reallocate_packet : 1;
4136
} ebpf_helper_function_prototype_t;
4237

4338
typedef struct _ebpf_program_info

installer/Product.wxs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SPDX-License-Identifier: MIT
66
<?define ProductVersion="022C44B5-8969-4B75-8DB0-73F98B1BD7DC"?>
77
<?define UpgradeCode="B6BCACB1-C872-4159-ABCB-43A50668056C"?>
88
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:ui="http://schemas.microsoft.com/wix/UIExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
9-
<Product Id="$(var.ProductVersion)" Name="eBPF for Windows" Language="1033" Version="0.14.0" Manufacturer="Microsoft" UpgradeCode="$(var.UpgradeCode)">
9+
<Product Id="$(var.ProductVersion)" Name="eBPF for Windows" Language="1033" Version="0.14.1" Manufacturer="Microsoft" UpgradeCode="$(var.UpgradeCode)">
1010
<Package Description="eBPF for Windows" InstallerVersion="301" Compressed="yes" InstallScope="perMachine" Manufacturer="Microsoft" Platform="x64" />
1111
<MajorUpgrade AllowSameVersionUpgrades="yes"
1212
Disallow="yes" DisallowUpgradeErrorMessage="An older version of [ProductName] is already installed. Please remove it first."

libs/api_common/store_helper_internal.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ _load_helper_prototype(
4545

4646
// Read serialized helper prototype information.
4747
char serialized_data[sizeof(ebpf_helper_function_prototype_t)] = {0};
48-
bool reallocate_packet = false;
4948
size_t expected_size = sizeof(helper_prototype->helper_id) + sizeof(helper_prototype->return_type) +
50-
sizeof(helper_prototype->arguments) + sizeof(reallocate_packet);
49+
sizeof(helper_prototype->arguments);
5150

5251
status = ebpf_read_registry_value_binary(
5352
helper_info_key, EBPF_HELPER_DATA_PROTOTYPE, (uint8_t*)serialized_data, expected_size);
@@ -67,10 +66,6 @@ _load_helper_prototype(
6766
memcpy(&helper_prototype->arguments, serialized_data + offset, sizeof(helper_prototype->arguments));
6867
offset += sizeof(helper_prototype->arguments);
6968

70-
memcpy(&reallocate_packet, serialized_data + offset, sizeof(reallocate_packet));
71-
helper_prototype->reallocate_packet = reallocate_packet ? HELPER_FUNCTION_REALLOCATE_PACKET : 0;
72-
offset += sizeof(reallocate_packet);
73-
7469
helper_prototype->name =
7570
cxplat_duplicate_string(ebpf_down_cast_from_wstring(std::wstring(helper_name)).c_str());
7671
if (helper_prototype->name == nullptr) {

libs/api_common/windows_helpers.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,5 @@ get_helper_prototype_windows(int32_t n)
6161
verifier_prototype.argument_type[i] = raw_prototype->arguments[i];
6262
}
6363

64-
verifier_prototype.reallocate_packet = raw_prototype->reallocate_packet == TRUE;
65-
6664
return verifier_prototype;
6765
}

libs/execution_context/ebpf_program.c

-8
Original file line numberDiff line numberDiff line change
@@ -2063,7 +2063,6 @@ _IRQL_requires_max_(PASSIVE_LEVEL) static ebpf_result_t _ebpf_program_compute_pr
20632063
// b. Helper name.
20642064
// c. Helper return type.
20652065
// d. Helper argument types.
2066-
// e. reallocate_packet flag (if set).
20672066

20682067
// Note:
20692068
// Order and fields being hashed is important. The order and fields being hashed must match the order and fields
@@ -2129,13 +2128,6 @@ _IRQL_requires_max_(PASSIVE_LEVEL) static ebpf_result_t _ebpf_program_compute_pr
21292128
goto Exit;
21302129
}
21312130
}
2132-
2133-
if (helper_function_prototype->reallocate_packet) {
2134-
result = EBPF_CRYPTOGRAPHIC_HASH_APPEND_STR(cryptographic_hash, "reallocate_packet");
2135-
if (result != EBPF_SUCCESS) {
2136-
goto Exit;
2137-
}
2138-
}
21392131
}
21402132
*hash_length = 0;
21412133
result = ebpf_cryptographic_hash_get_hash_length(cryptographic_hash, hash_length);

libs/shared/ebpf_serialize.c

+1-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ typedef struct _ebpf_serialized_helper_function_prototype
2929
uint32_t helper_id;
3030
ebpf_return_type_t return_type;
3131
ebpf_argument_type_t arguments[5];
32-
uint8_t reallocate_packet;
3332
size_t name_length;
3433
uint8_t name[1];
3534
} ebpf_serialized_helper_function_prototype_t;
@@ -463,8 +462,6 @@ ebpf_serialize_program_info(
463462
for (uint16_t index = 0; index < EBPF_COUNT_OF(helper_prototype->arguments); index++) {
464463
serialized_helper_prototype->arguments[index] = helper_prototype->arguments[index];
465464
}
466-
serialized_helper_prototype->reallocate_packet =
467-
helper_prototype->reallocate_packet ? HELPER_FUNCTION_REALLOCATE_PACKET : 0;
468465
serialized_helper_prototype->name_length = helper_function_name_length;
469466
// Copy the program type descriptor name buffer.
470467
memcpy(serialized_helper_prototype->name, helper_prototype->name, helper_function_name_length);
@@ -630,14 +627,12 @@ ebpf_deserialize_program_info(
630627
goto Exit;
631628
}
632629

633-
// Deserialize helper prototype.
630+
// Serialize helper prototype.
634631
helper_prototype->helper_id = serialized_helper_prototype->helper_id;
635632
helper_prototype->return_type = serialized_helper_prototype->return_type;
636633
for (int i = 0; i < EBPF_COUNT_OF(helper_prototype->arguments); i++) {
637634
helper_prototype->arguments[i] = serialized_helper_prototype->arguments[i];
638635
}
639-
helper_prototype->reallocate_packet =
640-
serialized_helper_prototype->reallocate_packet == HELPER_FUNCTION_REALLOCATE_PACKET;
641636

642637
// Adjust remaining buffer length.
643638
result = ebpf_safe_size_t_subtract(

libs/store_helper/ebpf_store_helper.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Microsoft Corporation
22
// SPDX-License-Identifier: MIT
33

4+
#include "ebpf_program_types.h"
45
#include "ebpf_registry_helper.h"
56
#include "ebpf_store_helper.h"
67
#include "ebpf_windows.h"
@@ -40,7 +41,6 @@ _ebpf_store_update_helper_prototype(
4041
uint32_t offset;
4142
ebpf_store_key_t helper_function_key = NULL;
4243
char serialized_data[sizeof(ebpf_helper_function_prototype_t)] = {0};
43-
const bool reallocate_packet = helper_info->reallocate_packet;
4444

4545
wchar_t* wide_helper_name = ebpf_get_wstring_from_string(helper_info->name);
4646
if (wide_helper_name == NULL) {
@@ -63,9 +63,6 @@ _ebpf_store_update_helper_prototype(
6363
memcpy(serialized_data + offset, helper_info->arguments, sizeof(helper_info->arguments));
6464
offset += sizeof(helper_info->arguments);
6565

66-
memcpy(serialized_data + offset, &reallocate_packet, sizeof(reallocate_packet));
67-
offset += sizeof(reallocate_packet);
68-
6966
// Save the helper prototype data.
7067
result = ebpf_write_registry_value_binary(
7168
helper_function_key, EBPF_HELPER_DATA_PROTOTYPE, (uint8_t*)&serialized_data[0], offset);

netebpfext/net_ebpf_ext_program_info.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ static const ebpf_helper_function_prototype_t _xdp_test_ebpf_extension_helper_fu
1414
{XDP_EXT_HELPER_FUNCTION_START + 1,
1515
"bpf_xdp_adjust_head",
1616
EBPF_RETURN_TYPE_INTEGER,
17-
{EBPF_ARGUMENT_TYPE_PTR_TO_CTX, EBPF_ARGUMENT_TYPE_ANYTHING},
18-
HELPER_FUNCTION_REALLOCATE_PACKET}};
17+
{EBPF_ARGUMENT_TYPE_PTR_TO_CTX, EBPF_ARGUMENT_TYPE_ANYTHING}}};
1918

2019
// XDP_TEST program information.
2120
static const ebpf_context_descriptor_t _ebpf_xdp_test_context_descriptor = {

resource/ebpf_version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#define EBPF_VERSION_MAJOR 0
55
#define EBPF_VERSION_MINOR 14
6-
#define EBPF_VERSION_REVISION 0
6+
#define EBPF_VERSION_REVISION 1
77

88
#define QUOTE(str) #str
99
#define EXPAND_AND_QUOTE(str) QUOTE(str)

tests/bpf2c_tests/expected/atomic_instruction_fetch_add_dll.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ _get_version(_Out_ bpf2c_version_t* version)
179179
{
180180
version->major = 0;
181181
version->minor = 14;
182-
version->revision = 0;
182+
version->revision = 1;
183183
}
184184

185185
static void

tests/bpf2c_tests/expected/atomic_instruction_fetch_add_raw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ _get_version(_Out_ bpf2c_version_t* version)
153153
{
154154
version->major = 0;
155155
version->minor = 14;
156-
version->revision = 0;
156+
version->revision = 1;
157157
}
158158

159159
static void

tests/bpf2c_tests/expected/atomic_instruction_fetch_add_sys.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ _get_version(_Out_ bpf2c_version_t* version)
314314
{
315315
version->major = 0;
316316
version->minor = 14;
317-
version->revision = 0;
317+
version->revision = 1;
318318
}
319319

320320
static void

tests/bpf2c_tests/expected/atomic_instruction_others_dll.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ _get_version(_Out_ bpf2c_version_t* version)
152152
{
153153
version->major = 0;
154154
version->minor = 14;
155-
version->revision = 0;
155+
version->revision = 1;
156156
}
157157

158158
static void

tests/bpf2c_tests/expected/atomic_instruction_others_raw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ _get_version(_Out_ bpf2c_version_t* version)
126126
{
127127
version->major = 0;
128128
version->minor = 14;
129-
version->revision = 0;
129+
version->revision = 1;
130130
}
131131

132132
static void

tests/bpf2c_tests/expected/atomic_instruction_others_sys.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ _get_version(_Out_ bpf2c_version_t* version)
287287
{
288288
version->major = 0;
289289
version->minor = 14;
290-
version->revision = 0;
290+
version->revision = 1;
291291
}
292292

293293
static void

tests/bpf2c_tests/expected/bad_map_name_dll.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ _get_version(_Out_ bpf2c_version_t* version)
179179
{
180180
version->major = 0;
181181
version->minor = 14;
182-
version->revision = 0;
182+
version->revision = 1;
183183
}
184184

185185
static void

tests/bpf2c_tests/expected/bad_map_name_raw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ _get_version(_Out_ bpf2c_version_t* version)
153153
{
154154
version->major = 0;
155155
version->minor = 14;
156-
version->revision = 0;
156+
version->revision = 1;
157157
}
158158

159159
static void

tests/bpf2c_tests/expected/bad_map_name_sys.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ _get_version(_Out_ bpf2c_version_t* version)
314314
{
315315
version->major = 0;
316316
version->minor = 14;
317-
version->revision = 0;
317+
version->revision = 1;
318318
}
319319

320320
static void

tests/bpf2c_tests/expected/bindmonitor_dll.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2022,7 +2022,7 @@ _get_version(_Out_ bpf2c_version_t* version)
20222022
{
20232023
version->major = 0;
20242024
version->minor = 14;
2025-
version->revision = 0;
2025+
version->revision = 1;
20262026
}
20272027

20282028
static void

tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_dll.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6192,7 +6192,7 @@ _get_version(_Out_ bpf2c_version_t* version)
61926192
{
61936193
version->major = 0;
61946194
version->minor = 14;
6195-
version->revision = 0;
6195+
version->revision = 1;
61966196
}
61976197

61986198
static void

tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_raw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6166,7 +6166,7 @@ _get_version(_Out_ bpf2c_version_t* version)
61666166
{
61676167
version->major = 0;
61686168
version->minor = 14;
6169-
version->revision = 0;
6169+
version->revision = 1;
61706170
}
61716171

61726172
static void

tests/bpf2c_tests/expected/bindmonitor_mt_tailcall_sys.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6327,7 +6327,7 @@ _get_version(_Out_ bpf2c_version_t* version)
63276327
{
63286328
version->major = 0;
63296329
version->minor = 14;
6330-
version->revision = 0;
6330+
version->revision = 1;
63316331
}
63326332

63336333
static void

tests/bpf2c_tests/expected/bindmonitor_raw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1996,7 +1996,7 @@ _get_version(_Out_ bpf2c_version_t* version)
19961996
{
19971997
version->major = 0;
19981998
version->minor = 14;
1999-
version->revision = 0;
1999+
version->revision = 1;
20002000
}
20012001

20022002
static void

tests/bpf2c_tests/expected/bindmonitor_ringbuf_dll.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ _get_version(_Out_ bpf2c_version_t* version)
183183
{
184184
version->major = 0;
185185
version->minor = 14;
186-
version->revision = 0;
186+
version->revision = 1;
187187
}
188188

189189
static void

tests/bpf2c_tests/expected/bindmonitor_ringbuf_raw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ _get_version(_Out_ bpf2c_version_t* version)
157157
{
158158
version->major = 0;
159159
version->minor = 14;
160-
version->revision = 0;
160+
version->revision = 1;
161161
}
162162

163163
static void

tests/bpf2c_tests/expected/bindmonitor_ringbuf_sys.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ _get_version(_Out_ bpf2c_version_t* version)
318318
{
319319
version->major = 0;
320320
version->minor = 14;
321-
version->revision = 0;
321+
version->revision = 1;
322322
}
323323

324324
static void

tests/bpf2c_tests/expected/bindmonitor_sys.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2157,7 +2157,7 @@ _get_version(_Out_ bpf2c_version_t* version)
21572157
{
21582158
version->major = 0;
21592159
version->minor = 14;
2160-
version->revision = 0;
2160+
version->revision = 1;
21612161
}
21622162

21632163
static void

tests/bpf2c_tests/expected/bindmonitor_tailcall_dll.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,7 @@ _get_version(_Out_ bpf2c_version_t* version)
22332233
{
22342234
version->major = 0;
22352235
version->minor = 14;
2236-
version->revision = 0;
2236+
version->revision = 1;
22372237
}
22382238

22392239
static void

tests/bpf2c_tests/expected/bindmonitor_tailcall_raw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2207,7 +2207,7 @@ _get_version(_Out_ bpf2c_version_t* version)
22072207
{
22082208
version->major = 0;
22092209
version->minor = 14;
2210-
version->revision = 0;
2210+
version->revision = 1;
22112211
}
22122212

22132213
static void

tests/bpf2c_tests/expected/bindmonitor_tailcall_sys.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2368,7 +2368,7 @@ _get_version(_Out_ bpf2c_version_t* version)
23682368
{
23692369
version->major = 0;
23702370
version->minor = 14;
2371-
version->revision = 0;
2371+
version->revision = 1;
23722372
}
23732373

23742374
static void

tests/bpf2c_tests/expected/bpf_call_dll.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ _get_version(_Out_ bpf2c_version_t* version)
179179
{
180180
version->major = 0;
181181
version->minor = 14;
182-
version->revision = 0;
182+
version->revision = 1;
183183
}
184184

185185
static void

tests/bpf2c_tests/expected/bpf_call_raw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ _get_version(_Out_ bpf2c_version_t* version)
153153
{
154154
version->major = 0;
155155
version->minor = 14;
156-
version->revision = 0;
156+
version->revision = 1;
157157
}
158158

159159
static void

tests/bpf2c_tests/expected/bpf_call_sys.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ _get_version(_Out_ bpf2c_version_t* version)
314314
{
315315
version->major = 0;
316316
version->minor = 14;
317-
version->revision = 0;
317+
version->revision = 1;
318318
}
319319

320320
static void

0 commit comments

Comments
 (0)