From 8b314b0bf402da58f90ccaac852a880d375f0885 Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Tue, 20 Nov 2018 15:07:12 -0800 Subject: 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 --- pkg/sentry/syscalls/linux/sys_seccomp.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'pkg/sentry/syscalls') 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). -- cgit v1.2.3