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. --- sys/test/any.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/test/any.txt b/sys/test/any.txt index 060992c3f..5e0b0367a 100644 --- a/sys/test/any.txt +++ b/sys/test/any.txt @@ -1,10 +1,11 @@ # Copyright 2018 syzkaller project authors. All rights reserved. # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +resource anyres8[int8] resource anyres32[int32] resource anyres64[int64] -foo$anyres(a0 ptr[out, anyres32], a1 ptr[out, anyres64]) +foo$anyres(a0 ptr[out, anyres8], a1 ptr[out, anyres32], a2 ptr[out, anyres64]) foo$any0(a ptr[in, any0]) @@ -24,6 +25,7 @@ any1 { } [packed, align[2]] anyunion0 [ + res8 anyres8 res32 anyres32 res64 anyres64 ] -- cgit mrf-deployment