kfilefields

package
v0.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package kfilefields provides functions to read kernel "struct file" fields against a file descriptor.

This is done:

  • without using bpf iterators in order to work on old kernels.
  • without comparing pids from userspace and ebpf in order to work from different pid namespaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFOpForFdType

func ReadFOpForFdType(ft FdType) (uint64, error)

ReadFOpForFdType uses ebpf to read the f_op pointer from the kernel "struct file" associated with the given fd type.

func ReadPrivateDataFromFd

func ReadPrivateDataFromFd(fd int) (uint64, error)

ReadPrivateDataFromFd uses ebpf to read the private_data pointer from the kernel "struct file" associated with the given fd.

Types

type FdType

type FdType int
const (
	FdTypeSocket FdType = iota
	FdTypeEbpfProgram
)

func (FdType) String

func (fd FdType) String() string

type Tracer

type Tracer struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL