From e30cbdae48129d22c125435cb72fc20447c7a0e2 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 19 Dec 2019 20:00:44 +0100 Subject: sys/test: and another bitfield test Just trying to get my head around it (and fix this in tests). Update #1542 --- sys/test/gen/32_fork_shmem.go | 14 +++++++++++++- sys/test/gen/32_shmem.go | 14 +++++++++++++- sys/test/gen/64.go | 14 +++++++++++++- sys/test/gen/64_fork.go | 14 +++++++++++++- 4 files changed, 52 insertions(+), 4 deletions(-) (limited to 'sys/test/gen') diff --git a/sys/test/gen/32_fork_shmem.go b/sys/test/gen/32_fork_shmem.go index 40d41b49a..dc9e1d20d 100644 --- a/sys/test/gen/32_fork_shmem.go +++ b/sys/test/gen/32_fork_shmem.go @@ -39,6 +39,7 @@ var structDescs_32_fork_shmem = []*KeyedStruct{ &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct10]"}, FldName: "bf10"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct11]"}, FldName: "bf11"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct12]"}, FldName: "bf12"}, + &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct13]"}, FldName: "bf13"}, &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}}}, @@ -58,6 +59,11 @@ var structDescs_32_fork_shmem = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, &StructType{Key: StructKey{Name: "syz_bf_struct12"}, FldName: "f1"}, }}}, + {Key: StructKey{Name: "syz_bf_align[syz_bf_struct13]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct13]", 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_struct13"}, FldName: "f1"}, + }}}, {Key: StructKey{Name: "syz_bf_align[syz_bf_struct4]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct4]", TypeSize: 16}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, @@ -138,6 +144,12 @@ var structDescs_32_fork_shmem = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f6", TypeSize: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, }}}, + {Key: StructKey{Name: "syz_bf_struct13"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct13", TypeSize: 8}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f0", TypeSize: 2}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f1"}, BitfieldLen: 12, BitfieldUnit: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f2", TypeSize: 4}, BitfieldOff: 12, BitfieldLen: 12, BitfieldUnit: 4}}, + }}}, {Key: StructKey{Name: "syz_bf_struct1_internal"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct1_internal", TypeSize: 4}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f0"}, BitfieldLen: 10, BitfieldUnit: 4}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f1"}, BitfieldOff: 10, BitfieldLen: 10, BitfieldUnit: 4}}, @@ -243,4 +255,4 @@ var consts_32_fork_shmem = []ConstValue{ {Name: "ONLY_32BITS_CONST", Value: 1}, } -const revision_32_fork_shmem = "ca3dd713981f8226a2f69b950611e27a721f5f79" +const revision_32_fork_shmem = "b76dc5bd8427ce6dfe34e3dca95a1d4504f3d917" diff --git a/sys/test/gen/32_shmem.go b/sys/test/gen/32_shmem.go index 25e31c0d0..155c1291e 100644 --- a/sys/test/gen/32_shmem.go +++ b/sys/test/gen/32_shmem.go @@ -39,6 +39,7 @@ var structDescs_32_shmem = []*KeyedStruct{ &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct10]"}, FldName: "bf10"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct11]"}, FldName: "bf11"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct12]"}, FldName: "bf12"}, + &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct13]"}, FldName: "bf13"}, &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}}}, @@ -58,6 +59,11 @@ var structDescs_32_shmem = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, &StructType{Key: StructKey{Name: "syz_bf_struct12"}, FldName: "f1"}, }}}, + {Key: StructKey{Name: "syz_bf_align[syz_bf_struct13]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct13]", 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_struct13"}, FldName: "f1"}, + }}}, {Key: StructKey{Name: "syz_bf_align[syz_bf_struct4]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct4]", TypeSize: 16}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, @@ -138,6 +144,12 @@ var structDescs_32_shmem = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f6", TypeSize: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, }}}, + {Key: StructKey{Name: "syz_bf_struct13"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct13", TypeSize: 8}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f0", TypeSize: 2}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f1"}, BitfieldLen: 12, BitfieldUnit: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f2", TypeSize: 4}, BitfieldOff: 12, BitfieldLen: 12, BitfieldUnit: 4}}, + }}}, {Key: StructKey{Name: "syz_bf_struct1_internal"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct1_internal", TypeSize: 4}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f0"}, BitfieldLen: 10, BitfieldUnit: 4}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f1"}, BitfieldOff: 10, BitfieldLen: 10, BitfieldUnit: 4}}, @@ -243,4 +255,4 @@ var consts_32_shmem = []ConstValue{ {Name: "ONLY_32BITS_CONST", Value: 1}, } -const revision_32_shmem = "132a815187700652ba8b27e1b4a81de38ccc3d44" +const revision_32_shmem = "6e06e8fe2dc6ffb45403f08e4e5ce85fe3c1ae1b" diff --git a/sys/test/gen/64.go b/sys/test/gen/64.go index 6a666322f..f72de3c27 100644 --- a/sys/test/gen/64.go +++ b/sys/test/gen/64.go @@ -86,6 +86,7 @@ var structDescs_64 = []*KeyedStruct{ &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct10]"}, FldName: "bf10"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct11]"}, FldName: "bf11"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct12]"}, FldName: "bf12"}, + &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct13]"}, FldName: "bf13"}, &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}}}, @@ -309,6 +310,11 @@ var structDescs_64 = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, &StructType{Key: StructKey{Name: "syz_bf_struct12"}, FldName: "f1"}, }}}, + {Key: StructKey{Name: "syz_bf_align[syz_bf_struct13]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct13]", 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_struct13"}, FldName: "f1"}, + }}}, {Key: StructKey{Name: "syz_bf_align[syz_bf_struct4]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct4]", TypeSize: 16}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, @@ -389,6 +395,12 @@ var structDescs_64 = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f6", TypeSize: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, }}}, + {Key: StructKey{Name: "syz_bf_struct13"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct13", TypeSize: 8}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f0", TypeSize: 2}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f1"}, BitfieldLen: 12, BitfieldUnit: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f2", TypeSize: 4}, BitfieldOff: 12, BitfieldLen: 12, BitfieldUnit: 4}}, + }}}, {Key: StructKey{Name: "syz_bf_struct1_internal"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct1_internal", TypeSize: 4}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f0"}, BitfieldLen: 10, BitfieldUnit: 4}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f1"}, BitfieldOff: 10, BitfieldLen: 10, BitfieldUnit: 4}}, @@ -1212,4 +1224,4 @@ var consts_64 = []ConstValue{ {Name: "SYS_unsupported"}, } -const revision_64 = "7e33bc29075fd5999f72b6c59ef49dda32b89937" +const revision_64 = "38b6142e1d528ab865c06298fb4b84c8b5126e1b" diff --git a/sys/test/gen/64_fork.go b/sys/test/gen/64_fork.go index a55b864f3..e57a86d99 100644 --- a/sys/test/gen/64_fork.go +++ b/sys/test/gen/64_fork.go @@ -39,6 +39,7 @@ var structDescs_64_fork = []*KeyedStruct{ &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct10]"}, FldName: "bf10"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct11]"}, FldName: "bf11"}, &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct12]"}, FldName: "bf12"}, + &StructType{Key: StructKey{Name: "syz_bf_align[syz_bf_struct13]"}, FldName: "bf13"}, &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}}}, @@ -58,6 +59,11 @@ var structDescs_64_fork = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, &StructType{Key: StructKey{Name: "syz_bf_struct12"}, FldName: "f1"}, }}}, + {Key: StructKey{Name: "syz_bf_align[syz_bf_struct13]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct13]", 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_struct13"}, FldName: "f1"}, + }}}, {Key: StructKey{Name: "syz_bf_align[syz_bf_struct4]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_align[syz_bf_struct4]", TypeSize: 16}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, @@ -138,6 +144,12 @@ var structDescs_64_fork = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f6", TypeSize: 1}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, }}}, + {Key: StructKey{Name: "syz_bf_struct13"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct13", TypeSize: 8}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f0", TypeSize: 2}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f1"}, BitfieldLen: 12, BitfieldUnit: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f2", TypeSize: 4}, BitfieldOff: 12, BitfieldLen: 12, BitfieldUnit: 4}}, + }}}, {Key: StructKey{Name: "syz_bf_struct1_internal"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct1_internal", TypeSize: 4}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f0"}, BitfieldLen: 10, BitfieldUnit: 4}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "f1"}, BitfieldOff: 10, BitfieldLen: 10, BitfieldUnit: 4}}, @@ -242,4 +254,4 @@ var consts_64_fork = []ConstValue{ {Name: "IPPROTO_UDP", Value: 17}, } -const revision_64_fork = "f7a499875897bbabb3bd01434205689198862c5b" +const revision_64_fork = "29137bab7309a05174b99d683a1c31207323ea3b" -- cgit mrf-deployment