From ba64d006de17a5bfa0c99e4b96711ba42f82e199 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 9 Dec 2018 18:05:58 +0100 Subject: prog: implement strict parsing mode Add bulk of checks for strict parsing mode. Probably not complete, but we can extend then in future as needed. Turns out we can't easily use it for serialized programs as they omit default args and during deserialization it looks like missing args. --- sys/linux/init_test.go | 4 ++-- sys/test/test/align0 | 4 ++-- sys/test/test/test | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'sys') diff --git a/sys/linux/init_test.go b/sys/linux/init_test.go index 9f59be16c..104d3c068 100644 --- a/sys/linux/init_test.go +++ b/sys/linux/init_test.go @@ -39,11 +39,11 @@ func TestSanitize(t *testing.T) { `ptrace(0xffffffffffffffff, 0x0)`, }, { - `ptrace$peek(0x0)`, + `ptrace$peek(0x0, 0x0, &(0x7f0000000000))`, `ptrace$peek(0xffffffffffffffff, 0x0, &(0x7f0000000000))`, }, { - `ptrace(0x1)`, + `ptrace(0x1, 0x0)`, `ptrace(0x1, 0x0)`, }, { diff --git a/sys/test/test/align0 b/sys/test/test/align0 index ae83c3c84..e2e5b9275 100644 --- a/sys/test/test/align0 +++ b/sys/test/test/align0 @@ -1,3 +1,3 @@ syz_compare(&(0x7f0000000000)="010000000200000003000400000000000500000000000000", 0x18, &(0x7f0000001000)=@align0={0x1, 0x2, 0x3, 0x4, 0x5}, 0x18) -syz_compare(&(0x7f0000000000)="", 0x18, &(0x7f0000001000)=@align0={}, 0x17) # EBADF -syz_compare(&(0x7f0000000000)="", 0x18, &(0x7f0000001000)=@align0={0x1}, 0x18) # EINVAL +syz_compare(&(0x7f0000000000)="", 0x18, &(0x7f0000001000)=@align0={0x0, 0x0, 0x0, 0x0, 0x0}, 0x17) # EBADF +syz_compare(&(0x7f0000000000)="", 0x18, &(0x7f0000001000)=@align0={0x1, 0x0, 0x0, 0x0, 0x0}, 0x18) # EINVAL diff --git a/sys/test/test/test b/sys/test/test/test index 1803a6108..8715e198d 100644 --- a/sys/test/test/test +++ b/sys/test/test/test @@ -1 +1 @@ -syz_mmap() # EINVAL +syz_mmap(0x0, 0x0) # EINVAL -- cgit mrf-deployment