From 1172db0ccf077bbfef7ddd176ced61c7140cb698 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Tue, 1 Aug 2017 18:30:20 +0200 Subject: prog: fix encoding for exec of result args ResultArg might have const value. Also add a test. --- sys/sys_amd64.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sys/sys_amd64.go') diff --git a/sys/sys_amd64.go b/sys/sys_amd64.go index 8ae510019..7c45588f9 100644 --- a/sys/sys_amd64.go +++ b/sys/sys_amd64.go @@ -85,6 +85,7 @@ var resourceArray = []*ResourceDesc{ &ResourceDesc{Name: "sock_udp", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "resource-type", ArgDir: DirInOut, IsOptional: false}, TypeSize: 4, BigEndian: false, BitfieldLen: 0}}, Kind: []string{"fd", "sock", "sock_in", "sock_udp"}, Values: []uintptr{0xffffffffffffffff, 18446744073709551516}}, &ResourceDesc{Name: "sock_udp6", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "resource-type", ArgDir: DirInOut, IsOptional: false}, TypeSize: 4, BigEndian: false, BitfieldLen: 0}}, Kind: []string{"fd", "sock", "sock_in6", "sock_udp6"}, Values: []uintptr{0xffffffffffffffff, 18446744073709551516}}, &ResourceDesc{Name: "sock_unix", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "resource-type", ArgDir: DirInOut, IsOptional: false}, TypeSize: 4, BigEndian: false, BitfieldLen: 0}}, Kind: []string{"fd", "sock", "sock_unix"}, Values: []uintptr{0xffffffffffffffff, 18446744073709551516}}, + &ResourceDesc{Name: "syz_res", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "resource-type", ArgDir: DirInOut, IsOptional: false}, TypeSize: 4, BigEndian: false, BitfieldLen: 0}}, Kind: []string{"syz_res"}, Values: []uintptr{0xffff}}, &ResourceDesc{Name: "tcp_seq_num", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "resource-type", ArgDir: DirInOut, IsOptional: false}, TypeSize: 4, BigEndian: false, BitfieldLen: 0}}, Kind: []string{"tcp_seq_num"}, Values: []uintptr{0x42424242}}, &ResourceDesc{Name: "te_session_id", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "resource-type", ArgDir: DirInOut, IsOptional: false}, TypeSize: 4, BigEndian: false, BitfieldLen: 0}}, Kind: []string{"te_session_id"}, Values: []uintptr{0}}, &ResourceDesc{Name: "time_nsec", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "resource-type", ArgDir: DirInOut, IsOptional: false}, TypeSize: 8, BigEndian: false, BitfieldLen: 0}}, Kind: []string{"time_nsec"}, Values: []uintptr{0}}, @@ -22936,6 +22937,8 @@ var Calls = []*Call{ &Call{Name: "syz_test$recur1", CallName: "syz_test", Native: false, Args: []Type{&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a0", ArgDir: DirIn, IsOptional: false}, Type: getStruct(structKey{"syz_recur_1", "", DirInOut})}}, NR: 1000001}, &Call{Name: "syz_test$recur2", CallName: "syz_test", Native: false, Args: []Type{&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a0", ArgDir: DirIn, IsOptional: false}, Type: getStruct(structKey{"syz_recur_2", "", DirInOut})}}, NR: 1000001}, &Call{Name: "syz_test$regression0", CallName: "syz_test", Native: false, Args: []Type{&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a0", ArgDir: DirIn, IsOptional: false}, Type: getStruct(structKey{"syz_regression0_struct", "", DirInOut})}}, NR: 1000001}, + &Call{Name: "syz_test$res0", CallName: "syz_test", Native: false, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "syz_res", FldName: "ret", ArgDir: DirOut, IsOptional: false}, Desc: resource("syz_res")}, Args: []Type{}, NR: 1000001}, + &Call{Name: "syz_test$res1", CallName: "syz_test", Native: false, Args: []Type{&ResourceType{TypeCommon: TypeCommon{TypeName: "syz_res", FldName: "a0", ArgDir: DirIn, IsOptional: false}, Desc: resource("syz_res")}}, NR: 1000001}, &Call{Name: "syz_test$struct", CallName: "syz_test", Native: false, Args: []Type{&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a0", ArgDir: DirIn, IsOptional: false}, Type: getStruct(structKey{"syz_struct0", "", DirIn})}}, NR: 1000001}, &Call{Name: "syz_test$text_x86_16", CallName: "syz_test", Native: false, Args: []Type{&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a0", ArgDir: DirIn, IsOptional: false}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "text", FldName: "", ArgDir: DirIn, IsOptional: false}, Kind: BufferText, Text: Text_x86_16}}, &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "a1", ArgDir: DirIn, IsOptional: false}, TypeSize: 8, BigEndian: false, BitfieldLen: 0}, Buf: "a0", ByteSize: 0}}, NR: 1000001}, &Call{Name: "syz_test$text_x86_32", CallName: "syz_test", Native: false, Args: []Type{&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a0", ArgDir: DirIn, IsOptional: false}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "text", FldName: "", ArgDir: DirIn, IsOptional: false}, Kind: BufferText, Text: Text_x86_32}}, &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "a1", ArgDir: DirIn, IsOptional: false}, TypeSize: 8, BigEndian: false, BitfieldLen: 0}, Buf: "a0", ByteSize: 0}}, NR: 1000001}, -- cgit mrf-deployment