From 28262b12716e24b21c5507b563f5ac085db9977a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 1 Oct 2020 11:44:19 +0200 Subject: syz-fuzzer: ignore encodingexec buffer overflow errors We started to see lots of "provided buffer is too small" with seeded syz_mount_image programs. Currently it fails whole VM, which is not good. Ignoring them is not perfect, but there does not seem to be any better simple solution. --- prog/encodingexec.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'prog/encodingexec.go') diff --git a/prog/encodingexec.go b/prog/encodingexec.go index e97ea610c..c15eb25bc 100644 --- a/prog/encodingexec.go +++ b/prog/encodingexec.go @@ -20,6 +20,7 @@ package prog import ( + "errors" "fmt" "sort" ) @@ -53,6 +54,8 @@ const ( ExecNoCopyout = ^uint64(0) ) +var ErrExecBufferTooSmall = errors.New("encodingexec: provided buffer is too small") + // SerializeForExec serializes program p for execution by process pid into the provided buffer. // Returns number of bytes written to the buffer. // If the provided buffer is too small for the program an error is returned. @@ -70,7 +73,7 @@ func (p *Prog) SerializeForExec(buffer []byte) (int, error) { } w.write(execInstrEOF) if w.eof { - return 0, fmt.Errorf("provided buffer is too small") + return 0, ErrExecBufferTooSmall } return len(buffer) - len(w.buf), nil } -- cgit mrf-deployment