diff options
author | Fabricio Voznika <fvoznika@google.com> | 2018-11-20 15:07:12 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-11-20 15:07:56 -0800 |
commit | 8b314b0bf402da58f90ccaac852a880d375f0885 (patch) | |
tree | ecda63a0e2b2329c4967be7d8af560bd4605a496 /pkg/sentry/syscalls | |
parent | 03c1eb78b583ca3247f299889146675311727325 (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.go | 7 |
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). |