dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fenghua Yu <fenghua.yu@intel.com>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: <error27@gmail.com>, <kernel-janitors@vger.kernel.org>,
	<dan.carpenter@linaro.org>, Dave Jiang <dave.jiang@intel.com>,
	Vinod Koul <vkoul@kernel.org>, <dmaengine@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dmaengine: idxd: Fix passing freed memory in idxd_cdev_open()
Date: Wed, 10 May 2023 15:08:11 -0700	[thread overview]
Message-ID: <c95dae02-ba49-8a30-24f3-687810ec1f98@intel.com> (raw)
In-Reply-To: <20230509060716.2830630-1-harshit.m.mogalapalli@oracle.com>



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

  parent reply	other threads:[~2023-05-10 22:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09  6:07 [PATCH] dmaengine: idxd: Fix passing freed memory in idxd_cdev_open() Harshit Mogalapalli
2023-05-09 15:13 ` Dave Jiang
2023-05-10 22:08 ` Fenghua Yu [this message]
2023-05-16 17:51 ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c95dae02-ba49-8a30-24f3-687810ec1f98@intel.com \
    --to=fenghua.yu@intel.com \
    --cc=dan.carpenter@linaro.org \
    --cc=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=error27@gmail.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).