xen/iommu: dt: Check the return value of xsm_deassign_dtdevice()
PATCH 1/1 xen/iommu: dt: Check the return value of xsm_deassign_dtdevice()
From: Julien Grall <[email protected]>
xsm_deasign_dtdevice() will indicate whether the caller is allowed to issue the operation. So the return value has to be checked.
Spotted by clang static analyzer.
---
Platform device-passthrough is not security supported. Hence why this is sent directly to xen-devel.
--- xen/drivers/passthrough/device_tree.c | 2 ++ 1 file changed, 2 insertions(+)
xen/drivers/passthrough/device_tree.c +2 -0
@@ -269,6 +269,8 @@ int iommu_do_dt_domctl(struct xen_domctl *domctl, struct domain *d,break ; ret =xsm_deassign_dtdevice (XSM_HOOK , d,dt_node_full_name (dev)); +if ( ret ) +break ;if ( d == dom_io )return -EINVAL ;
Signature · 1 line
2.32.0
Hi Julien,
Quoted 3 lines · Julien Grall
From: Julien Grall <[email protected]>
xsm_deasign_dtdevice()will indicate whether the caller is allowed
s/deasign/deassign/
Quoted 6 lines
to issue the operation. So the return value has to be checked.
Spotted by clang static analyzer.
Fixes fe36cccc483c ("xen/passthrough: Extend XEN_DOMCTL_*assign_device to support DT device")Signed-off-by Julien Grall <[email protected]>
Apart from that:
Quoted 1 line · Michal Orzel
Hi Julien,
Hi Michal,
Quoted 5 lines · Julien Grall
Quoted 3 lines
From: Julien Grall <[email protected]>
xsm_deasign_dtdevice()will indicate whether the caller is alloweds/deasign/deassign/
Good spot! I will fix it on commit unless there are any objections.
Quoted 10 lines
Quoted 7 lines
to issue the operation. So the return value has to be checked.
Spotted by clang static analyzer.
Fixes fe36cccc483c ("xen/passthrough: Extend XEN_DOMCTL_*assign_device to support DT device")Signed-off-by Julien Grall <[email protected]>Apart from that:
Reviewed-by Michal Orzel <[email protected]>
Thanks!
Cheers,
Signature · 1 line
Julien Grall
Hi Julien,
Quoted 11 lines · Julien Grall
From: Julien Grall <[email protected]>
xsm_deasign_dtdevice()will indicate whether the caller is allowed to issue the operation. So the return value has to be checked.Spotted by clang static analyzer.
Fixes fe36cccc483c ("xen/passthrough: Extend XEN_DOMCTL_*assign_device to support DT device")Signed-off-by Julien Grall <[email protected]>
With the typo spotted by Michal solved (can be done on commit):
Cheers
Bertrand
Quoted 26 lines
---
Platform device-passthrough is not security supported. Hence why this is sent directly to xen-devel.
---xen/drivers/passthrough/device_tree.c| 2 ++1 file changed, 2 insertions(+)xen/drivers/passthrough/device_tree.c +2
-0@@ -269,6 +269,8 @@ int iommu_do_dt_domctl(struct xen_domctl *domctl, struct domain *d,break ; ret =xsm_deassign_dtdevice (XSM_HOOK , d,dt_node_full_name (dev)); +if ( ret ) +break ;if ( d == dom_io )return -EINVAL ;Signature · 1 line
2.32.0
Quoted 1 line · Bertrand Marquis
Hi Julien,
Hi Bertrand,
Quoted 7 lines
Quoted 7 lines · Julien Grall
From: Julien Grall <[email protected]>
xsm_deasign_dtdevice()will indicate whether the caller is allowed to issue the operation. So the return value has to be checked.
Quoted 7 lines
Quoted 4 lines
Spotted by clang static analyzer.
Fixes fe36cccc483c ("xen/passthrough: Extend XEN_DOMCTL_*assign_device to support DT device")Signed-off-by Julien Grall <[email protected]>With the typo spotted by Michal solved (can be done on commit):
Reviewed-by Bertrand Marquis <[email protected]>
I fixed the typo and committed.
Cheers,
Signature · 1 line
Julien Grall