aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-01-15 16:52:52 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-01-15 17:35:31 +0100
commitb803944b58cdc273bc8da9d09d9902e3ffa99904 (patch)
tree5a77bb1bdf2df79d745dc8159c3b2fc76bf184b4
parentba92288dcf9d20a05400b79fe74e1af585eebcdc (diff)
prog: don't add fallback coverage after prctl
The same reason as with seccomp.
-rw-r--r--executor/defs.h2
-rw-r--r--executor/syscalls.h1
-rw-r--r--prog/analysis.go5
-rw-r--r--prog/prog_test.go34
-rw-r--r--sys/test/gen/64.go4
-rw-r--r--sys/test/test.txt1
-rw-r--r--sys/test/test_64.const1
7 files changed, 44 insertions, 4 deletions
diff --git a/executor/defs.h b/executor/defs.h
index 44bea2f13..3bac6c14e 100644
--- a/executor/defs.h
+++ b/executor/defs.h
@@ -185,7 +185,7 @@
#if GOARCH_64
#define GOARCH "64"
-#define SYZ_REVISION "70ed4d89f5c1baa13983ab0123304d124539e73f"
+#define SYZ_REVISION "d0f62693719adf6dcc3c1b8507f98115b0e870a0"
#define SYZ_EXECUTOR_USES_FORK_SERVER 0
#define SYZ_EXECUTOR_USES_SHMEM 0
#define SYZ_PAGE_SIZE 4096
diff --git a/executor/syscalls.h b/executor/syscalls.h
index 07fa8ca32..0e1ac4e39 100644
--- a/executor/syscalls.h
+++ b/executor/syscalls.h
@@ -21713,6 +21713,7 @@ const call_t syscalls[] = {
{"mutate6", 0},
{"mutate7", 0},
{"mutate8", 0},
+ {"prctl$PR_SET_SECCOMP", 0},
{"seccomp", 0},
{"serialize0", 0},
{"serialize1", 0},
diff --git a/prog/analysis.go b/prog/analysis.go
index 519d5ba84..896ee4bd9 100644
--- a/prog/analysis.go
+++ b/prog/analysis.go
@@ -209,8 +209,9 @@ func (p *Prog) FallbackSignal(info []CallInfo) {
if inf.Errno != 0 {
continue
}
- if c.Meta.CallName == "seccomp" {
- // seccomp filter can produce arbitrary errno values for subsequent syscalls. Don't trust anything afterwards.
+ if c.Meta.CallName == "seccomp" || c.Meta.CallName == "prctl" {
+ // seccomp filter can produce arbitrary errno values for subsequent syscalls.
+ // Don't trust anything afterwards. prctl can setup seccomp too.
break
}
ForeachArg(c, func(arg Arg, _ *ArgCtx) {
diff --git a/prog/prog_test.go b/prog/prog_test.go
index a07657308..a246174f5 100644
--- a/prog/prog_test.go
+++ b/prog/prog_test.go
@@ -368,6 +368,40 @@ fallback$0()
},
},
},
+ {
+ `
+fallback$0()
+prctl$PR_SET_SECCOMP()
+fallback$0()
+prctl$PR_SET_SECCOMP()
+fallback$0()
+`,
+ []CallInfo{
+ {
+ Flags: CallExecuted,
+ Errno: 0,
+ Signal: make([]uint32, 1),
+ },
+ {
+ Flags: CallExecuted,
+ Errno: 1,
+ Signal: make([]uint32, 1),
+ },
+ {
+ Flags: CallExecuted,
+ Errno: 0,
+ Signal: make([]uint32, 1),
+ },
+ {
+ Flags: CallExecuted,
+ Errno: 0,
+ Signal: make([]uint32, 1),
+ },
+ {
+ Flags: CallExecuted,
+ },
+ },
+ },
}
target, err := GetTarget("test", "64")
if err != nil {
diff --git a/sys/test/gen/64.go b/sys/test/gen/64.go
index 5e0bdea01..20453ad98 100644
--- a/sys/test/gen/64.go
+++ b/sys/test/gen/64.go
@@ -1059,6 +1059,7 @@ var syscalls_64 = []*Syscall{
{Name: "mutate8", CallName: "mutate8", Args: []Type{
&ProcType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "proc", FldName: "a0", TypeSize: 8, IsOptional: true}}, ValuesStart: 100, ValuesPerProc: 4},
}},
+ {Name: "prctl$PR_SET_SECCOMP", CallName: "prctl"},
{Name: "seccomp", CallName: "seccomp"},
{Name: "serialize0", CallName: "serialize0", Args: []Type{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "serialize0_struct"}}},
@@ -1433,6 +1434,7 @@ var consts_64 = []ConstValue{
{Name: "SYS_mutate6"},
{Name: "SYS_mutate7"},
{Name: "SYS_mutate8"},
+ {Name: "SYS_prctl"},
{Name: "SYS_seccomp"},
{Name: "SYS_serialize0"},
{Name: "SYS_serialize1"},
@@ -1440,4 +1442,4 @@ var consts_64 = []ConstValue{
{Name: "SYS_unsupported"},
}
-const revision_64 = "70ed4d89f5c1baa13983ab0123304d124539e73f"
+const revision_64 = "d0f62693719adf6dcc3c1b8507f98115b0e870a0"
diff --git a/sys/test/test.txt b/sys/test/test.txt
index 44ff228df..2bae67c1e 100644
--- a/sys/test/test.txt
+++ b/sys/test/test.txt
@@ -787,6 +787,7 @@ foo$arch_specific_const_as_array_size(a ptr[in, array[int8, ARCH_64_SPECIFIC_CON
fallback$0() fd
fallback$1(a fd)
seccomp()
+prctl$PR_SET_SECCOMP()
# AUTO
diff --git a/sys/test/test_64.const b/sys/test/test_64.const
index f487af8fb..299b36219 100644
--- a/sys/test/test_64.const
+++ b/sys/test/test_64.const
@@ -16,6 +16,7 @@ SYS_test = 0
SYS_unsupported = 0
SYS_fallback = 0
SYS_seccomp = 0
+SYS_prctl = 0
IPPROTO_ICMPV6 = 58
IPPROTO_TCP = 6