提交 7f72e6c3 编写于 作者: E Eric Blake

security: fix deadlock with prefork

https://bugzilla.redhat.com/show_bug.cgi?id=964358

Attempts to start a domain with both SELinux and DAC security
modules loaded will deadlock; latent problem introduced in commit
fdb3bde3 and exposed in commit 29fe5d74.  Basically, when recursing
into the security manager for other driver's prefork, we have to
undo the asymmetric lock taken at the manager level.

Reported by Jiri Denemark, with diagnosis help from Dan Berrange.

* src/security/security_stack.c (virSecurityStackPreFork): Undo
extra lock grabbed during recursion.
Signed-off-by: NEric Blake <eblake@redhat.com>
(cherry picked from commit bfc183c1)
上级 47d520cd
......@@ -129,6 +129,11 @@ virSecurityStackPreFork(virSecurityManagerPtr mgr)
rc = -1;
break;
}
/* Undo the unbalanced locking left behind after recursion; if
* PostFork ever delegates to driver callbacks, we'd instead
* need to recurse to an internal method that does not regrab
* a lock. */
virSecurityManagerPostFork(item->securityManager);
}
return rc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册