# A safety net for eBPF: adding KASAN support to JITed programs

DevFeed: [A safety net for eBPF: adding KASAN support to JITed programs](<https://devfeed.tech/articles/a-safety-net-for-ebpf-adding-kasan-support-to-jited-programs-93037.md>)

Original publisher: [Read original article](<https://bootlin.com/blog/a-safety-net-for-ebpf-adding-kasan-support-to-jited-programs/>)

Author: Alexis Lothoré

Published: 2026-10-21T16:53:23Z

Content type: article

Language: en

Sources: [Bootlin](<https://devfeed.tech/sources/bootlin.md>)

Topics: [eBPF](<https://devfeed.tech/topics/ebpf.md>), [Instrumentation](<https://devfeed.tech/topics/instrumentation.md>), [Memory Safety](<https://devfeed.tech/topics/memory-safety.md>), [Linux Kernel](<https://devfeed.tech/topics/linux-kernel.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>), [Fuzzing/Fuzz testing](<https://devfeed.tech/topics/fuzzing.md>)

Tags: [abi](<https://devfeed.tech/tags/abi.md>), [adoption](<https://devfeed.tech/tags/adoption.md>), [alpha-omega](<https://devfeed.tech/tags/alpha-omega.md>), [arch-linux](<https://devfeed.tech/tags/arch-linux.md>), [arm64](<https://devfeed.tech/tags/arm64.md>), [automation](<https://devfeed.tech/tags/automation.md>), [bpf-jit](<https://devfeed.tech/tags/bpf-jit.md>), [bpf-verifier](<https://devfeed.tech/tags/bpf-verifier.md>), [conference](<https://devfeed.tech/tags/conference.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [development](<https://devfeed.tech/tags/development.md>), [ebpf](<https://devfeed.tech/tags/ebpf.md>), [infrastructure](<https://devfeed.tech/tags/infrastructure.md>), [kasan](<https://devfeed.tech/tags/kasan.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [linux](<https://devfeed.tech/tags/linux.md>), [linux-kernel](<https://devfeed.tech/tags/linux-kernel.md>), [observability](<https://devfeed.tech/tags/observability.md>), [safety](<https://devfeed.tech/tags/safety.md>), [security](<https://devfeed.tech/tags/security.md>), [support](<https://devfeed.tech/tags/support.md>), [technical](<https://devfeed.tech/tags/technical.md>)

## AI overview

The feature adds generic outline KASAN checks to x86_64 eBPF JIT output, helping kernel developers catch invalid memory accesses that the verifier may miss. The JIT emits calls to the appropriate load or store check before memory operations, saving caller-saved registers around each call. Stack accesses are generally excluded because reliable detection is difficult and stack layout lacks KASAN redzones; when verifier rewrites make classification uncertain, instrumentation may still be emitted. This is a development aid with substantial overhead, not a production feature, and the work targets x86_64 rather than all BPF architectures. It has merged into bpf-next but was not yet in a public kernel release in the supplied text; Linux 7.4 was estimated as its first release. To try it, the text says to build and boot bpf-next with CONFIG_KASAN_GENERIC and CONFIG_BPF_JIT enabled, then load and execute BPF programs. No bugs had yet been caught, while syzkaller improvements were proposed to exercise BPF programs beyond verification.

## Source excerpt

The eBPF technology implemented in the Linux kernel keeps on gaining traction in various areas: infrastructure, observability, security, debugging, and many more. Its wider adoption reinforces one core concept that drives its development: it must be safe for the kernel to load an eBPF program, and so a program that cannot be proven to be ... Continue reading "A safety net for eBPF: adding KASAN support to JITed programs"