aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2025-02-07 13:51:20 +0100
committerTaras Madan <tarasmadan@google.com>2025-02-07 15:24:58 +0000
commitef44b750e8fab8d6d5cb84920680581b13e0d470 (patch)
tree66f14e7068bddf4859f473d2c6cbdce4b7404926 /pkg
parentcd3f2c0f937456cc2abfe12b914e4e1f20963867 (diff)
all: fix recvcheck errors
Diffstat (limited to 'pkg')
-rw-r--r--pkg/corpus/corpus_test.go4
-rw-r--r--pkg/cover/cover.go6
-rw-r--r--pkg/fuzzer/queue/queue.go9
-rw-r--r--pkg/ifuzz/powerpc/powerpc.go8
-rw-r--r--pkg/signal/signal.go20
5 files changed, 11 insertions, 36 deletions
diff --git a/pkg/corpus/corpus_test.go b/pkg/corpus/corpus_test.go
index c4410503e..7efa386ae 100644
--- a/pkg/corpus/corpus_test.go
+++ b/pkg/corpus/corpus_test.go
@@ -48,8 +48,8 @@ func TestCorpusOperation(t *testing.T) {
}
// Verify the total signal.
- assert.Equal(t, corpus.StatSignal.Val(), 5)
- assert.Equal(t, corpus.StatProgs.Val(), 2)
+ assert.Equal(t, 5, corpus.StatSignal.Val())
+ assert.Equal(t, 2, corpus.StatProgs.Val())
corpus.Minimize(true)
}
diff --git a/pkg/cover/cover.go b/pkg/cover/cover.go
index caef2a09c..13bba2347 100644
--- a/pkg/cover/cover.go
+++ b/pkg/cover/cover.go
@@ -42,9 +42,9 @@ func (cov *Cover) MergeDiff(raw []uint64) []uint64 {
return raw[:n]
}
-func (cov Cover) Serialize() []uint64 {
- res := make([]uint64, 0, len(cov))
- for pc := range cov {
+func (cov *Cover) Serialize() []uint64 {
+ res := make([]uint64, 0, len(*cov))
+ for pc := range *cov {
res = append(res, pc)
}
return res
diff --git a/pkg/fuzzer/queue/queue.go b/pkg/fuzzer/queue/queue.go
index 1b98d768e..37e69837f 100644
--- a/pkg/fuzzer/queue/queue.go
+++ b/pkg/fuzzer/queue/queue.go
@@ -16,7 +16,6 @@ import (
"github.com/google/syzkaller/pkg/flatrpc"
"github.com/google/syzkaller/pkg/hash"
- "github.com/google/syzkaller/pkg/signal"
"github.com/google/syzkaller/pkg/stat"
"github.com/google/syzkaller/prog"
)
@@ -32,11 +31,6 @@ type Request struct {
BinaryFile string // for RequestTypeBinary
GlobPattern string // for RequestTypeGlob
- // If specified, the resulting signal for call SignalFilterCall
- // will include subset of it even if it's not new.
- SignalFilter signal.Signal
- SignalFilterCall int
-
// Return all signal for these calls instead of new signal.
ReturnAllSignal []int
ReturnError bool
@@ -123,9 +117,6 @@ func (r *Request) Validate() error {
if len(r.ReturnAllSignal) != 0 && !collectSignal {
return fmt.Errorf("ReturnAllSignal is set, but FlagCollectSignal is not")
}
- if r.SignalFilter != nil && !collectSignal {
- return fmt.Errorf("SignalFilter must be used with FlagCollectSignal")
- }
collectComps := r.ExecOpts.ExecFlags&flatrpc.ExecFlagCollectComps > 0
collectCover := r.ExecOpts.ExecFlags&flatrpc.ExecFlagCollectCover > 0
if (collectComps) && (collectSignal || collectCover) {
diff --git a/pkg/ifuzz/powerpc/powerpc.go b/pkg/ifuzz/powerpc/powerpc.go
index 9cef453f4..7b06f2b25 100644
--- a/pkg/ifuzz/powerpc/powerpc.go
+++ b/pkg/ifuzz/powerpc/powerpc.go
@@ -61,7 +61,7 @@ const (
prefixOpcode = uint32(1) << prefixShift
)
-func (insn Insn) isPrefixed() bool {
+func (insn *Insn) isPrefixed() bool {
return insn.Opcode&prefixMask == prefixOpcode
}
@@ -119,7 +119,7 @@ func encodeBits(n uint, ff []InsnBits) uint32 {
return ret
}
-func (insn Insn) Encode(cfg *iset.Config, r *rand.Rand) []byte {
+func (insn *Insn) Encode(cfg *iset.Config, r *rand.Rand) []byte {
if insn.Pseudo {
return insn.generator(cfg, r)
}
@@ -132,7 +132,7 @@ func (insn Insn) Encode(cfg *iset.Config, r *rand.Rand) []byte {
return ret
}
-func (insn Insn) encodeOpcode(cfg *iset.Config, r *rand.Rand, opcode, mask uint32, f []InsnField) []byte {
+func (insn *Insn) encodeOpcode(cfg *iset.Config, r *rand.Rand, opcode, mask uint32, f []InsnField) []byte {
ret := make([]byte, 0)
insn32 := opcode
if len(cfg.MemRegions) != 0 {
@@ -179,7 +179,7 @@ func (insn *Insn) Info() (string, iset.Mode, bool, bool) {
return insn.Name, insn.mode(), insn.Pseudo, insn.Priv
}
-func (insn Insn) mode() iset.Mode {
+func (insn *Insn) mode() iset.Mode {
return (1 << iset.ModeLong64) | (1 << iset.ModeProt32)
}
diff --git a/pkg/signal/signal.go b/pkg/signal/signal.go
index b63811fe5..506d65aac 100644
--- a/pkg/signal/signal.go
+++ b/pkg/signal/signal.go
@@ -9,7 +9,8 @@ type (
prioType int8
)
-type Signal map[elemType]prioType
+// Signal was hard to refactor when we enabled recvcheck.
+type Signal map[elemType]prioType // nolint: recvcheck
func (s Signal) Len() int {
return len(s)
@@ -38,23 +39,6 @@ func FromRaw(raw []uint64, prio uint8) Signal {
return s
}
-func (s Signal) Diff(s1 Signal) Signal {
- if s1.Empty() {
- return nil
- }
- var res Signal
- for e, p1 := range s1 {
- if p, ok := s[e]; ok && p >= p1 {
- continue
- }
- if res == nil {
- res = make(Signal)
- }
- res[e] = p1
- }
- return res
-}
-
func (s Signal) DiffRaw(raw []uint64, prio uint8) Signal {
var res Signal
for _, e := range raw {