diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-02-25 14:44:29 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-02-25 14:44:29 +0100 |
| commit | 2145057cb8a50aba1a27a67be19953bee9b164fd (patch) | |
| tree | a8a5b759ef44ad1a88f1bf3064283ff3caa7fc69 | |
| parent | 1f4ae3f41357cf0a8cf8c698cbcd1000b8b44bf4 (diff) | |
pkg/compiler: fix alignment corner case
Fix alignemnt calculation for packed structs with alignment and bitfields.
Amusingly this affected only a single real struct -- ipv6_fragment_ext_header.
| -rw-r--r-- | executor/syscalls_linux.h | 10 | ||||
| -rw-r--r-- | executor/syscalls_test.h | 10 | ||||
| -rw-r--r-- | pkg/compiler/gen.go | 4 | ||||
| -rw-r--r-- | prog/analysis.go | 6 | ||||
| -rw-r--r-- | prog/encodingexec_test.go | 15 | ||||
| -rw-r--r-- | sys/linux/386.go | 5 | ||||
| -rw-r--r-- | sys/linux/amd64.go | 5 | ||||
| -rw-r--r-- | sys/linux/arm.go | 5 | ||||
| -rw-r--r-- | sys/linux/arm64.go | 5 | ||||
| -rw-r--r-- | sys/linux/ppc64le.go | 5 | ||||
| -rw-r--r-- | sys/test/32.go | 19 | ||||
| -rw-r--r-- | sys/test/64.go | 19 | ||||
| -rw-r--r-- | sys/test/test.txt | 15 |
13 files changed, 94 insertions, 29 deletions
diff --git a/executor/syscalls_linux.h b/executor/syscalls_linux.h index ca8e4e499..a3f01f0ac 100644 --- a/executor/syscalls_linux.h +++ b/executor/syscalls_linux.h @@ -2,7 +2,7 @@ #if defined(__i386__) || 0 #define GOARCH "386" -#define SYZ_REVISION "8af2920eb5a6c27c2e71e75f7a211cf2b0afed22" +#define SYZ_REVISION "7fa1dc861170866b93bcdf1919d822e8d0a07cec" #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 @@ -1599,7 +1599,7 @@ call_t syscalls[] = { #if defined(__x86_64__) || 0 #define GOARCH "amd64" -#define SYZ_REVISION "5e90d87bd5a53f631c72bfac0710424ecd2c9e28" +#define SYZ_REVISION "f5d957ae165e714c54b67d39db5982187b5393ec" #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 @@ -3249,7 +3249,7 @@ call_t syscalls[] = { #if defined(__arm__) || 0 #define GOARCH "arm" -#define SYZ_REVISION "04da8a970e93697b72a9365fb60321d5a306d0b3" +#define SYZ_REVISION "4b33f66a0aeae24040db5b4a35e18e6ff2977b10" #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 @@ -4854,7 +4854,7 @@ call_t syscalls[] = { #if defined(__aarch64__) || 0 #define GOARCH "arm64" -#define SYZ_REVISION "7eb7f166eca34015f8bde36f49218b4792dfa8ab" +#define SYZ_REVISION "95e5f9d1ee68c969b1db26d8fd6ef0fb8b329019" #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 @@ -6433,7 +6433,7 @@ call_t syscalls[] = { #if defined(__ppc64__) || defined(__PPC64__) || defined(__powerpc64__) || 0 #define GOARCH "ppc64le" -#define SYZ_REVISION "a895f7df654ac3981d94d50200c4036404459583" +#define SYZ_REVISION "067ce945ca9c59814a9ba64002ae646a553e757c" #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 diff --git a/executor/syscalls_test.h b/executor/syscalls_test.h index ff591e3a1..7f91e398e 100644 --- a/executor/syscalls_test.h +++ b/executor/syscalls_test.h @@ -2,11 +2,11 @@ #if 0 #define GOARCH "32" -#define SYZ_REVISION "d2a9a5da5971060f9d6e1dfe0ec2a78b9b20d854" +#define SYZ_REVISION "8e3bfbc4dd1f6619b4895bcb80e0004ef4c96928" #define SYZ_PAGE_SIZE 8192 #define SYZ_NUM_PAGES 2048 #define SYZ_DATA_OFFSET 536870912 -unsigned syscall_count = 87; +unsigned syscall_count = 88; call_t syscalls[] = { {"mmap", 0, (syscall_t)mmap}, {"mutate0", 0, (syscall_t)mutate0}, @@ -28,6 +28,7 @@ call_t syscalls[] = { {"syz_test$align4", 0, (syscall_t)syz_test}, {"syz_test$align5", 0, (syscall_t)syz_test}, {"syz_test$align6", 0, (syscall_t)syz_test}, + {"syz_test$align7", 0, (syscall_t)syz_test}, {"syz_test$array0", 0, (syscall_t)syz_test}, {"syz_test$array1", 0, (syscall_t)syz_test}, {"syz_test$array2", 0, (syscall_t)syz_test}, @@ -101,11 +102,11 @@ call_t syscalls[] = { #if 0 #define GOARCH "64" -#define SYZ_REVISION "e12a470f0d2c46ee2f677920db209e6225ce9f38" +#define SYZ_REVISION "4a4abb9774bf056d0952d60f2fffdfdc392353a2" #define SYZ_PAGE_SIZE 4096 #define SYZ_NUM_PAGES 4096 #define SYZ_DATA_OFFSET 536870912 -unsigned syscall_count = 87; +unsigned syscall_count = 88; call_t syscalls[] = { {"mmap", 0, (syscall_t)mmap}, {"mutate0", 0, (syscall_t)mutate0}, @@ -127,6 +128,7 @@ call_t syscalls[] = { {"syz_test$align4", 0, (syscall_t)syz_test}, {"syz_test$align5", 0, (syscall_t)syz_test}, {"syz_test$align6", 0, (syscall_t)syz_test}, + {"syz_test$align7", 0, (syscall_t)syz_test}, {"syz_test$array0", 0, (syscall_t)syz_test}, {"syz_test$array1", 0, (syscall_t)syz_test}, {"syz_test$array2", 0, (syscall_t)syz_test}, diff --git a/pkg/compiler/gen.go b/pkg/compiler/gen.go index 7f0701ed7..ddcec2252 100644 --- a/pkg/compiler/gen.go +++ b/pkg/compiler/gen.go @@ -252,7 +252,9 @@ func (comp *compiler) addAlignment(fields []prog.Type, varlen, packed bool, alig if !varlen && alignAttr != 0 { size := uint64(0) for _, f := range fields { - size += f.Size() + if !f.BitfieldMiddle() { + size += f.Size() + } } if tail := size % alignAttr; tail != 0 { newFields = append(newFields, genPad(alignAttr-tail)) diff --git a/prog/analysis.go b/prog/analysis.go index c93a13e6c..6a5cd03d9 100644 --- a/prog/analysis.go +++ b/prog/analysis.go @@ -120,9 +120,11 @@ func foreachArgImpl(arg Arg, ctx ArgCtx, f func(Arg, *ArgCtx)) { totalSize += size } } - if totalSize > a.Size() { + claimedSize := a.Size() + varlen := a.Type().Varlen() + if varlen && totalSize > claimedSize || !varlen && totalSize != claimedSize { panic(fmt.Sprintf("bad group arg size %v, should be <= %v for %+v", - totalSize, a.Size(), a)) + totalSize, claimedSize, a)) } case *PointerArg: if a.Res != nil { diff --git a/prog/encodingexec_test.go b/prog/encodingexec_test.go index 92c36cad4..2ad19598e 100644 --- a/prog/encodingexec_test.go +++ b/prog/encodingexec_test.go @@ -390,6 +390,21 @@ func TestSerializeForExec(t *testing.T) { }, nil, }, + { + "syz_test$align7(&(0x7f0000000000)={{0x1, 0x2, 0x3, 0x4, 0x5, 0x6}, 0x42})", + []uint64{ + execInstrCopyin, dataOffset + 0, execArgConst, 1 | 0<<16 | 1<<24, 0x1, + execInstrCopyin, dataOffset + 0, execArgConst, 1 | 1<<16 | 1<<24, 0x2, + execInstrCopyin, dataOffset + 0, execArgConst, 1 | 2<<16 | 1<<24, 0x3, + execInstrCopyin, dataOffset + 1, execArgConst, 2 | 0<<16 | 1<<24, 0x4, + execInstrCopyin, dataOffset + 1, execArgConst, 2 | 1<<16 | 1<<24, 0x5, + execInstrCopyin, dataOffset + 1, execArgConst, 2 | 2<<16 | 1<<24, 0x6, + execInstrCopyin, dataOffset + 8, execArgConst, 1, 0x42, + callID("syz_test$align7"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, + execInstrEOF, + }, + nil, + }, } buf := make([]byte, ExecBufferSize) diff --git a/sys/linux/386.go b/sys/linux/386.go index 19a16e2ba..f9f726d57 100644 --- a/sys/linux/386.go +++ b/sys/linux/386.go @@ -4400,7 +4400,7 @@ var structDescs_386 = []*KeyedStruct{ &StructType{Key: StructKey{Name: "ipv6_fragment_ext_header"}, FldName: "fragment"}, &StructType{Key: StructKey{Name: "ipv6_dstopts_ext_header"}, FldName: "dstopts"}, }}}, - {Key: StructKey{Name: "ipv6_fragment_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_fragment_ext_header", TypeSize: 14}, Fields: []Type{ + {Key: StructKey{Name: "ipv6_fragment_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_fragment_ext_header", TypeSize: 8}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "ipv6_types", FldName: "next_header", TypeSize: 1}}, Vals: []uint64{0, 1, 2, 4, 6, 8, 12, 17, 22, 29, 33, 41, 46, 47, 50, 51, 92, 94, 98, 103, 108, 132, 136, 137, 255, 0, 43, 44, 58, 59, 60, 135, 0, 43, 44, 47, 50, 51, 58, 59, 60, 135, 115}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "reserved1", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "fragment_off_hi", TypeSize: 1}}}, @@ -4408,7 +4408,6 @@ var structDescs_386 = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "reserved2", TypeSize: 1}, BitfieldOff: 1, BitfieldLen: 2, BitfieldMdl: true}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "fragment_off_lo", TypeSize: 1}, BitfieldOff: 3, BitfieldLen: 5}}, &ProcType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "proc", FldName: "identification", TypeSize: 4}}, ValuesStart: 100, ValuesPerProc: 4}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 6}}, IsPad: true}, }, AlignAttr: 8}}, {Key: StructKey{Name: "ipv6_hopots_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_hopots_ext_header", IsVarlen: true}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "ipv6_types", FldName: "next_header", TypeSize: 1}}, Vals: []uint64{0, 1, 2, 4, 6, 8, 12, 17, 22, 29, 33, 41, 46, 47, 50, 51, 92, 94, 98, 103, 108, 132, 136, 137, 255, 0, 43, 44, 58, 59, 60, 135, 0, 43, 44, 47, 50, 51, 58, 59, 60, 135, 115}}, @@ -25033,4 +25032,4 @@ var consts_386 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_386 = "8af2920eb5a6c27c2e71e75f7a211cf2b0afed22" +const revision_386 = "7fa1dc861170866b93bcdf1919d822e8d0a07cec" diff --git a/sys/linux/amd64.go b/sys/linux/amd64.go index a85616326..f6b0c54a1 100644 --- a/sys/linux/amd64.go +++ b/sys/linux/amd64.go @@ -4491,7 +4491,7 @@ var structDescs_amd64 = []*KeyedStruct{ &StructType{Key: StructKey{Name: "ipv6_fragment_ext_header"}, FldName: "fragment"}, &StructType{Key: StructKey{Name: "ipv6_dstopts_ext_header"}, FldName: "dstopts"}, }}}, - {Key: StructKey{Name: "ipv6_fragment_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_fragment_ext_header", TypeSize: 14}, Fields: []Type{ + {Key: StructKey{Name: "ipv6_fragment_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_fragment_ext_header", TypeSize: 8}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "ipv6_types", FldName: "next_header", TypeSize: 1}}, Vals: []uint64{0, 1, 2, 4, 6, 8, 12, 17, 22, 29, 33, 41, 46, 47, 50, 51, 92, 94, 98, 103, 108, 132, 136, 137, 255, 0, 43, 44, 58, 59, 60, 135, 0, 43, 44, 47, 50, 51, 58, 59, 60, 135, 115}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "reserved1", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "fragment_off_hi", TypeSize: 1}}}, @@ -4499,7 +4499,6 @@ var structDescs_amd64 = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "reserved2", TypeSize: 1}, BitfieldOff: 1, BitfieldLen: 2, BitfieldMdl: true}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "fragment_off_lo", TypeSize: 1}, BitfieldOff: 3, BitfieldLen: 5}}, &ProcType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "proc", FldName: "identification", TypeSize: 4}}, ValuesStart: 100, ValuesPerProc: 4}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 6}}, IsPad: true}, }, AlignAttr: 8}}, {Key: StructKey{Name: "ipv6_hopots_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_hopots_ext_header", IsVarlen: true}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "ipv6_types", FldName: "next_header", TypeSize: 1}}, Vals: []uint64{0, 1, 2, 4, 6, 8, 12, 17, 22, 29, 33, 41, 46, 47, 50, 51, 92, 94, 98, 103, 108, 132, 136, 137, 255, 0, 43, 44, 58, 59, 60, 135, 0, 43, 44, 47, 50, 51, 58, 59, 60, 135, 115}}, @@ -25634,4 +25633,4 @@ var consts_amd64 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_amd64 = "5e90d87bd5a53f631c72bfac0710424ecd2c9e28" +const revision_amd64 = "f5d957ae165e714c54b67d39db5982187b5393ec" diff --git a/sys/linux/arm.go b/sys/linux/arm.go index 2a5f3abb8..d158d66ac 100644 --- a/sys/linux/arm.go +++ b/sys/linux/arm.go @@ -4417,7 +4417,7 @@ var structDescs_arm = []*KeyedStruct{ &StructType{Key: StructKey{Name: "ipv6_fragment_ext_header"}, FldName: "fragment"}, &StructType{Key: StructKey{Name: "ipv6_dstopts_ext_header"}, FldName: "dstopts"}, }}}, - {Key: StructKey{Name: "ipv6_fragment_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_fragment_ext_header", TypeSize: 14}, Fields: []Type{ + {Key: StructKey{Name: "ipv6_fragment_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_fragment_ext_header", TypeSize: 8}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "ipv6_types", FldName: "next_header", TypeSize: 1}}, Vals: []uint64{0, 1, 2, 4, 6, 8, 12, 17, 22, 29, 33, 41, 46, 47, 50, 51, 92, 94, 98, 103, 108, 132, 136, 137, 255, 0, 43, 44, 58, 59, 60, 135, 0, 43, 44, 47, 50, 51, 58, 59, 60, 135, 115}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "reserved1", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "fragment_off_hi", TypeSize: 1}}}, @@ -4425,7 +4425,6 @@ var structDescs_arm = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "reserved2", TypeSize: 1}, BitfieldOff: 1, BitfieldLen: 2, BitfieldMdl: true}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "fragment_off_lo", TypeSize: 1}, BitfieldOff: 3, BitfieldLen: 5}}, &ProcType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "proc", FldName: "identification", TypeSize: 4}}, ValuesStart: 100, ValuesPerProc: 4}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 6}}, IsPad: true}, }, AlignAttr: 8}}, {Key: StructKey{Name: "ipv6_hopots_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_hopots_ext_header", IsVarlen: true}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "ipv6_types", FldName: "next_header", TypeSize: 1}}, Vals: []uint64{0, 1, 2, 4, 6, 8, 12, 17, 22, 29, 33, 41, 46, 47, 50, 51, 92, 94, 98, 103, 108, 132, 136, 137, 255, 0, 43, 44, 58, 59, 60, 135, 0, 43, 44, 47, 50, 51, 58, 59, 60, 135, 115}}, @@ -24872,4 +24871,4 @@ var consts_arm = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_arm = "04da8a970e93697b72a9365fb60321d5a306d0b3" +const revision_arm = "4b33f66a0aeae24040db5b4a35e18e6ff2977b10" diff --git a/sys/linux/arm64.go b/sys/linux/arm64.go index f81cdd64a..107e13b47 100644 --- a/sys/linux/arm64.go +++ b/sys/linux/arm64.go @@ -4491,7 +4491,7 @@ var structDescs_arm64 = []*KeyedStruct{ &StructType{Key: StructKey{Name: "ipv6_fragment_ext_header"}, FldName: "fragment"}, &StructType{Key: StructKey{Name: "ipv6_dstopts_ext_header"}, FldName: "dstopts"}, }}}, - {Key: StructKey{Name: "ipv6_fragment_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_fragment_ext_header", TypeSize: 14}, Fields: []Type{ + {Key: StructKey{Name: "ipv6_fragment_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_fragment_ext_header", TypeSize: 8}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "ipv6_types", FldName: "next_header", TypeSize: 1}}, Vals: []uint64{0, 1, 2, 4, 6, 8, 12, 17, 22, 29, 33, 41, 46, 47, 50, 51, 92, 94, 98, 103, 108, 132, 136, 137, 255, 0, 43, 44, 58, 59, 60, 135, 0, 43, 44, 47, 50, 51, 58, 59, 60, 135, 115}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "reserved1", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "fragment_off_hi", TypeSize: 1}}}, @@ -4499,7 +4499,6 @@ var structDescs_arm64 = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "reserved2", TypeSize: 1}, BitfieldOff: 1, BitfieldLen: 2, BitfieldMdl: true}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "fragment_off_lo", TypeSize: 1}, BitfieldOff: 3, BitfieldLen: 5}}, &ProcType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "proc", FldName: "identification", TypeSize: 4}}, ValuesStart: 100, ValuesPerProc: 4}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 6}}, IsPad: true}, }, AlignAttr: 8}}, {Key: StructKey{Name: "ipv6_hopots_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_hopots_ext_header", IsVarlen: true}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "ipv6_types", FldName: "next_header", TypeSize: 1}}, Vals: []uint64{0, 1, 2, 4, 6, 8, 12, 17, 22, 29, 33, 41, 46, 47, 50, 51, 92, 94, 98, 103, 108, 132, 136, 137, 255, 0, 43, 44, 58, 59, 60, 135, 0, 43, 44, 47, 50, 51, 58, 59, 60, 135, 115}}, @@ -25016,4 +25015,4 @@ var consts_arm64 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_arm64 = "7eb7f166eca34015f8bde36f49218b4792dfa8ab" +const revision_arm64 = "95e5f9d1ee68c969b1db26d8fd6ef0fb8b329019" diff --git a/sys/linux/ppc64le.go b/sys/linux/ppc64le.go index ee51901b9..e89daa6ea 100644 --- a/sys/linux/ppc64le.go +++ b/sys/linux/ppc64le.go @@ -4472,7 +4472,7 @@ var structDescs_ppc64le = []*KeyedStruct{ &StructType{Key: StructKey{Name: "ipv6_fragment_ext_header"}, FldName: "fragment"}, &StructType{Key: StructKey{Name: "ipv6_dstopts_ext_header"}, FldName: "dstopts"}, }}}, - {Key: StructKey{Name: "ipv6_fragment_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_fragment_ext_header", TypeSize: 14}, Fields: []Type{ + {Key: StructKey{Name: "ipv6_fragment_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_fragment_ext_header", TypeSize: 8}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "ipv6_types", FldName: "next_header", TypeSize: 1}}, Vals: []uint64{0, 1, 2, 4, 6, 8, 12, 17, 22, 29, 33, 41, 46, 47, 50, 51, 92, 94, 98, 103, 108, 132, 136, 137, 255, 0, 43, 44, 58, 59, 60, 135, 0, 43, 44, 47, 50, 51, 58, 59, 60, 135, 115}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "reserved1", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "fragment_off_hi", TypeSize: 1}}}, @@ -4480,7 +4480,6 @@ var structDescs_ppc64le = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "reserved2", TypeSize: 1}, BitfieldOff: 1, BitfieldLen: 2, BitfieldMdl: true}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "fragment_off_lo", TypeSize: 1}, BitfieldOff: 3, BitfieldLen: 5}}, &ProcType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "proc", FldName: "identification", TypeSize: 4}}, ValuesStart: 100, ValuesPerProc: 4}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 6}}, IsPad: true}, }, AlignAttr: 8}}, {Key: StructKey{Name: "ipv6_hopots_ext_header"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "ipv6_hopots_ext_header", IsVarlen: true}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "ipv6_types", FldName: "next_header", TypeSize: 1}}, Vals: []uint64{0, 1, 2, 4, 6, 8, 12, 17, 22, 29, 33, 41, 46, 47, 50, 51, 92, 94, 98, 103, 108, 132, 136, 137, 255, 0, 43, 44, 58, 59, 60, 135, 0, 43, 44, 47, 50, 51, 58, 59, 60, 135, 115}}, @@ -24778,4 +24777,4 @@ var consts_ppc64le = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_ppc64le = "a895f7df654ac3981d94d50200c4036404459583" +const revision_ppc64le = "067ce945ca9c59814a9ba64002ae646a553e757c" diff --git a/sys/test/32.go b/sys/test/32.go index 3a029eba9..c3c56aea7 100644 --- a/sys/test/32.go +++ b/sys/test/32.go @@ -116,6 +116,20 @@ var structDescs_32 = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "f1", IsVarlen: true}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}}, }}}, + {Key: StructKey{Name: "syz_align7"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_align7", TypeSize: 16}, Fields: []Type{ + &StructType{Key: StructKey{Name: "syz_align8"}, FldName: "f0"}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f1", TypeSize: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 7}}, IsPad: true}, + }}}, + {Key: StructKey{Name: "syz_align8"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_align8", TypeSize: 8}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}, BitfieldLen: 1, BitfieldMdl: true}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f1", TypeSize: 1}, BitfieldOff: 1, BitfieldLen: 1, BitfieldMdl: true}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f2", TypeSize: 1}, BitfieldOff: 2, BitfieldLen: 1}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f3", TypeSize: 2}, BitfieldLen: 1, BitfieldMdl: true}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f4", TypeSize: 2}, BitfieldOff: 1, BitfieldLen: 1, BitfieldMdl: true}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f5", TypeSize: 2}, BitfieldOff: 2, BitfieldLen: 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 5}}, IsPad: true}, + }, AlignAttr: 8}}, {Key: StructKey{Name: "syz_array_blob"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_array_blob", TypeSize: 20}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f0", TypeSize: 2}}}, &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "f1", TypeSize: 16}, Kind: 1, RangeBegin: 16, RangeEnd: 16}, @@ -490,6 +504,9 @@ var syscalls_32 = []*Syscall{ {Name: "syz_test$align6", CallName: "syz_test", Args: []Type{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a0", TypeSize: 4}, Type: &StructType{Key: StructKey{Name: "syz_align6"}}}, }}, + {Name: "syz_test$align7", CallName: "syz_test", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a0", TypeSize: 4}, Type: &StructType{Key: StructKey{Name: "syz_align7"}}}, + }}, {Name: "syz_test$array0", CallName: "syz_test", Args: []Type{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a0", TypeSize: 4}, Type: &StructType{Key: StructKey{Name: "syz_array_struct"}}}, }}, @@ -722,4 +739,4 @@ var consts_32 = []ConstValue{ {Name: "ONLY_32BITS_CONST", Value: 1}, } -const revision_32 = "d2a9a5da5971060f9d6e1dfe0ec2a78b9b20d854" +const revision_32 = "8e3bfbc4dd1f6619b4895bcb80e0004ef4c96928" diff --git a/sys/test/64.go b/sys/test/64.go index 246d1c5bc..e97d6156a 100644 --- a/sys/test/64.go +++ b/sys/test/64.go @@ -116,6 +116,20 @@ var structDescs_64 = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "f1", IsVarlen: true}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}}, }}}, + {Key: StructKey{Name: "syz_align7"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_align7", TypeSize: 16}, Fields: []Type{ + &StructType{Key: StructKey{Name: "syz_align8"}, FldName: "f0"}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f1", TypeSize: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 7}}, IsPad: true}, + }}}, + {Key: StructKey{Name: "syz_align8"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_align8", TypeSize: 8}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f0", TypeSize: 1}, BitfieldLen: 1, BitfieldMdl: true}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f1", TypeSize: 1}, BitfieldOff: 1, BitfieldLen: 1, BitfieldMdl: true}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "f2", TypeSize: 1}, BitfieldOff: 2, BitfieldLen: 1}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f3", TypeSize: 2}, BitfieldLen: 1, BitfieldMdl: true}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f4", TypeSize: 2}, BitfieldOff: 1, BitfieldLen: 1, BitfieldMdl: true}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f5", TypeSize: 2}, BitfieldOff: 2, BitfieldLen: 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 5}}, IsPad: true}, + }, AlignAttr: 8}}, {Key: StructKey{Name: "syz_array_blob"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_array_blob", TypeSize: 20}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f0", TypeSize: 2}}}, &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "f1", TypeSize: 16}, Kind: 1, RangeBegin: 16, RangeEnd: 16}, @@ -489,6 +503,9 @@ var syscalls_64 = []*Syscall{ {Name: "syz_test$align6", CallName: "syz_test", Args: []Type{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a0", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "syz_align6"}}}, }}, + {Name: "syz_test$align7", CallName: "syz_test", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a0", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "syz_align7"}}}, + }}, {Name: "syz_test$array0", CallName: "syz_test", Args: []Type{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a0", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "syz_array_struct"}}}, }}, @@ -720,4 +737,4 @@ var consts_64 = []ConstValue{ {Name: "IPPROTO_UDP", Value: 17}, } -const revision_64 = "e12a470f0d2c46ee2f677920db209e6225ce9f38" +const revision_64 = "4a4abb9774bf056d0952d60f2fffdfdc392353a2" diff --git a/sys/test/test.txt b/sys/test/test.txt index d63ed598b..f520afa04 100644 --- a/sys/test/test.txt +++ b/sys/test/test.txt @@ -26,6 +26,7 @@ syz_test$align3(a0 ptr[in, syz_align3]) syz_test$align4(a0 ptr[in, syz_align4]) syz_test$align5(a0 ptr[in, syz_align5]) syz_test$align6(a0 ptr[in, syz_align6]) +syz_test$align7(a0 ptr[in, syz_align7]) syz_align0 { f0 int16 @@ -97,6 +98,20 @@ syz_align6 { f1 array[int32] } +syz_align7 { + f0 syz_align8 + f1 int8 +} + +syz_align8 { + f0 int8:1 + f1 int8:1 + f2 int8:1 + f3 int16:1 + f4 int16:1 + f5 int16:1 +} [packed, align_8] + # Structs syz_test$struct(a0 ptr[in, syz_struct0]) |
