fuzzing

package
v0.312.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCorpusForFuzzParseExpr

func GetCorpusForFuzzParseExpr() ([]string, error)

GetCorpusForFuzzParseExpr returns the seed corpus for FuzzParseExpr.

func GetCorpusForFuzzParseMetricSelector

func GetCorpusForFuzzParseMetricSelector() []string

GetCorpusForFuzzParseMetricSelector returns the seed corpus for FuzzParseMetricSelector.

func GetCorpusForFuzzParseMetricText

func GetCorpusForFuzzParseMetricText() [][]byte

GetCorpusForFuzzParseMetricText returns the seed corpus for FuzzParseMetricText.

func GetCorpusForFuzzParseOpenMetric

func GetCorpusForFuzzParseOpenMetric() [][]byte

GetCorpusForFuzzParseOpenMetric returns the seed corpus for FuzzParseOpenMetric.

func GetDictForFuzzParseExpr added in v0.312.0

func GetDictForFuzzParseExpr() []string

GetDictForFuzzParseExpr returns the libFuzzer dictionary tokens for FuzzParseExpr. Tokens are derived from the exported PromQL keyword list, function names, and operator symbols so that the dictionary stays in sync with the grammar automatically.

Types

type ChunkFuzzSeed added in v0.311.0

type ChunkFuzzSeed struct {
	// Seed is the RNG seed used to generate sample timestamps and values.
	Seed int64
	// N drives the sample count: count = int(N)%120 + 1.
	N uint8
	// NaNMask forces StaleNaN on specific samples: bit i set means sample i
	// uses StaleNaN instead of a random value.
	NaNMask uint64
}

ChunkFuzzSeed is a seed corpus entry for FuzzXORChunk.

func GetCorpusForFuzzXORChunk added in v0.311.0

func GetCorpusForFuzzXORChunk() []ChunkFuzzSeed

GetCorpusForFuzzXORChunk returns the seed corpus for FuzzXORChunk.

type ProtobufCorpusSeed added in v0.312.0

type ProtobufCorpusSeed struct {
	Data         []byte
	IgnoreNative bool
	ParseClassic bool
	ConvertNHCB  bool
	TypeAndUnit  bool
}

ProtobufCorpusSeed is a single seed entry for FuzzParseProtobuf, pairing a binary payload with a specific set of parser options.

func GetCorpusForFuzzParseProtobuf added in v0.312.0

func GetCorpusForFuzzParseProtobuf() ([]ProtobufCorpusSeed, error)

GetCorpusForFuzzParseProtobuf returns the seed corpus for FuzzParseProtobuf. Each entry pairs a length-prefixed binary protobuf payload in the Prometheus protobuf exposition format (uvarint-length followed by a marshaled MetricFamily message) with a specific combination of parser options. The corpus covers all metric types and their variants, multi-metric and multi-family payloads, edge cases in valid data, structurally corrupt inputs, and key combinations of parser boolean options that gate distinct code paths (ignoreNative, parseClassic, convertNHCB, typeAndUnit).

type XOR2ChunkFuzzSeed added in v0.311.0

type XOR2ChunkFuzzSeed struct {
	// Seed is the RNG seed used to generate sample timestamps and values.
	Seed int64
	// N drives the sample count: count = int(N)%120 + 1.
	N uint8
	// NaNMask forces StaleNaN on specific samples: bit i set means sample i
	// uses StaleNaN instead of a random value.
	NaNMask uint64
	// STMode selects the start-timestamp pattern used by the fuzzer.
	STMode uint8
}

XOR2ChunkFuzzSeed is a seed corpus entry for FuzzXOR2Chunk.

func GetCorpusForFuzzXOR2Chunk added in v0.311.0

func GetCorpusForFuzzXOR2Chunk() []XOR2ChunkFuzzSeed

GetCorpusForFuzzXOR2Chunk returns the seed corpus for FuzzXOR2Chunk.

Jump to

Keyboard shortcuts

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