summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2025-07-31 02:47:30 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-09 19:56:18 +0300
commit3eeefeb9d62d3f35871eb74810a526b89652dadf (patch)
tree5138d1ad9ecf0075b6a8f9934312831cb7d198e9 /include/linux
parent355bd0b51d2fc0a2c9d0789c77269e4476637428 (diff)
downloadlinux-3eeefeb9d62d3f35871eb74810a526b89652dadf.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.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 17de12a98f85..0a097087f0a7 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -300,6 +300,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)