1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2020 Facebook */
4 #include <bpf/bpf_helpers.h>
5 #include <bpf/bpf_tracing.h>
7 char _license
[] SEC("license") = "GPL";
16 __uint(type
, BPF_MAP_TYPE_HASH
);
17 __uint(max_entries
, 3);
18 __type(key
, struct key_t
);
20 } hashmap1
SEC(".maps");
24 SEC("iter/bpf_map_elem")
25 int dump_bpf_hash_map(struct bpf_iter__bpf_map_elem
*ctx
)
32 /* out of bound access w.r.t. hashmap1 */
33 key_sum
+= *(__u32
*)(key
+ sizeof(struct key_t
));