From 90fd6503136121e9494761a460898e83bc0b6b3e Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 18 Feb 2018 16:38:45 +0100 Subject: prog: fix PhysicalAddr for NULL addresses Turns out we never produced NULL pointers because what's meant to be NULL pointer was actually encoded as pointer to beginning of the data region. --- prog/encodingexec_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'prog/encodingexec_test.go') diff --git a/prog/encodingexec_test.go b/prog/encodingexec_test.go index 06265fa76..92c36cad4 100644 --- a/prog/encodingexec_test.go +++ b/prog/encodingexec_test.go @@ -381,6 +381,15 @@ func TestSerializeForExec(t *testing.T) { }, nil, }, + { + // NULL pointer must be encoded os 0. + "syz_test$opt1(0x0)", + []uint64{ + callID("syz_test$opt1"), ExecNoCopyout, 1, execArgConst, 8, 0, + execInstrEOF, + }, + nil, + }, } buf := make([]byte, ExecBufferSize) -- cgit mrf-deployment