Skip to main content

attach_kernel_page_discard

Function attach_kernel_page_discard 

Source
pub fn attach_kernel_page_discard(
    pattern: &[u8],
    target_socket: RawFd,
) -> Result<(), AttachError>
Expand description

Compiles and loads an active Kernel-Space Page Discard filter.

Converts the target substring constraint (e.g. b"password") immediately into an unrolled architecture-agnostic BPF socket filter, bypassing clang entirely, and returning an active FDA waiting to be snapped onto an io_uring mapped raw socket.

ยงErrors

Returns AttachError::Compile when the literal cannot be compiled into a verifier-safe eBPF program, or AttachError::Io when the generated filter cannot be loaded or attached to target_socket.