lkml.org 
[lkml]   [2023]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] dmaengine: idxd: Fix passing freed memory in idxd_cdev_open()
From


On 5/8/23 23:07, Harshit Mogalapalli wrote:
> Smatch warns:
> drivers/dma/idxd/cdev.c:327:
> idxd_cdev_open() warn: 'sva' was already freed.
>
> When idxd_wq_set_pasid() fails, the current code unbinds sva and then
> goes to 'failed_set_pasid' where iommu_sva_unbind_device is called
> again causing the above warning.
> [ device_user_pasid_enabled(idxd) is still true when calling
> failed_set_pasid ]
>
> Fix this by removing additional unbind when idxd_wq_set_pasid() fails
>
> Fixes: b022f59725f0 ("dmaengine: idxd: add idxd_copy_cr() to copy user completion record during page fault handling")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>

Acked-by: Fenghua Yu <fenghua.yu@intel.com>

Thanks.

-Fenghua

\
 
 \ /
  Last update: 2023-05-11 00:08    [W:0.300 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site