From b9406563d876e5550ab7e93cd0d559758b8352ca Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 20 Jun 2022 14:05:59 +0200 Subject: prog: support int8 resources in any squashing We've got the following panic: --- FAIL: TestMutateRandom (7.77s) export_test.go:37: seed=1655724857302243235 --- FAIL: TestMutateRandom/test/32_shmem (0.00s) panic: bad size [recovered] panic: bad size goroutine 562 [running]: panic({0x5ea5a0, 0x8dade8}) /usr/local/go/src/runtime/panic.go:1038 +0x215 github.com/google/syzkaller/prog.(*Target).squashResult(0xc0002a9ba0, 0xc026faa7b0, 0xc026ad1bc8) /syzkaller/gopath/src/github.com/google/syzkaller/prog/any.go:236 +0x2d1 This happens because we try to squash resource of size 1. While we still don't have such resources in real descriptions, we've got one in test descriptions (added in out_overlay change). Support int8 resources in squashing procedure. --- pkg/compiler/types.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'pkg') diff --git a/pkg/compiler/types.go b/pkg/compiler/types.go index fc4acfee3..9e75de18d 100644 --- a/pkg/compiler/types.go +++ b/pkg/compiler/types.go @@ -1074,6 +1074,7 @@ type optional[T] [ # prog/any.go knows layout of these types. ANYUNION [ ANYBLOB array[int8] + ANYRES8 ANYRES8 ANYRES16 ANYRES16 ANYRES32 ANYRES32 ANYRES64 ANYRES64 @@ -1087,15 +1088,17 @@ ANYPTRS [ ANYPTR64 ptr64[in, array[ANYUNION]] ] +resource ANYRES8[int8]: -1, 0 resource ANYRES16[int16]: -1, 0 resource ANYRES32[int32]: -1, 0 resource ANYRES64[int64]: -1, 0 syz_builtin0(a ptr[in, ANYPTRS]) (disabled) syz_builtin1(a ptr[out, ANYUNION]) (disabled) -syz_builtin2() ANYRES16 (disabled) -syz_builtin3() ANYRES32 (disabled) -syz_builtin4() ANYRES64 (disabled) +syz_builtin2() ANYRES8 (disabled) +syz_builtin3() ANYRES16 (disabled) +syz_builtin4() ANYRES32 (disabled) +syz_builtin5() ANYRES64 (disabled) ` func init() { -- cgit mrf-deployment