From bc66d28b68648180b15aeba527b9191a34ef9e78 Mon Sep 17 00:00:00 2001 From: Andrii Nakryiko Date: Thu, 11 Nov 2021 22:45:13 -0800 Subject: [PATCH] sync: auto-generate latest BPF helpers Latest changes to BPF helper definitions. --- src/bpf_helper_defs.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/bpf_helper_defs.h b/src/bpf_helper_defs.h index 91063c9..0078d1d 100644 --- a/src/bpf_helper_defs.h +++ b/src/bpf_helper_defs.h @@ -4113,4 +4113,27 @@ static struct unix_sock *(*bpf_skc_to_unix_sock)(void *sk) = (void *) 178; */ static long (*bpf_kallsyms_lookup_name)(const char *name, int name_sz, int flags, __u64 *res) = (void *) 179; +/* + * bpf_find_vma + * + * Find vma of *task* that contains *addr*, call *callback_fn* + * function with *task*, *vma*, and *callback_ctx*. + * The *callback_fn* should be a static function and + * the *callback_ctx* should be a pointer to the stack. + * The *flags* is used to control certain aspects of the helper. + * Currently, the *flags* must be 0. + * + * The expected callback signature is + * + * long (\*callback_fn)(struct task_struct \*task, struct vm_area_struct \*vma, void \*callback_ctx); + * + * + * Returns + * 0 on success. + * **-ENOENT** if *task->mm* is NULL, or no vma contains *addr*. + * **-EBUSY** if failed to try lock mmap_lock. + * **-EINVAL** for invalid **flags**. + */ +static long (*bpf_find_vma)(struct task_struct *task, __u64 addr, void *callback_fn, void *callback_ctx, __u64 flags) = (void *) 180; +