You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
urunc parses its system configuration file (/etc/urunc/urunc.json or custom path) via LoadUruncConfig() and UruncConfig.Validate() in pkg/unikontainers/urunc_config.go.
Currently:
urunc_config_test.go contains static unit tests for valid JSON formats, but does not systematically test malformed JSON structures, invalid base64 string paths, or out-of-range memory/vCPU integers.
The repository lacks automated Go native fuzzing (go test -fuzz) to detect unexpected panics or unhandled errors when processing arbitrary configuration payloads (aligning with Add fuzzing and robustness testing #852).
Expected Behavior
pkg/unikontainers should include a native Go fuzzing target FuzzLoadUruncConfig(f *testing.F) that generates random byte payloads to fuzz JSON decoding and validation.
Validated configurations should guarantee clean error returns without triggering nil-pointer panics or slice bounds errors on Validate().
Proposed Changes
Expose a memory-slice helper ParseUruncConfigBytes(data []byte) (*UruncConfig, error) in pkg/unikontainers/urunc_config.go.
Implement FuzzLoadUruncConfig(f *testing.F) in pkg/unikontainers/urunc_config_test.go with initial seed corpuses for valid JSON structures.
Verify invariant execution using go test -v -fuzz=FuzzLoadUruncConfig -fuzztime=30s ./pkg/unikontainers.
Summary
uruncparses its system configuration file (/etc/urunc/urunc.jsonor custom path) viaLoadUruncConfig()andUruncConfig.Validate()inpkg/unikontainers/urunc_config.go.Currently:
urunc_config_test.gocontains static unit tests for valid JSON formats, but does not systematically test malformed JSON structures, invalid base64 string paths, or out-of-range memory/vCPU integers.go test -fuzz) to detect unexpected panics or unhandled errors when processing arbitrary configuration payloads (aligning with Add fuzzing and robustness testing #852).Expected Behavior
pkg/unikontainersshould include a native Go fuzzing targetFuzzLoadUruncConfig(f *testing.F)that generates random byte payloads to fuzz JSON decoding and validation.Validate().Proposed Changes
ParseUruncConfigBytes(data []byte) (*UruncConfig, error)inpkg/unikontainers/urunc_config.go.FuzzLoadUruncConfig(f *testing.F)inpkg/unikontainers/urunc_config_test.gowith initial seed corpuses for valid JSON structures.go test -v -fuzz=FuzzLoadUruncConfig -fuzztime=30s ./pkg/unikontainers.