Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect expected behavior of BPF_MAP_TYPE_LRU_HASH #3930

Open
oshaked1 opened this issue Mar 25, 2024 · 0 comments
Open

Incorrect expected behavior of BPF_MAP_TYPE_LRU_HASH #3930

oshaked1 opened this issue Mar 25, 2024 · 0 comments
Labels

Comments

@oshaked1
Copy link
Contributor

According to the documentation for eBPF hash maps (https://docs.kernel.org/bpf/map_hash.html), an LRU hash map is expected to evict the least recently used item when attempting to insert an element when the map is full.

Despite this description, the implementation for the LRU hash map behaves in a way that causes maps with a small number of max entries to behave unexpectedly. See https://stackoverflow.com/questions/75882443/elements-incorrectly-evicted-from-ebpf-lru-hash-map for an example and discussion.

Tracee uses a few small capacity LRU hash maps (io_file_path_cache_map, elf_files_map, recent_deleted_module_map). They should be reviewed to make sure that they don't rely on incorrect assumptions about the behavior of the LRU map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant