Skip to content

Helper function bpf_find_vma

v5.17

Definition

Copyright (c) 2015 The Libbpf Authors. All rights reserved.

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 (* const bpf_find_vma)(struct task_struct *task, __u64 addr, void *callback_fn, void *callback_ctx, __u64 flags) = (void *) 180;

Usage

Docs could be improved

This part of the docs is incomplete, contributions are very welcome

Program types

This helper call can be used in the following program types:

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome