* [PATCH] xen/iommu: dt: Check the return value of xsm_deassign_dtdevice()
@ 2022-05-22 16:59 Julien Grall
2022-05-23 7:00 ` Michal Orzel
2022-05-24 7:54 ` Bertrand Marquis
0 siblings, 2 replies; 5+ messages in thread
From: Julien Grall @ 2022-05-22 16:59 UTC (permalink / raw)
To: xen-devel; +Cc: julien, Julien Grall, Stefano Stabellini
From: Julien Grall <jgrall@amazon.com>
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 <jgrall@amazon.com>
---
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(+)
diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthrough/device_tree.c
index 98f2aa0dad68..1c32d7b50cce 100644
--- a/xen/drivers/passthrough/device_tree.c
+++ b/xen/drivers/passthrough/device_tree.c
@@ -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;
--
2.32.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] xen/iommu: dt: Check the return value of xsm_deassign_dtdevice()
2022-05-22 16:59 [PATCH] xen/iommu: dt: Check the return value of xsm_deassign_dtdevice() Julien Grall
@ 2022-05-23 7:00 ` Michal Orzel
2022-05-23 20:01 ` Julien Grall
2022-05-24 7:54 ` Bertrand Marquis
1 sibling, 1 reply; 5+ messages in thread
From: Michal Orzel @ 2022-05-23 7:00 UTC (permalink / raw)
To: Julien Grall, xen-devel; +Cc: Julien Grall, Stefano Stabellini
Hi Julien,
On 22.05.2022 18:59, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
>
> xsm_deasign_dtdevice() will indicate whether the caller is allowed
s/deasign/deassign/
> 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 <jgrall@amazon.com>
Apart from that:
Reviewed-by: Michal Orzel <michal.orzel@arm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] xen/iommu: dt: Check the return value of xsm_deassign_dtdevice()
2022-05-23 7:00 ` Michal Orzel
@ 2022-05-23 20:01 ` Julien Grall
0 siblings, 0 replies; 5+ messages in thread
From: Julien Grall @ 2022-05-23 20:01 UTC (permalink / raw)
To: Michal Orzel, xen-devel; +Cc: Julien Grall, Stefano Stabellini
On 23/05/2022 08:00, Michal Orzel wrote:
> Hi Julien,
Hi Michal,
> On 22.05.2022 18:59, Julien Grall wrote:
>> From: Julien Grall <jgrall@amazon.com>
>>
>> xsm_deasign_dtdevice() will indicate whether the caller is allowed
> s/deasign/deassign/
Good spot! I will fix it on commit unless there are any objections.
>
>> 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 <jgrall@amazon.com>
>
> Apart from that:
> Reviewed-by: Michal Orzel <michal.orzel@arm.com>
Thanks!
Cheers,
--
Julien Grall
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] xen/iommu: dt: Check the return value of xsm_deassign_dtdevice()
2022-05-22 16:59 [PATCH] xen/iommu: dt: Check the return value of xsm_deassign_dtdevice() Julien Grall
2022-05-23 7:00 ` Michal Orzel
@ 2022-05-24 7:54 ` Bertrand Marquis
2022-05-25 8:53 ` Julien Grall
1 sibling, 1 reply; 5+ messages in thread
From: Bertrand Marquis @ 2022-05-24 7:54 UTC (permalink / raw)
To: Julien Grall; +Cc: xen-devel, Julien Grall, Stefano Stabellini
Hi Julien,
> On 22 May 2022, at 17:59, Julien Grall <julien@xen.org> wrote:
>
> From: Julien Grall <jgrall@amazon.com>
>
> 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 <jgrall@amazon.com>
With the typo spotted by Michal solved (can be done on commit):
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Cheers
Bertrand
>
> ---
>
> 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(+)
>
> diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthrough/device_tree.c
> index 98f2aa0dad68..1c32d7b50cce 100644
> --- a/xen/drivers/passthrough/device_tree.c
> +++ b/xen/drivers/passthrough/device_tree.c
> @@ -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;
> --
> 2.32.0
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] xen/iommu: dt: Check the return value of xsm_deassign_dtdevice()
2022-05-24 7:54 ` Bertrand Marquis
@ 2022-05-25 8:53 ` Julien Grall
0 siblings, 0 replies; 5+ messages in thread
From: Julien Grall @ 2022-05-25 8:53 UTC (permalink / raw)
To: Bertrand Marquis; +Cc: xen-devel, Julien Grall, Stefano Stabellini
On 24/05/2022 08:54, Bertrand Marquis wrote:
> Hi Julien,
Hi Bertrand,
>> On 22 May 2022, at 17:59, Julien Grall <julien@xen.org> wrote:
>>
>> From: Julien Grall <jgrall@amazon.com>
>>
>> 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 <jgrall@amazon.com>
>
> With the typo spotted by Michal solved (can be done on commit):
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
I fixed the typo and committed.
Cheers,
--
Julien Grall
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-25 8:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-22 16:59 [PATCH] xen/iommu: dt: Check the return value of xsm_deassign_dtdevice() Julien Grall
2022-05-23 7:00 ` Michal Orzel
2022-05-23 20:01 ` Julien Grall
2022-05-24 7:54 ` Bertrand Marquis
2022-05-25 8:53 ` Julien Grall
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.