From 924f7606047a430a9b313c135b782e1e8f852bec Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 15 Mar 2020 21:16:13 +0100 Subject: pkg/compiler: ensure consistency of syscall argument types Ensure that we don't have conflicting sizes for the same argument of the same syscall, e.g.: foo$1(a int16) foo$2(a int32) This is useful for several reasons: - we will be able avoid morphing syscalls into other syscalls - we will be able to figure out more precise sizes for args (lots of them are implicitly intptr, which is the largest type on most important arches) - found few bugs in linux descriptions Update #477 Update #502 --- executor/defs.h | 20 +++++----- executor/syscalls.h | 110 +++++++++++++++++++++++++--------------------------- 2 files changed, 62 insertions(+), 68 deletions(-) (limited to 'executor') diff --git a/executor/defs.h b/executor/defs.h index 98f4b3e97..377398fe0 100644 --- a/executor/defs.h +++ b/executor/defs.h @@ -70,7 +70,7 @@ #if GOARCH_386 #define GOARCH "386" -#define SYZ_REVISION "33b5499ae4ba720a5aadcf47c08c27e96fb67832" +#define SYZ_REVISION "6480754ea5878e2efb25d917123a1896b8b359cf" #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 "57e792b4f9c2dfd15302bc6d8af296a1ad069360" +#define SYZ_REVISION "a8fe352537df3c64061c651b2f9e153c9c83549f" #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 "73ab90b4fe32667fb8aeeede21c4e40d90f162f3" +#define SYZ_REVISION "3444839b3d1c062c3a509ba2db0628bda1758722" #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 "89f29368f6fde3dc0f3b6681a6a51a0e2329992c" +#define SYZ_REVISION "640aa823f49ff10cee6488cdec66c2e901f3dbba" #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 "8587350b245052b7ccf5ed9a0302a1a9cb79afc8" +#define SYZ_REVISION "f2309786b1dffa004441418c674c98470ccb455e" #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 "88f13870a768fc9d901f0b86e93664821fa28696" +#define SYZ_REVISION "cfce92797252d85d92e3aff56effff2e2e3e8c45" #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 "c547f9f5ad5a787ba3d546567452faa30af14525" +#define SYZ_REVISION "9de9df2edf17935a28af03116105b78e58013838" #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 "78cf24e0e4b13952ef5ce2921f4b41ad71693243" +#define SYZ_REVISION "b3b0c6ea907ce870e7e4b25b9308c2425d0e8cf3" #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 "11680783018363ee3ca3e0a484f2487a560a21d1" +#define SYZ_REVISION "f21fe2c3f1b0e63ded6b9ee4a51a36aa1f8b5dc0" #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 "399d53d555b219a495bc162e62986d7cb16952d5" +#define SYZ_REVISION "647e31ffe8e7096502c33d49da123323314ec0da" #define SYZ_EXECUTOR_USES_FORK_SERVER 1 #define SYZ_EXECUTOR_USES_SHMEM 0 #define SYZ_PAGE_SIZE 8192 diff --git a/executor/syscalls.h b/executor/syscalls.h index c2af7244e..054c62f0b 100644 --- a/executor/syscalls.h +++ b/executor/syscalls.h @@ -2610,7 +2610,6 @@ const call_t syscalls[] = { {"ioctl$CAPI_NCCI_OPENCOUNT", 54}, {"ioctl$CAPI_REGISTER", 54}, {"ioctl$CAPI_SET_FLAGS", 54}, - {"ioctl$CDROMAUDIOBUFSIZ", 54}, {"ioctl$CDROMCLOSETRAY", 54}, {"ioctl$CDROMEJECT", 54}, {"ioctl$CDROMEJECT_SW", 54}, @@ -5957,7 +5956,6 @@ const call_t syscalls[] = { {"ioctl$CAPI_NCCI_OPENCOUNT", 16}, {"ioctl$CAPI_REGISTER", 16}, {"ioctl$CAPI_SET_FLAGS", 16}, - {"ioctl$CDROMAUDIOBUFSIZ", 16}, {"ioctl$CDROMCLOSETRAY", 16}, {"ioctl$CDROMEJECT", 16}, {"ioctl$CDROMEJECT_SW", 16}, @@ -9301,7 +9299,6 @@ const call_t syscalls[] = { {"ioctl$CAPI_NCCI_OPENCOUNT", 54}, {"ioctl$CAPI_REGISTER", 54}, {"ioctl$CAPI_SET_FLAGS", 54}, - {"ioctl$CDROMAUDIOBUFSIZ", 54}, {"ioctl$CDROMCLOSETRAY", 54}, {"ioctl$CDROMEJECT", 54}, {"ioctl$CDROMEJECT_SW", 54}, @@ -12594,7 +12591,6 @@ const call_t syscalls[] = { {"ioctl$CAPI_NCCI_OPENCOUNT", 29}, {"ioctl$CAPI_REGISTER", 29}, {"ioctl$CAPI_SET_FLAGS", 29}, - {"ioctl$CDROMAUDIOBUFSIZ", 29}, {"ioctl$CDROMCLOSETRAY", 29}, {"ioctl$CDROMEJECT", 29}, {"ioctl$CDROMEJECT_SW", 29}, @@ -15882,7 +15878,6 @@ const call_t syscalls[] = { {"ioctl$CAPI_NCCI_OPENCOUNT", 5015}, {"ioctl$CAPI_REGISTER", 5015}, {"ioctl$CAPI_SET_FLAGS", 5015}, - {"ioctl$CDROMAUDIOBUFSIZ", 5015}, {"ioctl$CDROMCLOSETRAY", 5015}, {"ioctl$CDROMEJECT", 5015}, {"ioctl$CDROMEJECT_SW", 5015}, @@ -19086,7 +19081,6 @@ const call_t syscalls[] = { {"ioctl$CAPI_NCCI_OPENCOUNT", 54}, {"ioctl$CAPI_REGISTER", 54}, {"ioctl$CAPI_SET_FLAGS", 54}, - {"ioctl$CDROMAUDIOBUFSIZ", 54}, {"ioctl$CDROMCLOSETRAY", 54}, {"ioctl$CDROMEJECT", 54}, {"ioctl$CDROMEJECT_SW", 54}, @@ -22424,16 +22418,6 @@ const call_t syscalls[] = { {"foo$fmt4", 0}, {"foo$fmt5", 0}, {"minimize$0", 0}, - {"mutate$array", 0}, - {"mutate$array2", 0}, - {"mutate$buffer", 0}, - {"mutate$flags", 0}, - {"mutate$flags2", 0}, - {"mutate$flags3", 0}, - {"mutate$integer", 0}, - {"mutate$integer2", 0}, - {"mutate$rangedbuffer", 0}, - {"mutate$union", 0}, {"mutate0", 0}, {"mutate1", 0}, {"mutate2", 0}, @@ -22443,6 +22427,16 @@ const call_t syscalls[] = { {"mutate6", 0}, {"mutate7", 0}, {"mutate8", 0}, + {"mutate_array", 0}, + {"mutate_array2", 0}, + {"mutate_buffer", 0}, + {"mutate_flags", 0}, + {"mutate_flags2", 0}, + {"mutate_flags3", 0}, + {"mutate_integer", 0}, + {"mutate_integer2", 0}, + {"mutate_rangedbuffer", 0}, + {"mutate_union", 0}, {"prctl$PR_SET_SECCOMP", 0}, {"seccomp", 0}, {"serialize0", 0}, @@ -22480,8 +22474,6 @@ const call_t syscalls[] = { {"test$csum_ipv6_udp", 0}, {"test$end0", 0}, {"test$end1", 0}, - {"test$excessive_args1", 0}, - {"test$excessive_args2", 0}, {"test$excessive_fields1", 0}, {"test$hint_data", 0}, {"test$int", 0}, @@ -22492,7 +22484,6 @@ const call_t syscalls[] = { {"test$length12", 0}, {"test$length13", 0}, {"test$length14", 0}, - {"test$length15", 0}, {"test$length16", 0}, {"test$length17", 0}, {"test$length18", 0}, @@ -22548,6 +22539,9 @@ const call_t syscalls[] = { {"test$union1", 0}, {"test$union2", 0}, {"test$vma0", 0}, + {"test_excessive_args1", 0}, + {"test_excessive_args2", 0}, + {"test_length15", 0}, {"unsupported$0", 0}, {"unsupported$1", 0}, @@ -22567,16 +22561,6 @@ const call_t syscalls[] = { {"foo$fmt4", 0}, {"foo$fmt5", 0}, {"minimize$0", 0}, - {"mutate$array", 0}, - {"mutate$array2", 0}, - {"mutate$buffer", 0}, - {"mutate$flags", 0}, - {"mutate$flags2", 0}, - {"mutate$flags3", 0}, - {"mutate$integer", 0}, - {"mutate$integer2", 0}, - {"mutate$rangedbuffer", 0}, - {"mutate$union", 0}, {"mutate0", 0}, {"mutate1", 0}, {"mutate2", 0}, @@ -22586,6 +22570,16 @@ const call_t syscalls[] = { {"mutate6", 0}, {"mutate7", 0}, {"mutate8", 0}, + {"mutate_array", 0}, + {"mutate_array2", 0}, + {"mutate_buffer", 0}, + {"mutate_flags", 0}, + {"mutate_flags2", 0}, + {"mutate_flags3", 0}, + {"mutate_integer", 0}, + {"mutate_integer2", 0}, + {"mutate_rangedbuffer", 0}, + {"mutate_union", 0}, {"prctl$PR_SET_SECCOMP", 0}, {"seccomp", 0}, {"serialize0", 0}, @@ -22623,8 +22617,6 @@ const call_t syscalls[] = { {"test$csum_ipv6_udp", 0}, {"test$end0", 0}, {"test$end1", 0}, - {"test$excessive_args1", 0}, - {"test$excessive_args2", 0}, {"test$excessive_fields1", 0}, {"test$hint_data", 0}, {"test$int", 0}, @@ -22635,7 +22627,6 @@ const call_t syscalls[] = { {"test$length12", 0}, {"test$length13", 0}, {"test$length14", 0}, - {"test$length15", 0}, {"test$length16", 0}, {"test$length17", 0}, {"test$length18", 0}, @@ -22691,6 +22682,9 @@ const call_t syscalls[] = { {"test$union1", 0}, {"test$union2", 0}, {"test$vma0", 0}, + {"test_excessive_args1", 0}, + {"test_excessive_args2", 0}, + {"test_length15", 0}, {"unsupported$0", 0}, {"unsupported$1", 0}, @@ -22711,16 +22705,6 @@ const call_t syscalls[] = { {"foo$fmt4", 0}, {"foo$fmt5", 0}, {"minimize$0", 0}, - {"mutate$array", 0}, - {"mutate$array2", 0}, - {"mutate$buffer", 0}, - {"mutate$flags", 0}, - {"mutate$flags2", 0}, - {"mutate$flags3", 0}, - {"mutate$integer", 0}, - {"mutate$integer2", 0}, - {"mutate$rangedbuffer", 0}, - {"mutate$union", 0}, {"mutate0", 0}, {"mutate1", 0}, {"mutate2", 0}, @@ -22730,6 +22714,16 @@ const call_t syscalls[] = { {"mutate6", 0}, {"mutate7", 0}, {"mutate8", 0}, + {"mutate_array", 0}, + {"mutate_array2", 0}, + {"mutate_buffer", 0}, + {"mutate_flags", 0}, + {"mutate_flags2", 0}, + {"mutate_flags3", 0}, + {"mutate_integer", 0}, + {"mutate_integer2", 0}, + {"mutate_rangedbuffer", 0}, + {"mutate_union", 0}, {"prctl$PR_SET_SECCOMP", 0}, {"seccomp", 0}, {"serialize0", 0}, @@ -22767,8 +22761,6 @@ const call_t syscalls[] = { {"test$csum_ipv6_udp", 0}, {"test$end0", 0}, {"test$end1", 0}, - {"test$excessive_args1", 0}, - {"test$excessive_args2", 0}, {"test$excessive_fields1", 0}, {"test$hint_data", 0}, {"test$int", 0}, @@ -22779,7 +22771,6 @@ const call_t syscalls[] = { {"test$length12", 0}, {"test$length13", 0}, {"test$length14", 0}, - {"test$length15", 0}, {"test$length16", 0}, {"test$length17", 0}, {"test$length18", 0}, @@ -22835,6 +22826,9 @@ const call_t syscalls[] = { {"test$union1", 0}, {"test$union2", 0}, {"test$vma0", 0}, + {"test_excessive_args1", 0}, + {"test_excessive_args2", 0}, + {"test_length15", 0}, {"unsupported$0", 0}, {"unsupported$1", 0}, @@ -22854,16 +22848,6 @@ const call_t syscalls[] = { {"foo$fmt4", 0}, {"foo$fmt5", 0}, {"minimize$0", 0}, - {"mutate$array", 0}, - {"mutate$array2", 0}, - {"mutate$buffer", 0}, - {"mutate$flags", 0}, - {"mutate$flags2", 0}, - {"mutate$flags3", 0}, - {"mutate$integer", 0}, - {"mutate$integer2", 0}, - {"mutate$rangedbuffer", 0}, - {"mutate$union", 0}, {"mutate0", 0}, {"mutate1", 0}, {"mutate2", 0}, @@ -22873,6 +22857,16 @@ const call_t syscalls[] = { {"mutate6", 0}, {"mutate7", 0}, {"mutate8", 0}, + {"mutate_array", 0}, + {"mutate_array2", 0}, + {"mutate_buffer", 0}, + {"mutate_flags", 0}, + {"mutate_flags2", 0}, + {"mutate_flags3", 0}, + {"mutate_integer", 0}, + {"mutate_integer2", 0}, + {"mutate_rangedbuffer", 0}, + {"mutate_union", 0}, {"prctl$PR_SET_SECCOMP", 0}, {"seccomp", 0}, {"serialize0", 0}, @@ -22910,8 +22904,6 @@ const call_t syscalls[] = { {"test$csum_ipv6_udp", 0}, {"test$end0", 0}, {"test$end1", 0}, - {"test$excessive_args1", 0}, - {"test$excessive_args2", 0}, {"test$excessive_fields1", 0}, {"test$hint_data", 0}, {"test$int", 0}, @@ -22922,7 +22914,6 @@ const call_t syscalls[] = { {"test$length12", 0}, {"test$length13", 0}, {"test$length14", 0}, - {"test$length15", 0}, {"test$length16", 0}, {"test$length17", 0}, {"test$length18", 0}, @@ -22978,6 +22969,9 @@ const call_t syscalls[] = { {"test$union1", 0}, {"test$union2", 0}, {"test$vma0", 0}, + {"test_excessive_args1", 0}, + {"test_excessive_args2", 0}, + {"test_length15", 0}, {"unsupported$0", 0}, {"unsupported$1", 0}, -- cgit mrf-deployment