diff options
| author | Daniel Borkmann <daniel@iogearbox.net> | 2025-07-31 02:47:30 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-09-09 19:50:17 +0300 |
| commit | 23099792bb6fafe4aa4063e261a17e2bb743026f (patch) | |
| tree | 692790f35feda1f673196f07b90ff773de12a23e /include/linux | |
| parent | 7a6c2d093c4599727874a7e5e9b27fb313d2bd9c (diff) | |
| download | linux-23099792bb6fafe4aa4063e261a17e2bb743026f.tar.xz | |
bpf: Add cookie object to bpf maps
[ Upstream commit 12df58ad294253ac1d8df0c9bb9cf726397a671d ]
Add a cookie to BPF maps to uniquely identify BPF maps for the timespan
when the node is up. This is different to comparing a pointer or BPF map
id which could get rolled over and reused.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20250730234733.530041-1-daniel@iogearbox.net
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bpf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 4236de05a8e7..dd6a62134e7d 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -200,6 +200,7 @@ struct bpf_map { struct mutex freeze_mutex; atomic64_t writecnt; bool free_after_mult_rcu_gp; + u64 cookie; /* write-once */ }; static inline bool map_value_has_spin_lock(const struct bpf_map *map) |
