[libvirt] [PATCH 4/7] qemu: Fix segfault if defining a domain without <seclabel>

Eric Blake eblake at redhat.com
Wed Jan 12 20:32:52 UTC 2011


On 01/12/2011 10:23 AM, Cole Robinson wrote:
> If the selinux driver is the default, it will lead to a null dereference.
> This change should still yeild the intended result, since a null model
> basically implies 'use the default'.
> 
> Signed-off-by: Cole Robinson <crobinso at redhat.com>
> ---
>  src/security/security_driver.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/src/security/security_driver.c b/src/security/security_driver.c
> index 5711aee..7d2e0de 100644
> --- a/src/security/security_driver.c
> +++ b/src/security/security_driver.c
> @@ -82,7 +82,8 @@ virSecurityIsSpecifiedDriver(virSecurityManagerPtr mgr,
>  {
>      bool ret = true;
>  
> -    if (!STREQ(virSecurityManagerGetModel(mgr), def->seclabel.model)) {
> +    if (def->seclabel.model &&
> +        !STREQ(virSecurityManagerGetModel(mgr), def->seclabel.model)) {

ACK; and this probably also fixes segfaults for other drivers given your
3/7 cleanup.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110112/a1696193/attachment-0001.sig>


More information about the libvir-list mailing list