From 2e9037c55f6a3308190ab4eb0ce110dddc7a6f2b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 17 Mar 2020 14:32:13 +0100 Subject: pkg/compiler: check that const values fit into base type const[0x12345678, int8] is always an error, detect these cases. Found some bugs in mptcp, socket proto and fuchsia fidl descriptions. --- executor/defs.h | 24 +- pkg/compiler/gen.go | 66 ++-- pkg/compiler/testdata/errors2.txt | 4 + pkg/compiler/testdata/errors3.txt | 3 + pkg/compiler/types.go | 26 +- sys/fuchsia/fidl.txt | 3 +- sys/fuchsia/gen/amd64.go | 777 ++++++++++++++++++++++---------------- sys/fuchsia/gen/arm64.go | 777 ++++++++++++++++++++++---------------- sys/linux/gen/386.go | 138 +++---- sys/linux/gen/amd64.go | 138 +++---- sys/linux/gen/arm.go | 138 +++---- sys/linux/gen/arm64.go | 138 +++---- sys/linux/gen/mips64le.go | 138 +++---- sys/linux/gen/ppc64le.go | 138 +++---- sys/linux/mptcp.txt | 20 +- sys/linux/socket.txt | 4 +- sys/linux/socket_caif.txt | 4 +- sys/linux/socket_inet.txt | 2 +- sys/linux/socket_inet6.txt | 2 +- sys/test/gen/32_fork_shmem.go | 4 +- sys/test/gen/32_shmem.go | 4 +- sys/test/gen/64.go | 4 +- sys/test/gen/64_fork.go | 4 +- sys/test/test.txt | 2 +- 24 files changed, 1404 insertions(+), 1154 deletions(-) diff --git a/executor/defs.h b/executor/defs.h index 06709b372..75460879d 100644 --- a/executor/defs.h +++ b/executor/defs.h @@ -45,7 +45,7 @@ #if GOARCH_amd64 #define GOARCH "amd64" -#define SYZ_REVISION "01d1f2350d7c83f7ad219975ca337bfad4aaadf5" +#define SYZ_REVISION "affb41e7463b2c8dbaf4456cc5c1135057b68e70" #define SYZ_EXECUTOR_USES_FORK_SERVER 0 #define SYZ_EXECUTOR_USES_SHMEM 0 #define SYZ_PAGE_SIZE 4096 @@ -55,7 +55,7 @@ #if GOARCH_arm64 #define GOARCH "arm64" -#define SYZ_REVISION "0b12855de96876bdb3b2df33f3a3debcd9f74b2c" +#define SYZ_REVISION "8169a7bb61f8f0d31d96b66fb157d4e71855b481" #define SYZ_EXECUTOR_USES_FORK_SERVER 0 #define SYZ_EXECUTOR_USES_SHMEM 0 #define SYZ_PAGE_SIZE 4096 @@ -70,7 +70,7 @@ #if GOARCH_386 #define GOARCH "386" -#define SYZ_REVISION "db0f567f9ed293cf75884637d72fcc58a7992c03" +#define SYZ_REVISION "7b2ff21add1b93e31ac4f6c8366cc01f609c8273" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -80,7 +80,7 @@ #if GOARCH_amd64 #define GOARCH "amd64" -#define SYZ_REVISION "de304bfedb6ea71382cb3557a0f594230b9b0618" +#define SYZ_REVISION "a29ff0c81a5e44bc22f432944a60e6b6c53e738f" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -90,7 +90,7 @@ #if GOARCH_arm #define GOARCH "arm" -#define SYZ_REVISION "c2affd9776766f4989972c1fd267df93936975e9" +#define SYZ_REVISION "2c0ba19495146d9f937a05c4b028b32deccfa93f" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -100,7 +100,7 @@ #if GOARCH_arm64 #define GOARCH "arm64" -#define SYZ_REVISION "487adfa82d65aefd926a8fd5ba2c5b2a4c6cd12a" +#define SYZ_REVISION "5f681c09be55c552ff1d317a4eeebc050f14ed4c" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -110,7 +110,7 @@ #if GOARCH_mips64le #define GOARCH "mips64le" -#define SYZ_REVISION "409f817568bb793162866fe46f58a686fb833f92" +#define SYZ_REVISION "d90e31b62b1912bc315e730477cf324ce5f9565f" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -120,7 +120,7 @@ #if GOARCH_ppc64le #define GOARCH "ppc64le" -#define SYZ_REVISION "d346a52af446098808f59a454dff5c3aec36dda8" +#define SYZ_REVISION "3a06326e1ca228e41b89b33630b25cd7451503ea" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -165,7 +165,7 @@ #if GOARCH_32_fork_shmem #define GOARCH "32_fork_shmem" -#define SYZ_REVISION "8b0c7eb98cd401cc01c2beb956ae849009a1d2d1" +#define SYZ_REVISION "1fba2cda053fcdf6511d4db184743d65230f9315" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 @@ -175,7 +175,7 @@ #if GOARCH_32_shmem #define GOARCH "32_shmem" -#define SYZ_REVISION "be5d972f8dc2b75e7dc9f6626863df04f26fe121" +#define SYZ_REVISION "003da4faad511684b515852654ae48b0f61c7e05" #define SYZ_EXECUTOR_USES_FORK_SERVER 0 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 8192 @@ -185,7 +185,7 @@ #if GOARCH_64 #define GOARCH "64" -#define SYZ_REVISION "36186e96efde25631acd856e90c680222ac62c9f" +#define SYZ_REVISION "78250fee4c7d10cc2980a171ea9a5eabfbc64b69" #define SYZ_EXECUTOR_USES_FORK_SERVER 0 #define SYZ_EXECUTOR_USES_SHMEM 0 #define SYZ_PAGE_SIZE 4096 @@ -195,7 +195,7 @@ #if GOARCH_64_fork #define GOARCH "64_fork" -#define SYZ_REVISION "610b24588703473caa36384b1c2f57f4ac0c7c5f" +#define SYZ_REVISION "00445cbd8f546cf0230ccadd7db782648cffcba5" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 0 #define SYZ_PAGE_SIZE 8192 diff --git a/pkg/compiler/gen.go b/pkg/compiler/gen.go index 30080f56a..5a658ce15 100644 --- a/pkg/compiler/gen.go +++ b/pkg/compiler/gen.go @@ -60,10 +60,10 @@ func (comp *compiler) collectCallArgSizes() map[string][]uint64 { argSizes := callArgSizes[n.CallName] for i, arg := range n.Args { if len(argSizes) <= i { - argSizes = append(argSizes, 0) + argSizes = append(argSizes, comp.ptrSize) } desc, _, _ := comp.getArgsBase(arg.Type, arg.Name.Name, prog.DirIn, true) - typ := comp.genField(arg, prog.DirIn, true) + typ := comp.genField(arg, prog.DirIn, comp.ptrSize) // Ignore all types with base (const, flags). We don't have base in syscall args. // Also ignore resources and pointers because fd can be 32-bits and pointer 64-bits, // and then there is no way to fix this. @@ -76,7 +76,7 @@ func (comp *compiler) collectCallArgSizes() map[string][]uint64 { continue } argID := fmt.Sprintf("%v|%v", n.CallName, i) - if argSizes[i] == 0 { + if _, ok := argPos[argID]; !ok { argSizes[i] = typ.Size() argPos[argID] = arg.Pos continue @@ -109,45 +109,18 @@ func (comp *compiler) genSyscalls() []*prog.Syscall { func (comp *compiler) genSyscall(n *ast.Call, argSizes []uint64) *prog.Syscall { var ret prog.Type if n.Ret != nil { - ret = comp.genType(n.Ret, "ret", prog.DirOut, true) - } - args := comp.genFieldArray(n.Args, prog.DirIn, true) - for i, arg := range args { - // Now that we know a more precise size, patch the type. - // This is somewhat hacky. Ideally we figure out the size earlier, - // store it somewhere and use during generation of the arg base type. - if argSizes[i] != 0 { - patchArgBaseSize(arg, argSizes[i]) - } + ret = comp.genType(n.Ret, "ret", prog.DirOut, comp.ptrSize) } return &prog.Syscall{ Name: n.Name.Name, CallName: n.CallName, NR: n.NR, MissingArgs: len(argSizes) - len(n.Args), - Args: args, + Args: comp.genFieldArray(n.Args, prog.DirIn, argSizes), Ret: ret, } } -func patchArgBaseSize(t0 prog.Type, size uint64) { - // We only need types that (1) can be arg, (2) have base type. - switch t := t0.(type) { - case *prog.ConstType: - t.TypeSize = size - case *prog.LenType: - t.TypeSize = size - case *prog.FlagsType: - t.TypeSize = size - case *prog.ProcType: - t.TypeSize = size - case *prog.IntType, *prog.ResourceType, *prog.PtrType, *prog.VmaType, *prog.UnionType: - // These don't have base. - default: - panic(fmt.Sprintf("type %#v can't be an arg", t)) - } -} - func (comp *compiler) genStructDescs(syscalls []*prog.Syscall) []*prog.KeyedStruct { // Calculate struct/union/array sizes, add padding to structs and detach // StructDesc's from StructType's. StructType's can be recursive so it's @@ -321,7 +294,7 @@ func (comp *compiler) genStructDesc(res *prog.StructDesc, n *ast.Struct, dir pro common.IsVarlen = varlen *res = prog.StructDesc{ TypeCommon: common, - Fields: comp.genFieldArray(n.Fields, dir, false), + Fields: comp.genFieldArray(n.Fields, dir, make([]uint64, len(n.Fields))), } } @@ -517,23 +490,32 @@ func genPad(size uint64) prog.Type { } } -func (comp *compiler) genField(f *ast.Field, dir prog.Dir, isArg bool) prog.Type { - return comp.genType(f.Type, f.Name.Name, dir, isArg) -} - -func (comp *compiler) genFieldArray(fields []*ast.Field, dir prog.Dir, isArg bool) []prog.Type { +func (comp *compiler) genFieldArray(fields []*ast.Field, dir prog.Dir, argSizes []uint64) []prog.Type { var res []prog.Type - for _, f := range fields { - res = append(res, comp.genField(f, dir, isArg)) + for i, f := range fields { + res = append(res, comp.genField(f, dir, argSizes[i])) } return res } -func (comp *compiler) genType(t *ast.Type, field string, dir prog.Dir, isArg bool) prog.Type { - desc, args, base := comp.getArgsBase(t, field, dir, isArg) +func (comp *compiler) genField(f *ast.Field, dir prog.Dir, argSize uint64) prog.Type { + return comp.genType(f.Type, f.Name.Name, dir, argSize) +} + +func (comp *compiler) genType(t *ast.Type, field string, dir prog.Dir, argSize uint64) prog.Type { + desc, args, base := comp.getArgsBase(t, field, dir, argSize != 0) if desc.Gen == nil { panic(fmt.Sprintf("no gen for %v %#v", field, t)) } + if argSize != 0 { + // Now that we know a more precise size, patch the type. + // This is somewhat hacky. Ideally we figure out the size earlier, + // store it somewhere and use during generation of the arg base type. + base.TypeSize = argSize + if desc.CheckConsts != nil { + desc.CheckConsts(comp, t, args, base) + } + } base.IsVarlen = desc.Varlen != nil && desc.Varlen(comp, t, args) return desc.Gen(comp, t, args, base) } diff --git a/pkg/compiler/testdata/errors2.txt b/pkg/compiler/testdata/errors2.txt index 2b24d3628..4ec52d6cb 100644 --- a/pkg/compiler/testdata/errors2.txt +++ b/pkg/compiler/testdata/errors2.txt @@ -270,6 +270,10 @@ foo$526(a int8[-255:255]) ### int range [18446744073709551361:255] is too large foo$527(a int16[-40000:40000]) ### int range [18446744073709511616:40000] is too large for base type of size 16 foo$528(a ptr[in, s405]) foo$529(a ptr[in, string[`abcdde`, 3]]) ### string value "\xab\xcd\xde\x00" exceeds buffer length 3 +foo$530(a ptr[in, const[0x1ab, int8]]) ### const val 0x1ab does not fit into 8 bits +foo$531(a ptr[in, const[0xffffffffffffffab, int8]]) +foo$532(a ptr[in, const[0x7234567812345678, int64]]) +foo$533(a ptr[in, const[0x12, int8:4]]) ### const val 0x12 does not fit into 4 bits type type500 proc[C1, 8, int8] ### values starting from 1 with step 8 overflow base type for 32 procs type type501 int8 ### unused type type501 diff --git a/pkg/compiler/testdata/errors3.txt b/pkg/compiler/testdata/errors3.txt index 65bd20092..3221ee5dc 100644 --- a/pkg/compiler/testdata/errors3.txt +++ b/pkg/compiler/testdata/errors3.txt @@ -6,6 +6,9 @@ discrimination(a int32) discrimination$1(a int16) ### discrimination$1 arg a is redeclared with size 2, previously declared with size 4 at LOCATION +arg_size$1(a int16) +arg_size$2(a const[0x12345]) ### const val 0x12345 does not fit into 16 bits + bad_size_attr_struct { a int64 } [size[4]] ### struct bad_size_attr_struct has size attribute 4 which is less than struct size 8 diff --git a/pkg/compiler/types.go b/pkg/compiler/types.go index 43efee202..0c05c82fa 100644 --- a/pkg/compiler/types.go +++ b/pkg/compiler/types.go @@ -163,7 +163,7 @@ var typePtr = &typeDesc{ } return &prog.PtrType{ TypeCommon: base.TypeCommon, - Type: comp.genType(args[1], "", genDir(args[0]), false), + Type: comp.genType(args[1], "", genDir(args[0]), 0), } }, } @@ -212,7 +212,7 @@ var typeArray = &typeDesc{ return comp.isZeroSize(args[0]) }, Gen: func(comp *compiler, t *ast.Type, args []*ast.Type, base prog.IntTypeCommon) prog.Type { - elemType := comp.genType(args[0], "", base.ArgDir, false) + elemType := comp.genType(args[0], "", base.ArgDir, 0) kind, begin, end := prog.ArrayRandLen, uint64(0), uint64(0) if len(args) > 1 { kind, begin, end = prog.ArrayRangeLen, args[1].Value, args[1].Value @@ -289,6 +289,24 @@ var typeConst = &typeDesc{ CantBeOpt: true, NeedBase: true, Args: []namedArg{{Name: "value", Type: typeArgInt}}, + CheckConsts: func(comp *compiler, t *ast.Type, args []*ast.Type, base prog.IntTypeCommon) { + size := base.BitfieldLen + if size == 0 { + size = base.TypeSize * 8 + } + if size == 64 { + return + } + v0 := args[0].Value + mask := uint64(1)< resource sock_caif[sock] -socket$caif_seqpacket(domain const[AF_CAIF], type const[SOCK_SEQPACKET], proto int8[CAIFPROTO_AT:CAIFPROTO_DEBUG]) sock_caif -socket$caif_stream(domain const[AF_CAIF], type const[SOCK_STREAM], proto int8[CAIFPROTO_AT:CAIFPROTO_DEBUG]) sock_caif +socket$caif_seqpacket(domain const[AF_CAIF], type const[SOCK_SEQPACKET], proto int32[CAIFPROTO_AT:CAIFPROTO_DEBUG]) sock_caif +socket$caif_stream(domain const[AF_CAIF], type const[SOCK_STREAM], proto int32[CAIFPROTO_AT:CAIFPROTO_DEBUG]) sock_caif connect$caif(fd sock_caif, addr ptr[in, sockaddr_caif], addrlen len[addr]) setsockopt$CAIFSO_LINK_SELECT(fd sock_caif, level const[SOL_CAIF], opt const[CAIFSO_LINK_SELECT], arg ptr[in, int32], arglen len[arg]) setsockopt$CAIFSO_REQ_PARAM(fd sock_caif, level const[SOL_CAIF], opt const[CAIFSO_REQ_PARAM], arg ptr[in, array[int8, 0:256]], arglen len[arg]) diff --git a/sys/linux/socket_inet.txt b/sys/linux/socket_inet.txt index 6892bae8b..0d9cd6481 100644 --- a/sys/linux/socket_inet.txt +++ b/sys/linux/socket_inet.txt @@ -23,7 +23,7 @@ sockaddr_storage_in { addr sockaddr_in } [size[SOCKADDR_STORAGE_SIZE], align_ptr] -socket$inet(domain const[AF_INET], type flags[socket_type], proto int8) sock_in +socket$inet(domain const[AF_INET], type flags[socket_type], proto int32) sock_in accept$inet(fd sock_in, peer ptr[out, sockaddr_in, opt], peerlen ptr[inout, len[peer, int32]]) sock_in accept4$inet(fd sock_in, peer ptr[out, sockaddr_in, opt], peerlen ptr[inout, len[peer, int32]], flags flags[accept_flags]) sock_in bind$inet(fd sock_in, addr ptr[in, sockaddr_in], addrlen len[addr]) diff --git a/sys/linux/socket_inet6.txt b/sys/linux/socket_inet6.txt index 2fdfc3257..34ce2a928 100644 --- a/sys/linux/socket_inet6.txt +++ b/sys/linux/socket_inet6.txt @@ -25,7 +25,7 @@ sockaddr_storage_in6 { addr sockaddr_in6 } [size[SOCKADDR_STORAGE_SIZE], align_ptr] -socket$inet6(domain const[AF_INET6], type flags[socket_type], proto int8) sock_in6 +socket$inet6(domain const[AF_INET6], type flags[socket_type], proto int32) sock_in6 accept$inet6(fd sock_in6, peer ptr[out, sockaddr_in6, opt], peerlen ptr[inout, len[peer, int32]]) sock_in6 accept4$inet6(fd sock_in6, peer ptr[out, sockaddr_in6, opt], peerlen ptr[inout, len[peer, int32]], flags flags[accept_flags]) sock_in6 bind$inet6(fd sock_in6, addr ptr[in, sockaddr_in6], addrlen len[addr]) diff --git a/sys/test/gen/32_fork_shmem.go b/sys/test/gen/32_fork_shmem.go index 93c79568f..7c46923ff 100644 --- a/sys/test/gen/32_fork_shmem.go +++ b/sys/test/gen/32_fork_shmem.go @@ -491,7 +491,7 @@ var structDescs_32_fork_shmem = []*KeyedStruct{ {StructKey{Name: "syz_bf_struct0"}, &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct0", TypeSize: 32}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "syz_bf_flags", FldName: "f0", TypeSize: 8}, BitfieldLen: 10, BitfieldUnit: 2}, Vals: []uint64{0, 1, 2}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f1", TypeSize: 8}}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "f2"}, BitfieldLen: 5, BitfieldUnit: 2}, Val: 66}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "f2"}, BitfieldLen: 5, BitfieldUnit: 2}, Val: 2}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f3"}, BitfieldOff: 5, BitfieldLen: 6, BitfieldUnit: 2}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "f4", TypeSize: 4}, BitfieldOff: 11, BitfieldLen: 15, BitfieldUnit: 4}, Val: 66}, &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "f5", TypeSize: 2}, BitfieldLen: 11, BitfieldUnit: 2}, Path: []string{"parent"}}, @@ -1450,4 +1450,4 @@ var consts_32_fork_shmem = []ConstValue{ {Name: "SYS_unsupported"}, } -const revision_32_fork_shmem = "8b0c7eb98cd401cc01c2beb956ae849009a1d2d1" +const revision_32_fork_shmem = "1fba2cda053fcdf6511d4db184743d65230f9315" diff --git a/sys/test/gen/32_shmem.go b/sys/test/gen/32_shmem.go index df49539b0..4a890092d 100644 --- a/sys/test/gen/32_shmem.go +++ b/sys/test/gen/32_shmem.go @@ -488,7 +488,7 @@ var structDescs_32_shmem = []*KeyedStruct{ {StructKey{Name: "syz_bf_struct0"}, &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct0", TypeSize: 24}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "syz_bf_flags", FldName: "f0", TypeSize: 4}, BitfieldLen: 10, BitfieldUnit: 2}, Vals: []uint64{0, 1, 2}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f1", TypeSize: 8}}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "f2"}, BitfieldLen: 5, BitfieldUnit: 2}, Val: 66}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "f2"}, BitfieldLen: 5, BitfieldUnit: 2}, Val: 2}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f3"}, BitfieldOff: 5, BitfieldLen: 6, BitfieldUnit: 2}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "f4", TypeSize: 4}, BitfieldOff: 11, BitfieldLen: 15, BitfieldUnit: 4}, Val: 66}, &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "f5", TypeSize: 2}, BitfieldLen: 11, BitfieldUnit: 2}, Path: []string{"parent"}}, @@ -1444,4 +1444,4 @@ var consts_32_shmem = []ConstValue{ {Name: "SYS_unsupported"}, } -const revision_32_shmem = "be5d972f8dc2b75e7dc9f6626863df04f26fe121" +const revision_32_shmem = "003da4faad511684b515852654ae48b0f61c7e05" diff --git a/sys/test/gen/64.go b/sys/test/gen/64.go index c7c452e7e..801688b5d 100644 --- a/sys/test/gen/64.go +++ b/sys/test/gen/64.go @@ -493,7 +493,7 @@ var structDescs_64 = []*KeyedStruct{ {StructKey{Name: "syz_bf_struct0"}, &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct0", TypeSize: 32}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "syz_bf_flags", FldName: "f0", TypeSize: 8}, BitfieldLen: 10, BitfieldUnit: 2}, Vals: []uint64{0, 1, 2}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f1", TypeSize: 8}}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "f2"}, BitfieldLen: 5, BitfieldUnit: 2}, Val: 66}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "f2"}, BitfieldLen: 5, BitfieldUnit: 2}, Val: 2}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f3"}, BitfieldOff: 5, BitfieldLen: 6, BitfieldUnit: 2}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "f4", TypeSize: 4}, BitfieldOff: 11, BitfieldLen: 15, BitfieldUnit: 4}, Val: 66}, &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "f5", TypeSize: 2}, BitfieldLen: 11, BitfieldUnit: 2}, Path: []string{"parent"}}, @@ -1454,4 +1454,4 @@ var consts_64 = []ConstValue{ {Name: "SYS_unsupported"}, } -const revision_64 = "36186e96efde25631acd856e90c680222ac62c9f" +const revision_64 = "78250fee4c7d10cc2980a171ea9a5eabfbc64b69" diff --git a/sys/test/gen/64_fork.go b/sys/test/gen/64_fork.go index d2c9437dd..df00ff36d 100644 --- a/sys/test/gen/64_fork.go +++ b/sys/test/gen/64_fork.go @@ -493,7 +493,7 @@ var structDescs_64_fork = []*KeyedStruct{ {StructKey{Name: "syz_bf_struct0"}, &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_bf_struct0", TypeSize: 32}, Fields: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "syz_bf_flags", FldName: "f0", TypeSize: 8}, BitfieldLen: 10, BitfieldUnit: 2}, Vals: []uint64{0, 1, 2}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "f1", TypeSize: 8}}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "f2"}, BitfieldLen: 5, BitfieldUnit: 2}, Val: 66}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "f2"}, BitfieldLen: 5, BitfieldUnit: 2}, Val: 2}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "f3"}, BitfieldOff: 5, BitfieldLen: 6, BitfieldUnit: 2}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "f4", TypeSize: 4}, BitfieldOff: 11, BitfieldLen: 15, BitfieldUnit: 4}, Val: 66}, &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "f5", TypeSize: 2}, BitfieldLen: 11, BitfieldUnit: 2}, Path: []string{"parent"}}, @@ -1450,4 +1450,4 @@ var consts_64_fork = []ConstValue{ {Name: "SYS_unsupported"}, } -const revision_64_fork = "610b24588703473caa36384b1c2f57f4ac0c7c5f" +const revision_64_fork = "00445cbd8f546cf0230ccadd7db782648cffcba5" diff --git a/sys/test/test.txt b/sys/test/test.txt index 3b9b1d71d..21ae877e1 100644 --- a/sys/test/test.txt +++ b/sys/test/test.txt @@ -554,7 +554,7 @@ syz_bf_flags = 0, 1, 2 syz_bf_struct0 { f0 flags[syz_bf_flags, int16:10] f1 int64 - f2 const[0x42, int16:5] + f2 const[0x2, int16:5] f3 int16:6 f4 const[0x42, int32:15] f5 len[parent, int16:11] -- cgit mrf-deployment