Open shpalani opened 2 months ago
RCA: previous_key is null.
In ebpf_map_get_next_key_and_value_batch(...)
{
...
if (flags & EBPF_MAP_FIND_FLAG_DELETE) {
// If the caller requested deletion, delete the entry.
result = ebpf_map_metadata_tables[map->ebpf_map_definition.type].delete_entry(map, previous_key);
if (result != EBPF_SUCCESS) {
break;
}
}
...
}
static ebpf_result_t
_delete_hash_map_entry(_Inout_ ebpf_core_map_t* map, _In_ const uint8_t* key)
{
if (!map || !key) {
return **EBPF_INVALID_ARGUMENT;**
}
return ebpf_hash_table_delete((ebpf_hash_table_t*)map->data, key);
}
I'm working on the fix.
Describe the bug
Problem:
OS information
Windows 10 and above.
Steps taken to reproduce bug
Add the bpf_map_lookup_and_delete_batch() in _test_maps_batch() in libbpf_test.cpp. Then run the test case. Please see "Additional details"
Expected behavior
bpf_map_lookup_and_delete_batch() should retrieve the keys and values and delete those entries in the hash map.
Actual outcome
Returns 22 (EINVAL)
Additional details