diff options
| -rw-r--r-- | executor/defs.h | 2 | ||||
| -rw-r--r-- | executor/syscalls.h | 2 | ||||
| -rw-r--r-- | sys/openbsd/dev_diskmap.txt | 23 | ||||
| -rw-r--r-- | sys/openbsd/dev_diskmap_amd64.const | 7 | ||||
| -rw-r--r-- | sys/openbsd/gen/amd64.go | 22 |
5 files changed, 54 insertions, 2 deletions
diff --git a/executor/defs.h b/executor/defs.h index 13af71c91..fe7d12e32 100644 --- a/executor/defs.h +++ b/executor/defs.h @@ -140,7 +140,7 @@ #if GOARCH_amd64 #define GOARCH "amd64" -#define SYZ_REVISION "7f4015fe5d4b3777d30d2d5dd379e3de766e0e8e" +#define SYZ_REVISION "33de16487cc0a0d25eaa32ea4166bbbc75d2994e" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 1 #define SYZ_PAGE_SIZE 4096 diff --git a/executor/syscalls.h b/executor/syscalls.h index 8fe1605f1..3665c8897 100644 --- a/executor/syscalls.h +++ b/executor/syscalls.h @@ -15917,6 +15917,7 @@ const call_t syscalls[] = { {"ioctl$BIOCSRSIG", 54}, {"ioctl$BIOCSRTIMEOUT", 54}, {"ioctl$BIOCVERSION", 54}, + {"ioctl$DIOCMAP", 54}, {"ioctl$FIOASYNC", 54}, {"ioctl$FIOGETOWN", 54}, {"ioctl$FIONBIO", 54}, @@ -16049,6 +16050,7 @@ const call_t syscalls[] = { {"open$dir", 5}, {"openat", 321}, {"openat$bpf", 321}, + {"openat$diskmap", 321}, {"openat$klog", 321}, {"openat$null", 321}, {"openat$pci", 321}, diff --git a/sys/openbsd/dev_diskmap.txt b/sys/openbsd/dev_diskmap.txt new file mode 100644 index 000000000..64c937a6e --- /dev/null +++ b/sys/openbsd/dev_diskmap.txt @@ -0,0 +1,23 @@ +# Copyright 2019 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +include <sys/param.h> +include <sys/ioctl.h> +include <sys/fcntl.h> + +include <sys/disk.h> +include <sys/dkio.h> + +resource fd_diskmap[fd] + +openat$diskmap(fd const[AT_FDCWD], file ptr[in, string["/dev/diskmap"]], flags flags[open_flags], mode const[0]) fd_diskmap + +ioctl$DIOCMAP(fd fd_diskmap, cmd const[DIOCMAP], arg ptr[in, dk_diskmap]) + +dk_diskmap { + device ptr[in, filename] + fd fd + flags flags[dk_diskmap_flags, int32] +} + +dk_diskmap_flags = DM_OPENPART, DM_OPENBLCK diff --git a/sys/openbsd/dev_diskmap_amd64.const b/sys/openbsd/dev_diskmap_amd64.const new file mode 100644 index 000000000..b63cb231d --- /dev/null +++ b/sys/openbsd/dev_diskmap_amd64.const @@ -0,0 +1,7 @@ +# AUTOGENERATED FILE +AT_FDCWD = 18446744073709551516 +DIOCMAP = 3222299767 +DM_OPENBLCK = 2 +DM_OPENPART = 1 +SYS_ioctl = 54 +SYS_openat = 321 diff --git a/sys/openbsd/gen/amd64.go b/sys/openbsd/gen/amd64.go index 77554810b..3ff9c8dd3 100644 --- a/sys/openbsd/gen/amd64.go +++ b/sys/openbsd/gen/amd64.go @@ -15,6 +15,7 @@ var resources_amd64 = []*ResourceDesc{ {Name: "fd", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_bpf", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_bpf"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_dir", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_dir"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, + {Name: "fd_diskmap", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_diskmap"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_klog", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_klog"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_kqueue", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_kqueue"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_pci", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_pci"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, @@ -89,6 +90,11 @@ var structDescs_amd64 = []*KeyedStruct{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "type", TypeSize: 4}}, Val: 1}, &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "fds", IsVarlen: true}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", TypeSize: 4}}}, }, AlignAttr: 8}}, + {Key: StructKey{Name: "dk_diskmap"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "dk_diskmap", TypeSize: 16}, Fields: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "device", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "dk_diskmap_flags", FldName: "flags", TypeSize: 4}}, Vals: []uint64{1, 2}, BitMask: true}, + }}}, {Key: StructKey{Name: "fd_set", Dir: 2}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "fd_set", TypeSize: 64, ArgDir: 2}, Fields: []Type{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "mask0", TypeSize: 8, ArgDir: 2}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "mask1", TypeSize: 8, ArgDir: 2}}}, @@ -1200,6 +1206,11 @@ var syscalls_amd64 = []*Syscall{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 1074020977}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "bpf_version", Dir: 1}}}, }}, + {NR: 54, Name: "ioctl$DIOCMAP", CallName: "ioctl", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_diskmap", FldName: "fd", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 3222299767}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "dk_diskmap"}}}, + }}, {NR: 54, Name: "ioctl$FIOASYNC", CallName: "ioctl", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 2147772029}, @@ -1838,6 +1849,12 @@ var syscalls_amd64 = []*Syscall{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 8, 512, 1024, 2048, 16, 32, 256, 65536, 128, 128, 128, 32768, 131072, 64}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}}, }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_bpf", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, + {NR: 321, Name: "openat$diskmap", CallName: "openat", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", TypeSize: 13}, Kind: 2, Values: []string{"/dev/diskmap\x00"}}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 8, 512, 1024, 2048, 16, 32, 256, 65536, 128, 128, 128, 32768, 131072, 64}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}}, + }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_diskmap", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 321, Name: "openat$klog", CallName: "openat", Args: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", TypeSize: 10}, Kind: 2, Values: []string{"/dev/klog\x00"}}}, @@ -2444,6 +2461,9 @@ var consts_amd64 = []ConstValue{ {Name: "CLOCK_PROCESS_CPUTIME_ID", Value: 2}, {Name: "CLOCK_REALTIME"}, {Name: "CLOCK_THREAD_CPUTIME_ID", Value: 4}, + {Name: "DIOCMAP", Value: 3222299767}, + {Name: "DM_OPENBLCK", Value: 2}, + {Name: "DM_OPENPART", Value: 1}, {Name: "EVFILT_AIO", Value: 18446744073709551613}, {Name: "EVFILT_DEVICE", Value: 18446744073709551608}, {Name: "EVFILT_PROC", Value: 18446744073709551611}, @@ -2981,4 +3001,4 @@ var consts_amd64 = []ConstValue{ {Name: "__MAP_NOREPLACE", Value: 2048}, } -const revision_amd64 = "7f4015fe5d4b3777d30d2d5dd379e3de766e0e8e" +const revision_amd64 = "33de16487cc0a0d25eaa32ea4166bbbc75d2994e" |
