* [PATCH 1/1] iommu/amd: fix incorrect error handling
@ 2017-04-23 10:23 Pan Bian
[not found] ` <1492943001-1078-1-git-send-email-bianpan201602-9Onoh4P/yGk@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Pan Bian @ 2017-04-23 10:23 UTC (permalink / raw)
To: Joerg Roedel, iommu; +Cc: linux-kernel, Pan Bian
From: Pan Bian <bianpan2016@163.com>
In function amd_iommu_bind_pasid(), the control flow jumps to label
out_free when pasid_state->mm and mm is NULL. And mmput(mm) is called.
In function mmput(mm), mm is referenced without validation. This will
result in a NULL dereference bug. This patch fixes the bug.
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
drivers/iommu/amd_iommu_v2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c
index 0633439..6629c47 100644
--- a/drivers/iommu/amd_iommu_v2.c
+++ b/drivers/iommu/amd_iommu_v2.c
@@ -696,9 +696,9 @@ int amd_iommu_bind_pasid(struct pci_dev *pdev, int pasid,
out_unregister:
mmu_notifier_unregister(&pasid_state->mn, mm);
+ mmput(mm);
out_free:
- mmput(mm);
free_pasid_state(pasid_state);
out:
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <1492943001-1078-1-git-send-email-bianpan201602-9Onoh4P/yGk@public.gmane.org>]
* Re: [PATCH 1/1] iommu/amd: fix incorrect error handling 2017-04-23 10:23 [PATCH 1/1] iommu/amd: fix incorrect error handling Pan Bian @ 2017-04-24 10:39 ` Joerg Roedel 0 siblings, 0 replies; 3+ messages in thread From: Joerg Roedel @ 2017-04-24 10:39 UTC (permalink / raw) To: Pan Bian Cc: Pan Bian, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Sun, Apr 23, 2017 at 06:23:21PM +0800, Pan Bian wrote: > From: Pan Bian <bianpan2016-9Onoh4P/yGk@public.gmane.org> > > In function amd_iommu_bind_pasid(), the control flow jumps to label > out_free when pasid_state->mm and mm is NULL. And mmput(mm) is called. > In function mmput(mm), mm is referenced without validation. This will > result in a NULL dereference bug. This patch fixes the bug. > > Signed-off-by: Pan Bian <bianpan2016-9Onoh4P/yGk@public.gmane.org> Applied, thanks. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] iommu/amd: fix incorrect error handling @ 2017-04-24 10:39 ` Joerg Roedel 0 siblings, 0 replies; 3+ messages in thread From: Joerg Roedel @ 2017-04-24 10:39 UTC (permalink / raw) To: Pan Bian; +Cc: iommu, linux-kernel, Pan Bian On Sun, Apr 23, 2017 at 06:23:21PM +0800, Pan Bian wrote: > From: Pan Bian <bianpan2016@163.com> > > In function amd_iommu_bind_pasid(), the control flow jumps to label > out_free when pasid_state->mm and mm is NULL. And mmput(mm) is called. > In function mmput(mm), mm is referenced without validation. This will > result in a NULL dereference bug. This patch fixes the bug. > > Signed-off-by: Pan Bian <bianpan2016@163.com> Applied, thanks. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-24 10:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-23 10:23 [PATCH 1/1] iommu/amd: fix incorrect error handling Pan Bian
[not found] ` <1492943001-1078-1-git-send-email-bianpan201602-9Onoh4P/yGk@public.gmane.org>
2017-04-24 10:39 ` Joerg Roedel
2017-04-24 10:39 ` Joerg Roedel
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.