summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2025-07-31 01:47:30 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-09 18:58:01 +0200
commit963e79f6bdac506023d35b3c14a2d8c15348a381 (patch)
treec6d67b65aeed10e41a0703cf1c1b7dbd65832682 /include/linux
parentb0c51e95f54e5f4e13a7ada6629125b0bc427a96 (diff)
downloadlinux-963e79f6bdac506023d35b3c14a2d8c15348a381.tar.gz
linux-963e79f6bdac506023d35b3c14a2d8c15348a381.tar.bz2
linux-963e79f6bdac506023d35b3c14a2d8c15348a381.zip
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 1150a595aa54..fcf48bd74600 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -306,6 +306,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)