SEC("fmod_ret/security_bpf_map") int BPF_PROG(fmod_bpf_map, struct bpf_map *map, int fmode)
{
__u32 key = 0;
__u32 *status_ptr = bpf_map_lookup_elem(&prot_status_map, &key);
if (!status_ptr || !*status_ptr) return 0;
if (map == &prot_map) { /* Allow read-only access */ if (fmode & FMODE_WRITE) return -EPERM;
}
return 0;
}
/* * This program keeps references to maps. This is needed to prevent * optimizing them out.
*/
SEC("fentry/bpf_fentry_test1") int BPF_PROG(fentry_dummy1, int a)
{
__u32 key = 0;
__u32 val1 = a;
__u32 val2 = a + 1;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.