[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v10 16/17] xen/arm: vpci: permit access to guest vpci space


  • To: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 16 Oct 2023 13:00:09 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vTvpCDNycz5IKQRIM9uOXTLLSFdTeTBE0ZY8+2XZobk=; b=NqYU/hDOgDzIqTJwYLw5gUe8ns+lLY/IjoJoi1mn2D4QnzJPnyEG4sARNSc7lnskzVTANh+6aYXfocMRUZ+eDzOfRw9pz/kcnPY/hgw3L2H35t88ofEsrLbL9244iozI3YpEqsjeG7wfu0lQ9bOuTHtw0GZJ9orFlAzDt/MovY4sEwGdkfJDYQBsO6rX3oftf+40FVAZ75Jq520O/KPJHbyu+YZsadhiJewLizuJVZbJLRoIYrhyU7kc2m3miKbw9aNMU1w32sLSBoULKSvWKpxSq/lxsOQGpilSnlZm5X9iyH4PopcL477d+q4F3SbHMBE6L45PXRbEm5zMzq7U7A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TJdUB1Tpp6zqXfDvOr7kpGN+5+p6gzpQgc0bFQzileKPksVB+jVw0SdI+zpYNlOegpy1OXMsgukXl1Mj8TDLb9eFLv+2287XNV6zHhppE/ZEE3HTQcBjikg5M3K2QW1UH+tip26I03CWcsTi8iy5ChjOlty94l2Si+XOohwFGoQmiJ+Dy9Rjav06wX2Q8JfpDbUBsfNxDn3Tggvy5nrrULhHiI5pdlMcMjXW2b8vSYshHFARN06gLngMYTnQxG09P97AeU+sE9SLqMTEzr2TlnLaujzSB1f3l/ottuv5VAhpxg3IgKMyz48G389zcRgNquetVz22A+yI6FtGMp66vQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 16 Oct 2023 11:00:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.10.2023 00:09, Volodymyr Babchuk wrote:
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -695,6 +695,9 @@ struct domain *domain_create(domid_t domid,
>          radix_tree_init(&d->pirq_tree);
>      }
>  
> +    if ( !is_idle_domain(d) )
> +        d->iomem_caps = rangeset_new(d, "I/O Memory", 
> RANGESETF_prettyprint_hex);
> +
>      if ( (err = arch_domain_create(d, config, flags)) != 0 )
>          goto fail;
>      init_status |= INIT_arch;
> @@ -704,7 +707,6 @@ struct domain *domain_create(domid_t domid,
>          watchdog_domain_init(d);
>          init_status |= INIT_watchdog;
>  
> -        d->iomem_caps = rangeset_new(d, "I/O Memory", 
> RANGESETF_prettyprint_hex);
>          d->irq_caps   = rangeset_new(d, "Interrupts", 0);
>          if ( !d->iomem_caps || !d->irq_caps )
>              goto fail;

It's not really logical to move one, not both. Plus you didn't move the
error check, so if the earlier initialization is really needed, you set
things up for a NULL deref.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.