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.

BUG=b/438183726
TEST=presubmit
RELEASE_NOTE=None

cos-patch: security-high
Change-Id: I0b763c1424809f899311f39dd72d41865ba96254
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/109207
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Main-Branch-Verified: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Reviewed-by: Miri Amarilio <mirilio@google.com>
2 files changed