aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Hansbrough <flowerhack@google.com>2018-03-20 12:12:01 -0700
committerDmitry Vyukov <dvyukov@google.com>2018-03-21 09:50:47 +0100
commit040e73d644ee4124adfc744cbb81075b863c2b19 (patch)
treebacec2e1454c79a4742b3aac5512e0e392d974ea
parent113a43ffb67d4297d8d2e6ee39c8a0a23420db99 (diff)
fuchsia: Fix the `extractor` tool.
The include path in Zircon has changed; updated syz-extract/fuchsia.go to include this, and re-ran extract to get updated *.const files.
-rw-r--r--executor/syscalls_fuchsia.h4
-rw-r--r--sys/fuchsia/amd64.go38
-rw-r--r--sys/fuchsia/arm64.go38
-rw-r--r--sys/fuchsia/posix_amd64.const30
-rw-r--r--sys/fuchsia/posix_arm64.const30
-rw-r--r--sys/fuchsia/sys_amd64.const4
-rw-r--r--sys/fuchsia/sys_arm64.const4
-rw-r--r--sys/syz-extract/fuchsia.go3
-rw-r--r--sys/targets/targets.go14
9 files changed, 80 insertions, 85 deletions
diff --git a/executor/syscalls_fuchsia.h b/executor/syscalls_fuchsia.h
index faec7cc7b..c7c7448cf 100644
--- a/executor/syscalls_fuchsia.h
+++ b/executor/syscalls_fuchsia.h
@@ -2,7 +2,7 @@
#if defined(__x86_64__) || 0
#define GOARCH "amd64"
-#define SYZ_REVISION "0a0b28e30dc33e2b0423bc11f59c8ea2ea705725"
+#define SYZ_REVISION "7b78fbcff5be58d55fce6250972288b9c5141689"
#define SYZ_PAGE_SIZE 4096
#define SYZ_NUM_PAGES 4096
#define SYZ_DATA_OFFSET 536870912
@@ -178,7 +178,7 @@ call_t syscalls[] = {
#if defined(__aarch64__) || 0
#define GOARCH "arm64"
-#define SYZ_REVISION "74a573534e65437e0464d61c1a66a2c76d5388e9"
+#define SYZ_REVISION "545421122ef05f52e8f98342789ed868018b192b"
#define SYZ_PAGE_SIZE 4096
#define SYZ_NUM_PAGES 4096
#define SYZ_DATA_OFFSET 536870912
diff --git a/sys/fuchsia/amd64.go b/sys/fuchsia/amd64.go
index e4fd1f51e..7ea106ece 100644
--- a/sys/fuchsia/amd64.go
+++ b/sys/fuchsia/amd64.go
@@ -257,7 +257,7 @@ var syscalls_amd64 = []*Syscall{
{Name: "dup3", CallName: "dup3", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "oldfd", TypeSize: 4}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "newfd", TypeSize: 4}},
- &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "dup_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{524288}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "dup_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{256}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{Name: "faccessat", CallName: "faccessat", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "dirfd", TypeSize: 4}},
@@ -355,13 +355,13 @@ var syscalls_amd64 = []*Syscall{
}},
{Name: "open", CallName: "open", Args: []Type{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
- &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 1024, 8192, 524288, 64, 16384, 65536, 128, 32768, 262144, 256, 131072, 2048, 2097152, 1052672, 512}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 1048576, 1024, 256, 65536, 2048, 524288, 131072, 4096, 8192, 512, 128, 16, 4194304, 96, 262144}},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_mode", FldName: "mode", TypeSize: 8}}, Vals: []uint64{256, 128, 64, 32, 16, 8, 4, 2, 1}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{Name: "openat", CallName: "openat", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
- &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 1024, 8192, 524288, 64, 16384, 65536, 128, 32768, 262144, 256, 131072, 2048, 2097152, 1052672, 512}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 1048576, 1024, 256, 65536, 2048, 524288, 131072, 4096, 8192, 512, 128, 16, 4194304, 96, 262144}},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_mode", FldName: "mode", TypeSize: 8}}, Vals: []uint64{256, 128, 64, 32, 16, 8, 4, 2, 1}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{Name: "poll", CallName: "poll", Args: []Type{
@@ -1099,27 +1099,27 @@ var consts_amd64 = []ConstValue{
{Name: "AT_REMOVEDIR", Value: 512},
{Name: "AT_SYMLINK_FOLLOW", Value: 1024},
{Name: "AT_SYMLINK_NOFOLLOW", Value: 256},
- {Name: "FASYNC", Value: 8192},
+ {Name: "FASYNC", Value: 1024},
{Name: "LOCK_EX", Value: 2},
{Name: "LOCK_NB", Value: 4},
{Name: "LOCK_SH", Value: 1},
{Name: "LOCK_UN", Value: 8},
- {Name: "O_APPEND", Value: 1024},
- {Name: "O_CLOEXEC", Value: 524288},
- {Name: "O_CREAT", Value: 64},
- {Name: "O_DIRECT", Value: 16384},
- {Name: "O_DIRECTORY", Value: 65536},
- {Name: "O_EXCL", Value: 128},
- {Name: "O_LARGEFILE", Value: 32768},
- {Name: "O_NOATIME", Value: 262144},
- {Name: "O_NOCTTY", Value: 256},
- {Name: "O_NOFOLLOW", Value: 131072},
- {Name: "O_NONBLOCK", Value: 2048},
- {Name: "O_PATH", Value: 2097152},
+ {Name: "O_APPEND", Value: 1048576},
+ {Name: "O_CLOEXEC", Value: 256},
+ {Name: "O_CREAT", Value: 65536},
+ {Name: "O_DIRECT", Value: 2048},
+ {Name: "O_DIRECTORY", Value: 524288},
+ {Name: "O_EXCL", Value: 131072},
+ {Name: "O_LARGEFILE", Value: 4096},
+ {Name: "O_NOATIME", Value: 8192},
+ {Name: "O_NOCTTY", Value: 512},
+ {Name: "O_NOFOLLOW", Value: 128},
+ {Name: "O_NONBLOCK", Value: 16},
+ {Name: "O_PATH", Value: 4194304},
{Name: "O_RDONLY"},
{Name: "O_RDWR", Value: 2},
- {Name: "O_SYNC", Value: 1052672},
- {Name: "O_TRUNC", Value: 512},
+ {Name: "O_SYNC", Value: 96},
+ {Name: "O_TRUNC", Value: 262144},
{Name: "O_WRONLY", Value: 1},
{Name: "POLLERR", Value: 8},
{Name: "POLLHUP", Value: 16},
@@ -1244,4 +1244,4 @@ var consts_amd64 = []ConstValue{
{Name: "ZX_WAIT_ASYNC_REPEATING", Value: 1},
}
-const revision_amd64 = "0a0b28e30dc33e2b0423bc11f59c8ea2ea705725"
+const revision_amd64 = "7b78fbcff5be58d55fce6250972288b9c5141689"
diff --git a/sys/fuchsia/arm64.go b/sys/fuchsia/arm64.go
index badf41e7c..d735c39ca 100644
--- a/sys/fuchsia/arm64.go
+++ b/sys/fuchsia/arm64.go
@@ -257,7 +257,7 @@ var syscalls_arm64 = []*Syscall{
{Name: "dup3", CallName: "dup3", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "oldfd", TypeSize: 4}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "newfd", TypeSize: 4}},
- &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "dup_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{524288}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "dup_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{256}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{Name: "faccessat", CallName: "faccessat", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "dirfd", TypeSize: 4}},
@@ -355,13 +355,13 @@ var syscalls_arm64 = []*Syscall{
}},
{Name: "open", CallName: "open", Args: []Type{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
- &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 1024, 8192, 524288, 64, 16384, 65536, 128, 32768, 262144, 256, 131072, 2048, 2097152, 1052672, 512}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 1048576, 1024, 256, 65536, 2048, 524288, 131072, 4096, 8192, 512, 128, 16, 4194304, 96, 262144}},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_mode", FldName: "mode", TypeSize: 8}}, Vals: []uint64{256, 128, 64, 32, 16, 8, 4, 2, 1}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{Name: "openat", CallName: "openat", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
- &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 1024, 8192, 524288, 64, 16384, 65536, 128, 32768, 262144, 256, 131072, 2048, 2097152, 1052672, 512}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 1048576, 1024, 256, 65536, 2048, 524288, 131072, 4096, 8192, 512, 128, 16, 4194304, 96, 262144}},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_mode", FldName: "mode", TypeSize: 8}}, Vals: []uint64{256, 128, 64, 32, 16, 8, 4, 2, 1}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{Name: "poll", CallName: "poll", Args: []Type{
@@ -1099,27 +1099,27 @@ var consts_arm64 = []ConstValue{
{Name: "AT_REMOVEDIR", Value: 512},
{Name: "AT_SYMLINK_FOLLOW", Value: 1024},
{Name: "AT_SYMLINK_NOFOLLOW", Value: 256},
- {Name: "FASYNC", Value: 8192},
+ {Name: "FASYNC", Value: 1024},
{Name: "LOCK_EX", Value: 2},
{Name: "LOCK_NB", Value: 4},
{Name: "LOCK_SH", Value: 1},
{Name: "LOCK_UN", Value: 8},
- {Name: "O_APPEND", Value: 1024},
- {Name: "O_CLOEXEC", Value: 524288},
- {Name: "O_CREAT", Value: 64},
- {Name: "O_DIRECT", Value: 16384},
- {Name: "O_DIRECTORY", Value: 65536},
- {Name: "O_EXCL", Value: 128},
- {Name: "O_LARGEFILE", Value: 32768},
- {Name: "O_NOATIME", Value: 262144},
- {Name: "O_NOCTTY", Value: 256},
- {Name: "O_NOFOLLOW", Value: 131072},
- {Name: "O_NONBLOCK", Value: 2048},
- {Name: "O_PATH", Value: 2097152},
+ {Name: "O_APPEND", Value: 1048576},
+ {Name: "O_CLOEXEC", Value: 256},
+ {Name: "O_CREAT", Value: 65536},
+ {Name: "O_DIRECT", Value: 2048},
+ {Name: "O_DIRECTORY", Value: 524288},
+ {Name: "O_EXCL", Value: 131072},
+ {Name: "O_LARGEFILE", Value: 4096},
+ {Name: "O_NOATIME", Value: 8192},
+ {Name: "O_NOCTTY", Value: 512},
+ {Name: "O_NOFOLLOW", Value: 128},
+ {Name: "O_NONBLOCK", Value: 16},
+ {Name: "O_PATH", Value: 4194304},
{Name: "O_RDONLY"},
{Name: "O_RDWR", Value: 2},
- {Name: "O_SYNC", Value: 1052672},
- {Name: "O_TRUNC", Value: 512},
+ {Name: "O_SYNC", Value: 96},
+ {Name: "O_TRUNC", Value: 262144},
{Name: "O_WRONLY", Value: 1},
{Name: "POLLERR", Value: 8},
{Name: "POLLHUP", Value: 16},
@@ -1244,4 +1244,4 @@ var consts_arm64 = []ConstValue{
{Name: "ZX_WAIT_ASYNC_REPEATING", Value: 1},
}
-const revision_arm64 = "74a573534e65437e0464d61c1a66a2c76d5388e9"
+const revision_arm64 = "545421122ef05f52e8f98342789ed868018b192b"
diff --git a/sys/fuchsia/posix_amd64.const b/sys/fuchsia/posix_amd64.const
index 424b63c15..e3afc41c6 100644
--- a/sys/fuchsia/posix_amd64.const
+++ b/sys/fuchsia/posix_amd64.const
@@ -5,27 +5,27 @@ AT_NO_AUTOMOUNT = 2048
AT_REMOVEDIR = 512
AT_SYMLINK_FOLLOW = 1024
AT_SYMLINK_NOFOLLOW = 256
-FASYNC = 8192
+FASYNC = 1024
LOCK_EX = 2
LOCK_NB = 4
LOCK_SH = 1
LOCK_UN = 8
-O_APPEND = 1024
-O_CLOEXEC = 524288
-O_CREAT = 64
-O_DIRECT = 16384
-O_DIRECTORY = 65536
-O_EXCL = 128
-O_LARGEFILE = 32768
-O_NOATIME = 262144
-O_NOCTTY = 256
-O_NOFOLLOW = 131072
-O_NONBLOCK = 2048
-O_PATH = 2097152
+O_APPEND = 1048576
+O_CLOEXEC = 256
+O_CREAT = 65536
+O_DIRECT = 2048
+O_DIRECTORY = 524288
+O_EXCL = 131072
+O_LARGEFILE = 4096
+O_NOATIME = 8192
+O_NOCTTY = 512
+O_NOFOLLOW = 128
+O_NONBLOCK = 16
+O_PATH = 4194304
O_RDONLY = 0
O_RDWR = 2
-O_SYNC = 1052672
-O_TRUNC = 512
+O_SYNC = 96
+O_TRUNC = 262144
O_WRONLY = 1
POLLERR = 8
POLLHUP = 16
diff --git a/sys/fuchsia/posix_arm64.const b/sys/fuchsia/posix_arm64.const
index 424b63c15..e3afc41c6 100644
--- a/sys/fuchsia/posix_arm64.const
+++ b/sys/fuchsia/posix_arm64.const
@@ -5,27 +5,27 @@ AT_NO_AUTOMOUNT = 2048
AT_REMOVEDIR = 512
AT_SYMLINK_FOLLOW = 1024
AT_SYMLINK_NOFOLLOW = 256
-FASYNC = 8192
+FASYNC = 1024
LOCK_EX = 2
LOCK_NB = 4
LOCK_SH = 1
LOCK_UN = 8
-O_APPEND = 1024
-O_CLOEXEC = 524288
-O_CREAT = 64
-O_DIRECT = 16384
-O_DIRECTORY = 65536
-O_EXCL = 128
-O_LARGEFILE = 32768
-O_NOATIME = 262144
-O_NOCTTY = 256
-O_NOFOLLOW = 131072
-O_NONBLOCK = 2048
-O_PATH = 2097152
+O_APPEND = 1048576
+O_CLOEXEC = 256
+O_CREAT = 65536
+O_DIRECT = 2048
+O_DIRECTORY = 524288
+O_EXCL = 131072
+O_LARGEFILE = 4096
+O_NOATIME = 8192
+O_NOCTTY = 512
+O_NOFOLLOW = 128
+O_NONBLOCK = 16
+O_PATH = 4194304
O_RDONLY = 0
O_RDWR = 2
-O_SYNC = 1052672
-O_TRUNC = 512
+O_SYNC = 96
+O_TRUNC = 262144
O_WRONLY = 1
POLLERR = 8
POLLHUP = 16
diff --git a/sys/fuchsia/sys_amd64.const b/sys/fuchsia/sys_amd64.const
deleted file mode 100644
index bfb0651e3..000000000
--- a/sys/fuchsia/sys_amd64.const
+++ /dev/null
@@ -1,4 +0,0 @@
-# AUTOGENERATED FILE
-ZX_CLOCK_MONOTONIC = 0
-ZX_CLOCK_THREAD = 2
-ZX_CLOCK_UTC = 1
diff --git a/sys/fuchsia/sys_arm64.const b/sys/fuchsia/sys_arm64.const
deleted file mode 100644
index bfb0651e3..000000000
--- a/sys/fuchsia/sys_arm64.const
+++ /dev/null
@@ -1,4 +0,0 @@
-# AUTOGENERATED FILE
-ZX_CLOCK_MONOTONIC = 0
-ZX_CLOCK_THREAD = 2
-ZX_CLOCK_UTC = 1
diff --git a/sys/syz-extract/fuchsia.go b/sys/syz-extract/fuchsia.go
index b0ed84edf..cff005783 100644
--- a/sys/syz-extract/fuchsia.go
+++ b/sys/syz-extract/fuchsia.go
@@ -25,8 +25,9 @@ func (*fuchsia) prepareArch(arch *Arch) error {
func (*fuchsia) processFile(arch *Arch, info *compiler.ConstInfo) (map[string]uint64, map[string]bool, error) {
dir := arch.sourceDir
+ headerArch := arch.target.KernelHeaderArch
cc := filepath.Join(dir, "buildtools", "linux-x64", "clang", "bin", "clang")
- includeDir := filepath.Join(dir, "out", "build-zircon", "build-user-x86-64", "sysroot", "include")
+ includeDir := filepath.Join(dir, "out", "build-zircon", "build-"+headerArch, "sysroot", "include")
args := []string{"-fmessage-length=0", "-I" + includeDir}
for _, incdir := range info.Incdirs {
args = append(args, "-I"+filepath.Join(dir, incdir))
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index a40121c47..af946e3eb 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -118,14 +118,16 @@ var List = map[string]map[string]*Target{
},
"fuchsia": map[string]*Target{
"amd64": {
- PtrSize: 8,
- PageSize: 4 << 10,
- CArch: []string{"__x86_64__"},
+ PtrSize: 8,
+ PageSize: 4 << 10,
+ CArch: []string{"__x86_64__"},
+ KernelHeaderArch: "x64",
},
"arm64": {
- PtrSize: 8,
- PageSize: 4 << 10,
- CArch: []string{"__aarch64__"},
+ PtrSize: 8,
+ PageSize: 4 << 10,
+ CArch: []string{"__aarch64__"},
+ KernelHeaderArch: "arm64",
},
},
"windows": map[string]*Target{