From e8dd2c6713522707b3b89884eb95601cdf9bc9be Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 30 Aug 2018 14:17:47 -0700 Subject: prog: add concept of "special pointers" Currently we only generate either valid user-space pointers or NULL. Extend NULL to a set of special pointers that we will use in programs. All targets now contain 3 special values: - NULL - 0xfffffffffffffff (invalid kernel pointer) - 0x999999999999999 (non-canonical address) Each target can add additional special pointers on top of this. Also generate NULL/special pointers for non-opt ptr's. This restriction was always too restrictive. We may want to generate them with very low probability, but we do want to generate them. Also change pointers to NULL/special during mutation (but still not in the opposite direction). --- prog/encodingexec_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'prog/encodingexec_test.go') diff --git a/prog/encodingexec_test.go b/prog/encodingexec_test.go index 94064c317..5a0e35750 100644 --- a/prog/encodingexec_test.go +++ b/prog/encodingexec_test.go @@ -403,6 +403,30 @@ func TestSerializeForExec(t *testing.T) { }, nil, }, + { + "test$excessive_fields1(0x0)", + []uint64{ + callID("test$excessive_fields1"), ExecNoCopyout, 1, execArgConst, ptrSize, 0x0, + execInstrEOF, + }, + nil, + }, + { + "test$excessive_fields1(0xffffffffffffffff)", + []uint64{ + callID("test$excessive_fields1"), ExecNoCopyout, 1, execArgConst, ptrSize, 0xffffffffffffffff, + execInstrEOF, + }, + nil, + }, + { + "test$excessive_fields1(0xfffffffffffffffe)", + []uint64{ + callID("test$excessive_fields1"), ExecNoCopyout, 1, execArgConst, ptrSize, 0x9999999999999999, + execInstrEOF, + }, + nil, + }, } buf := make([]byte, ExecBufferSize) -- cgit mrf-deployment