Skip to content

_update_array_map_entry_with_handle doesn't handle > 255 map entries correctly. #4465

Open
@Alan-Jowett

Description

@Alan-Jowett

uint8_t* entry = &map->data[*key * map->ebpf_map_definition.value_size]; is incorrect. *key is a pointer to uint8_t, not an integer index. It should be (uint32_t)key to match the pattern used elsewhere for array index calculation.

Suggested change:

  • uint8_t* entry = &map->data[*key * map->ebpf_map_definition.value_size];
    
  • uint8_t* entry = &map->data[*(uint32_t*)key * map->ebpf_map_definition.value_size];
    

Metadata

Metadata

Assignees

Labels

P2bugSomething isn't workingtriagedDiscussed in a triage meeting

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions