diff options
| author | Daniel Borkmann <daniel@iogearbox.net> | 2025-07-31 02:47:30 +0300 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2025-07-31 21:30:05 +0300 |
| commit | 12df58ad294253ac1d8df0c9bb9cf726397a671d (patch) | |
| tree | 2c41db06de937e6136bf501931826eb6bcf38867 /include/linux | |
| parent | d6084bb815c453de27af8071a23163a711586a6c (diff) | |
| download | linux-12df58ad294253ac1d8df0c9bb9cf726397a671d.tar.xz | |
bpf: Add cookie object to bpf maps
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>
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 f9cd2164ed23..308530c8326b 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -310,6 +310,7 @@ struct bpf_map { bool free_after_rcu_gp; atomic64_t sleepable_refcnt; s64 __percpu *elem_count; + u64 cookie; /* write-once */ }; static inline const char *btf_field_type_name(enum btf_field_type type) |
