Skip to content

KFunc __bpf_trap

v6.16

Pseudo-kfunc to trigger a verifier error on purpose.

Definition

Signature

void __bpf_trap()

Usage

This is a fake / pseudo kfunc. Its purpose is to allow compilers such as clang to emit a call to this kfunc for code that is supposed to be unreachable. If a given code branch is supposed to be unreachable, yet the verifier can find a way to reach the kfunc, the verifier will throw a verifier error.

Program types

The following program types can make use of this kfunc:

Example

Docs could be improved

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