From d2bde102ff975f30067203b5d039174d54a1b701 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 7 Jan 2020 07:27:38 +0100 Subject: pkg/compiler: fix another bitfield layout bug See the added test for details. --- sys/test/exec.txt | 10 ++++++++++ sys/test/gen/32_fork_shmem.go | 24 ++++++++++++++++++++---- sys/test/gen/32_shmem.go | 27 +++++++++++++++++++++------ sys/test/gen/64.go | 24 ++++++++++++++++++++---- sys/test/gen/64_fork.go | 24 ++++++++++++++++++++---- sys/test/test/bf2 | 1 + 6 files changed, 92 insertions(+), 18 deletions(-) (limited to 'sys/test') diff --git a/sys/test/exec.txt b/sys/test/exec.txt index bf96f4b68..a2fb377cf 100644 --- a/sys/test/exec.txt +++ b/sys/test/exec.txt @@ -36,6 +36,7 @@ compare_data [ bf22 syz_bf_align[syz_bf_struct22] bf23 syz_bf_align[syz_bf_struct23] bf24 syz_bf_align[syz_bf_struct24] + bf25 syz_bf_align[syz_bf_struct25] str string blob array[int8] arr16be array[int16be] @@ -187,6 +188,15 @@ syz_bf_struct24 { f1 int64:4 } [packed] +syz_bf_struct25 { + f0 int16 + f1 int16:14 + f2 int16:1 + f3 int16:1 + f4 int16 + f5 void +} [packed, align_4] + type syz_bf_align[T] { f0 int8 f1 T diff --git a/sys/test/gen/32_fork_shmem.go b/sys/test/gen/32_fork_shmem.go index 82735931c..16efe03e2 100644 --- a/sys/test/gen/32_fork_shmem.go +++ b/sys/test/gen/32_fork_shmem.go @@ -51,6 +51,7 @@ var structDescs_32_fork_shmem = []*KeyedStruct{ &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct22]"}, FldName: "bf22"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct23]"}, FldName: "bf23"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct24]"}, FldName: "bf24"}, + &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct25]"}, FldName: "bf25"}, &BufferType{TypeCommon: TypeCommon{TypeName: "string", FldName: "str", IsVarlen: true}, Kind: 2}, &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "blob", IsVarlen: true}}, &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "arr16be", IsVarlen: true}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16be", TypeSize: 2}, ArgFormat: 1}}}, @@ -127,6 +128,11 @@ var structDescs_32_fork_shmem = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &StructType{Key: StructKey{Name: "syz_bf_struct24"}, FldName: "f1"}, }}}, + {Key: StructKey{Name: "syz_bf_align[syz_bf_struct25]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct25]", TypeSize: 12}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, + &StructType{Key: StructKey{Name: "syz_bf_struct25"}, FldName: "f1"}, + }}}, {Key: StructKey{Name: "syz_bf_align[syz_bf_struct4]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct4]", TypeSize: 8}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, @@ -216,7 +222,8 @@ var structDescs_32_fork_shmem = []*KeyedStruct{ {Key: StructKey{Name: "syz_bf_struct15"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct15", TypeSize: 4}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f1", TypeSize: 1}, BitfieldOff: 8, BitfieldLen: 12, BitfieldUnit: 4, BitfieldUnitOff: 1}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f2", TypeSize: 2}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f2", TypeSize: 1}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 2}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 1}}, IsPad: true}, }}}, {Key: StructKey{Name: "syz_bf_struct16"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct16", TypeSize: 4}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, @@ -259,8 +266,8 @@ var structDescs_32_fork_shmem = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f2"}, BitfieldOff: 16, BitfieldLen: 4, BitfieldUnit: 8, BitfieldUnitOff: 2}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f3"}, BitfieldOff: 20, BitfieldLen: 4, BitfieldUnit: 4, BitfieldUnitOff: 2}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f4", TypeSize: 1}, BitfieldOff: 8, BitfieldLen: 4, BitfieldUnit: 2}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f5", TypeSize: 2}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 1}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f5", TypeSize: 1}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, }}}, {Key: StructKey{Name: "syz_bf_struct21"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct21", TypeSize: 8}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f0", TypeSize: 4}}}, @@ -282,6 +289,15 @@ var structDescs_32_fork_shmem = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f1", TypeSize: 1}, BitfieldLen: 4, BitfieldUnit: 8}}, }}}, + {Key: StructKey{Name: "syz_bf_struct25"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct25", TypeSize: 8}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f0", TypeSize: 2}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f1", TypeSize: 1}, BitfieldLen: 14, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f2"}, BitfieldOff: 6, BitfieldLen: 1, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f3", TypeSize: 1}, BitfieldOff: 7, BitfieldLen: 1, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f4", TypeSize: 2}}}, + &BufferType{TypeCommon: TypeCommon{TypeName: "void", FldName: "f5"}, Kind: 1}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true}, + }, AlignAttr: 4}}, {Key: StructKey{Name: "syz_bf_struct3"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct3", TypeSize: 8}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64be", FldName: "f0"}, ArgFormat: 1, BitfieldLen: 4, BitfieldUnit: 8}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64be", FldName: "f1"}, ArgFormat: 1, BitfieldOff: 4, BitfieldLen: 8, BitfieldUnit: 8}}, @@ -370,4 +386,4 @@ var consts_32_fork_shmem = []ConstValue{ {Name: "ONLY_32BITS_CONST", Value: 1}, } -const revision_32_fork_shmem = "fa2e7d2299408e845908f3a6602e03c0ed6433b1" +const revision_32_fork_shmem = "65b45f9333f75578cb84103da5f8f8cac77e1cb2" diff --git a/sys/test/gen/32_shmem.go b/sys/test/gen/32_shmem.go index 0fb670aaa..bd6c8c5f9 100644 --- a/sys/test/gen/32_shmem.go +++ b/sys/test/gen/32_shmem.go @@ -50,6 +50,7 @@ var structDescs_32_shmem = []*KeyedStruct{ &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct22]"}, FldName: "bf22"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct23]"}, FldName: "bf23"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct24]"}, FldName: "bf24"}, + &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct25]"}, FldName: "bf25"}, &BufferType{TypeCommon: TypeCommon{TypeName: "string", FldName: "str", IsVarlen: true}, Kind: 2}, &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "blob", IsVarlen: true}}, &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "arr16be", IsVarlen: true}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16be", TypeSize: 2}, ArgFormat: 1}}}, @@ -104,7 +105,7 @@ var structDescs_32_shmem = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 1}}, IsPad: true}, &StructType{Key: StructKey{Name: "syz_bf_struct19"}, FldName: "f1"}, }}}, - {Key: StructKey{Name: "syz_bf_align[syz_bf_struct20]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct20]", TypeSize: 12}, Fields: []Type{ + {Key: StructKey{Name: "syz_bf_align[syz_bf_struct20]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct20]", TypeSize: 8}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, &StructType{Key: StructKey{Name: "syz_bf_struct20"}, FldName: "f1"}, @@ -126,6 +127,11 @@ var structDescs_32_shmem = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &StructType{Key: StructKey{Name: "syz_bf_struct24"}, FldName: "f1"}, }}}, + {Key: StructKey{Name: "syz_bf_align[syz_bf_struct25]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct25]", TypeSize: 12}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, + &StructType{Key: StructKey{Name: "syz_bf_struct25"}, FldName: "f1"}, + }}}, {Key: StructKey{Name: "syz_bf_align[syz_bf_struct4]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct4]", TypeSize: 8}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, @@ -215,7 +221,8 @@ var structDescs_32_shmem = []*KeyedStruct{ {Key: StructKey{Name: "syz_bf_struct15"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct15", TypeSize: 4}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f1", TypeSize: 1}, BitfieldOff: 8, BitfieldLen: 12, BitfieldUnit: 4, BitfieldUnitOff: 1}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f2", TypeSize: 2}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f2", TypeSize: 1}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 2}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 1}}, IsPad: true}, }}}, {Key: StructKey{Name: "syz_bf_struct16"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct16", TypeSize: 4}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, @@ -252,14 +259,13 @@ var structDescs_32_shmem = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f3"}, BitfieldOff: 24, BitfieldLen: 20, BitfieldUnit: 8}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f4", TypeSize: 8}, BitfieldOff: 44, BitfieldLen: 16, BitfieldUnit: 8}}, }}}, - {Key: StructKey{Name: "syz_bf_struct20"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct20", TypeSize: 8}, Fields: []Type{ + {Key: StructKey{Name: "syz_bf_struct20"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct20", TypeSize: 4}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f1", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f2"}, BitfieldOff: 16, BitfieldLen: 4, BitfieldUnit: 8, BitfieldUnitOff: 2}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f3"}, BitfieldOff: 20, BitfieldLen: 4, BitfieldUnit: 4, BitfieldUnitOff: 2}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f4", TypeSize: 1}, BitfieldOff: 8, BitfieldLen: 4, BitfieldUnit: 2}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f5", TypeSize: 2}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 1}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f5", TypeSize: 1}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 1}}, }}}, {Key: StructKey{Name: "syz_bf_struct21"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct21", TypeSize: 8}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f0", TypeSize: 4}}}, @@ -281,6 +287,15 @@ var structDescs_32_shmem = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f1", TypeSize: 1}, BitfieldLen: 4, BitfieldUnit: 8}}, }}}, + {Key: StructKey{Name: "syz_bf_struct25"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct25", TypeSize: 8}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f0", TypeSize: 2}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f1", TypeSize: 1}, BitfieldLen: 14, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f2"}, BitfieldOff: 6, BitfieldLen: 1, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f3", TypeSize: 1}, BitfieldOff: 7, BitfieldLen: 1, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f4", TypeSize: 2}}}, + &BufferType{TypeCommon: TypeCommon{TypeName: "void", FldName: "f5"}, Kind: 1}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true}, + }, AlignAttr: 4}}, {Key: StructKey{Name: "syz_bf_struct3"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct3", TypeSize: 8}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64be", FldName: "f0"}, ArgFormat: 1, BitfieldLen: 4, BitfieldUnit: 8}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64be", FldName: "f1"}, ArgFormat: 1, BitfieldOff: 4, BitfieldLen: 8, BitfieldUnit: 8}}, @@ -369,4 +384,4 @@ var consts_32_shmem = []ConstValue{ {Name: "ONLY_32BITS_CONST", Value: 1}, } -const revision_32_shmem = "bfebe089857c90dd10dd5e67d52fe6357070d402" +const revision_32_shmem = "b8778b191df966880a432c9570ed01febb5fd600" diff --git a/sys/test/gen/64.go b/sys/test/gen/64.go index 07ea5580e..45e47ea47 100644 --- a/sys/test/gen/64.go +++ b/sys/test/gen/64.go @@ -97,6 +97,7 @@ var structDescs_64 = []*KeyedStruct{ &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct22]"}, FldName: "bf22"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct23]"}, FldName: "bf23"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct24]"}, FldName: "bf24"}, + &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct25]"}, FldName: "bf25"}, &BufferType{TypeCommon: TypeCommon{TypeName: "string", FldName: "str", IsVarlen: true}, Kind: 2}, &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "blob", IsVarlen: true}}, &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "arr16be", IsVarlen: true}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16be", TypeSize: 2}, ArgFormat: 1}}}, @@ -376,6 +377,11 @@ var structDescs_64 = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &StructType{Key: StructKey{Name: "syz_bf_struct24"}, FldName: "f1"}, }}}, + {Key: StructKey{Name: "syz_bf_align[syz_bf_struct25]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct25]", TypeSize: 12}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, + &StructType{Key: StructKey{Name: "syz_bf_struct25"}, FldName: "f1"}, + }}}, {Key: StructKey{Name: "syz_bf_align[syz_bf_struct4]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct4]", TypeSize: 8}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, @@ -465,7 +471,8 @@ var structDescs_64 = []*KeyedStruct{ {Key: StructKey{Name: "syz_bf_struct15"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct15", TypeSize: 4}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f1", TypeSize: 1}, BitfieldOff: 8, BitfieldLen: 12, BitfieldUnit: 4, BitfieldUnitOff: 1}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f2", TypeSize: 2}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f2", TypeSize: 1}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 2}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 1}}, IsPad: true}, }}}, {Key: StructKey{Name: "syz_bf_struct16"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct16", TypeSize: 4}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, @@ -508,8 +515,8 @@ var structDescs_64 = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f2"}, BitfieldOff: 16, BitfieldLen: 4, BitfieldUnit: 8, BitfieldUnitOff: 2}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f3"}, BitfieldOff: 20, BitfieldLen: 4, BitfieldUnit: 4, BitfieldUnitOff: 2}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f4", TypeSize: 1}, BitfieldOff: 8, BitfieldLen: 4, BitfieldUnit: 2}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f5", TypeSize: 2}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 1}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f5", TypeSize: 1}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, }}}, {Key: StructKey{Name: "syz_bf_struct21"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct21", TypeSize: 8}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f0", TypeSize: 4}}}, @@ -531,6 +538,15 @@ var structDescs_64 = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f1", TypeSize: 1}, BitfieldLen: 4, BitfieldUnit: 8}}, }}}, + {Key: StructKey{Name: "syz_bf_struct25"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct25", TypeSize: 8}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f0", TypeSize: 2}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f1", TypeSize: 1}, BitfieldLen: 14, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f2"}, BitfieldOff: 6, BitfieldLen: 1, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f3", TypeSize: 1}, BitfieldOff: 7, BitfieldLen: 1, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f4", TypeSize: 2}}}, + &BufferType{TypeCommon: TypeCommon{TypeName: "void", FldName: "f5"}, Kind: 1}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true}, + }, AlignAttr: 4}}, {Key: StructKey{Name: "syz_bf_struct3"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct3", TypeSize: 8}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64be", FldName: "f0"}, ArgFormat: 1, BitfieldLen: 4, BitfieldUnit: 8}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64be", FldName: "f1"}, ArgFormat: 1, BitfieldOff: 4, BitfieldLen: 8, BitfieldUnit: 8}}, @@ -1346,4 +1362,4 @@ var consts_64 = []ConstValue{ {Name: "SYS_unsupported"}, } -const revision_64 = "69825d8961f9b9d716935a1e9585b512ce8ef9b7" +const revision_64 = "c961c6f32ad948f6dfbd83c8dc123a55bd261814" diff --git a/sys/test/gen/64_fork.go b/sys/test/gen/64_fork.go index d09a8c03d..3593cd93b 100644 --- a/sys/test/gen/64_fork.go +++ b/sys/test/gen/64_fork.go @@ -51,6 +51,7 @@ var structDescs_64_fork = []*KeyedStruct{ &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct22]"}, FldName: "bf22"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct23]"}, FldName: "bf23"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct24]"}, FldName: "bf24"}, + &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct25]"}, FldName: "bf25"}, &BufferType{TypeCommon: TypeCommon{TypeName: "string", FldName: "str", IsVarlen: true}, Kind: 2}, &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "blob", IsVarlen: true}}, &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "arr16be", IsVarlen: true}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16be", TypeSize: 2}, ArgFormat: 1}}}, @@ -127,6 +128,11 @@ var structDescs_64_fork = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &StructType{Key: StructKey{Name: "syz_bf_struct24"}, FldName: "f1"}, }}}, + {Key: StructKey{Name: "syz_bf_align[syz_bf_struct25]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct25]", TypeSize: 12}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, + &StructType{Key: StructKey{Name: "syz_bf_struct25"}, FldName: "f1"}, + }}}, {Key: StructKey{Name: "syz_bf_align[syz_bf_struct4]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct4]", TypeSize: 8}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, @@ -216,7 +222,8 @@ var structDescs_64_fork = []*KeyedStruct{ {Key: StructKey{Name: "syz_bf_struct15"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct15", TypeSize: 4}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f1", TypeSize: 1}, BitfieldOff: 8, BitfieldLen: 12, BitfieldUnit: 4, BitfieldUnitOff: 1}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f2", TypeSize: 2}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f2", TypeSize: 1}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 2}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 1}}, IsPad: true}, }}}, {Key: StructKey{Name: "syz_bf_struct16"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct16", TypeSize: 4}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, @@ -259,8 +266,8 @@ var structDescs_64_fork = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f2"}, BitfieldOff: 16, BitfieldLen: 4, BitfieldUnit: 8, BitfieldUnitOff: 2}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f3"}, BitfieldOff: 20, BitfieldLen: 4, BitfieldUnit: 4, BitfieldUnitOff: 2}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f4", TypeSize: 1}, BitfieldOff: 8, BitfieldLen: 4, BitfieldUnit: 2}}, - &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f5", TypeSize: 2}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 1}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f5", TypeSize: 1}, BitfieldOff: 4, BitfieldLen: 4, BitfieldUnit: 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, }}}, {Key: StructKey{Name: "syz_bf_struct21"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct21", TypeSize: 8}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f0", TypeSize: 4}}}, @@ -282,6 +289,15 @@ var structDescs_64_fork = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f1", TypeSize: 1}, BitfieldLen: 4, BitfieldUnit: 8}}, }}}, + {Key: StructKey{Name: "syz_bf_struct25"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct25", TypeSize: 8}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f0", TypeSize: 2}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f1", TypeSize: 1}, BitfieldLen: 14, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f2"}, BitfieldOff: 6, BitfieldLen: 1, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f3", TypeSize: 1}, BitfieldOff: 7, BitfieldLen: 1, BitfieldUnit: 2}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f4", TypeSize: 2}}}, + &BufferType{TypeCommon: TypeCommon{TypeName: "void", FldName: "f5"}, Kind: 1}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true}, + }, AlignAttr: 4}}, {Key: StructKey{Name: "syz_bf_struct3"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct3", TypeSize: 8}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64be", FldName: "f0"}, ArgFormat: 1, BitfieldLen: 4, BitfieldUnit: 8}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64be", FldName: "f1"}, ArgFormat: 1, BitfieldOff: 4, BitfieldLen: 8, BitfieldUnit: 8}}, @@ -369,4 +385,4 @@ var consts_64_fork = []ConstValue{ {Name: "IPPROTO_UDP", Value: 17}, } -const revision_64_fork = "d2189450f29a9ea6d15197205ac9a72cb531a0a5" +const revision_64_fork = "eab9bc08c8b2f077a545740bfbb781687ba5221b" diff --git a/sys/test/test/bf2 b/sys/test/test/bf2 index 6e47fa471..5d15a10f1 100644 --- a/sys/test/test/bf2 +++ b/sys/test/test/bf2 @@ -21,3 +21,4 @@ syz_compare(&AUTO="12000000333333334567ab89", AUTO, &AUTO=@bf21={0x12, {0x333333 syz_compare(&AUTO="123465", AUTO, &AUTO=@bf22={0x12, {0x34, 0x5, 0x6}}, AUTO) syz_compare(&AUTO="12346503", AUTO, &AUTO=@bf23={0x12, {0x34, 0x5, 0x36}}, AUTO) syz_compare(&AUTO="123405", AUTO, &AUTO=@bf24={0x12, {0x34, 0x5}}, AUTO) +syz_compare(&AUTO="12000000aa00bbc0ccbb0000", AUTO, &AUTO=@bf25={0x12, {0xaa, 0xbb, 0x1, 0x1, 0xbbcc, ''}}, AUTO) -- cgit mrf-deployment