summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/syscalls
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2018-11-20 15:07:12 -0800
committerShentubot <shentubot@google.com>2018-11-20 15:07:56 -0800
commit8b314b0bf402da58f90ccaac852a880d375f0885 (patch)
treeecda63a0e2b2329c4967be7d8af560bd4605a496 /pkg/sentry/syscalls
parent03c1eb78b583ca3247f299889146675311727325 (diff)
Fix recursive read lock taken on TaskSet
SyncSyscallFiltersToThreadGroup and Task.TheadID() both acquired TaskSet RWLock in R mode and could deadlock if a writer comes in between. PiperOrigin-RevId: 222313551 Change-Id: I4221057d8d46fec544cbfa55765c9a284fe7ebfa
Diffstat (limited to 'pkg/sentry/syscalls')
-rw-r--r--pkg/sentry/syscalls/linux/sys_seccomp.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/pkg/sentry/syscalls/linux/sys_seccomp.go b/pkg/sentry/syscalls/linux/sys_seccomp.go
index 969acaa36..f08fdf5cb 100644
--- a/pkg/sentry/syscalls/linux/sys_seccomp.go
+++ b/pkg/sentry/syscalls/linux/sys_seccomp.go
@@ -68,12 +68,7 @@ func seccomp(t *kernel.Task, mode, flags uint64, addr usermem.Addr) error {
return syscall.EINVAL
}
- err = t.AppendSyscallFilter(compiledFilter)
- if err == nil && tsync {
- // Now we must copy this seccomp program to all other threads.
- err = t.SyncSyscallFiltersToThreadGroup()
- }
- return err
+ return t.AppendSyscallFilter(compiledFilter, tsync)
}
// Seccomp implements linux syscall seccomp(2).