dmaengine Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] dmaengine: idxd: check return result from check_vma() in cdev
@ 2020-02-25 16:47 Dave Jiang
  2020-03-02  7:14 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Jiang @ 2020-02-25 16:47 UTC (permalink / raw)
  To: vkoul; +Cc: dmaengine

The returned result from the check_vma() function in the cdev ->mmap() call
needs to be handled. Add the check and returning error.

Fixes: 42d279f9137a ("dmaengine: idxd: add char driver to expose submission portal to userland")
Reported-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/dma/idxd/cdev.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/idxd/cdev.c b/drivers/dma/idxd/cdev.c
index 1d7347825b95..1706a48d8bbe 100644
--- a/drivers/dma/idxd/cdev.c
+++ b/drivers/dma/idxd/cdev.c
@@ -139,6 +139,8 @@ static int idxd_cdev_mmap(struct file *filp, struct vm_area_struct *vma)
 
 	dev_dbg(&pdev->dev, "%s called\n", __func__);
 	rc = check_vma(wq, vma, __func__);
+	if (rc < 0)
+		return rc;
 
 	vma->vm_flags |= VM_DONTCOPY;
 	pfn = (base + idxd_get_wq_portal_full_offset(wq->id,


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: idxd: check return result from check_vma() in cdev
  2020-02-25 16:47 [PATCH] dmaengine: idxd: check return result from check_vma() in cdev Dave Jiang
@ 2020-03-02  7:14 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2020-03-02  7:14 UTC (permalink / raw)
  To: Dave Jiang; +Cc: dmaengine

On 25-02-20, 09:47, Dave Jiang wrote:
> The returned result from the check_vma() function in the cdev ->mmap() call
> needs to be handled. Add the check and returning error.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 16:47 [PATCH] dmaengine: idxd: check return result from check_vma() in cdev Dave Jiang
2020-03-02  7:14 ` Vinod Koul

dmaengine Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dmaengine/0 dmaengine/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dmaengine dmaengine/ https://lore.kernel.org/dmaengine \
		dmaengine@vger.kernel.org
	public-inbox-index dmaengine

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dmaengine


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git