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

Re: [Xen-devel] [PATCH] IOMMU: avoid NULL deref in iommu_lookup_page()



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> Sent: 14 May 2019 05:04
> To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
> Cc: Julien Grall <julien.grall@xxxxxxx>; Andrew Cooper 
> <Andrew.Cooper3@xxxxxxxxxx>; Paul Durrant
> <Paul.Durrant@xxxxxxxxxx>; Wei Liu <wei.liu2@xxxxxxxxxx>; George Dunlap 
> <George.Dunlap@xxxxxxxxxx>;
> Ian Jackson <Ian.Jackson@xxxxxxxxxx>; Stefano Stabellini 
> <sstabellini@xxxxxxxxxx>; Konrad Rzeszutek
> Wilk <konrad.wilk@xxxxxxxxxx>; Tim (Xen.org) <tim@xxxxxxx>
> Subject: [PATCH] IOMMU: avoid NULL deref in iommu_lookup_page()
> 
> Luckily the function currently has no callers - it would have called
> through NULL for both Arm and x86/AMD.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Paul Durrant <paul.durrant@xxxxxxxxxx>

> 
> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -409,7 +409,7 @@ int iommu_lookup_page(struct domain *d,
>  {
>      const struct domain_iommu *hd = dom_iommu(d);
> 
> -    if ( !iommu_enabled || !hd->platform_ops )
> +    if ( !iommu_enabled || !hd->platform_ops || 
> !hd->platform_ops->lookup_page )
>          return -EOPNOTSUPP;
> 
>      return hd->platform_ops->lookup_page(d, dfn, mfn, flags);
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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