sharedobjs

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSOSymbols

func NewSOSymbols() dynamicSymbols

Types

type ContainersSymbolsLoader

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

ContainersSymbolsLoader is a decorator for SO loaders that resolves containers-relative paths to absolute host paths. This object operation requires the CAP_DAC_OVERRIDE to access files across the system.

func InitContainersSymbolsLoader

func InitContainersSymbolsLoader(pathResolver *containers.ContainerPathResolver, cacheSize int) *ContainersSymbolsLoader

func (*ContainersSymbolsLoader) GetDynamicSymbols

func (cLoader *ContainersSymbolsLoader) GetDynamicSymbols(soInfo ObjInfo) (map[string]bool, error)

func (*ContainersSymbolsLoader) GetExportedSymbols

func (cLoader *ContainersSymbolsLoader) GetExportedSymbols(soInfo ObjInfo) (map[string]bool, error)

func (*ContainersSymbolsLoader) GetImportedSymbols

func (cLoader *ContainersSymbolsLoader) GetImportedSymbols(soInfo ObjInfo) (map[string]bool, error)

type DynamicSymbolsLoader

type DynamicSymbolsLoader interface {
	GetDynamicSymbols(info ObjInfo) (map[string]bool, error)
	GetExportedSymbols(info ObjInfo) (map[string]bool, error)
	GetImportedSymbols(info ObjInfo) (map[string]bool, error)
}

type HostSymbolsLoader

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

HostSymbolsLoader is responsible for efficient reading of shared object's symbols. The logic of the loader here is used on absolute paths, so container relative paths won't work here. This object operation requires the CAP_DAC_OVERRIDE to access files across the system.

func InitHostSymbolsLoader

func InitHostSymbolsLoader(cacheSize int) *HostSymbolsLoader

func (*HostSymbolsLoader) GetDynamicSymbols

func (soLoader *HostSymbolsLoader) GetDynamicSymbols(soInfo ObjInfo) (map[string]bool, error)

GetDynamicSymbols try to get shared objects dynamic symbols from lru, and if fails read needed information from ELF file.

func (*HostSymbolsLoader) GetExportedSymbols

func (soLoader *HostSymbolsLoader) GetExportedSymbols(soInfo ObjInfo) (map[string]bool, error)

GetExportedSymbols try to get shared objects exported symbols from lru, and if fails read needed information from ELF file. The returned map is part of a cache, so if the user wants to modify it he should copy it and modify it there.

func (*HostSymbolsLoader) GetImportedSymbols

func (soLoader *HostSymbolsLoader) GetImportedSymbols(soInfo ObjInfo) (map[string]bool, error)

GetImportedSymbols try to get shared objects imported symbols from lru, and if fails read needed information from ELF file. The returned map is part of a cache, so if the user wants to modify it he should copy it and modify it there.

type ObjID

type ObjID struct {
	Inode  uint64
	Device uint32
	Ctime  uint64
}

ObjID is the unique identification of a SO in the system

type ObjInfo

type ObjInfo struct {
	Id      ObjID
	Path    string
	MountNS int
}

ObjInfo is the information of an SO needed to examine it

Jump to

Keyboard shortcuts

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