IOMMU Archive on
 help / color / Atom feed
From: Sasha Levin <>
Cc: Sasha Levin <>,
	Dave Jiang <>,
	Ashok Raj <>,, Joerg Roedel <>
Subject: [PATCH AUTOSEL 4.19 229/671] iommu/vt-d: Fix NULL pointer reference in intel_svm_bind_mm()
Date: Thu, 16 Jan 2020 11:52:18 -0500
Message-ID: <> (raw)
In-Reply-To: <>

From: Lu Baolu <>

[ Upstream commit c56cba5daf45d2d091ef1cfe2f1d6a930446687b ]

Intel IOMMU could be turned off with intel_iommu=off. If Intel
IOMMU is off,  the intel_iommu struct will not be initialized.
When device drivers call intel_svm_bind_mm(), the NULL pointer
reference will happen there.

Add dmar_disabled check to avoid NULL pointer reference.

Cc: Ashok Raj <>
Cc: Jacob Pan <>
Reported-by: Dave Jiang <>
Fixes: 2f26e0a9c9860 ("iommu/vt-d: Add basic SVM PASID support")
Signed-off-by: Lu Baolu <>
Signed-off-by: Joerg Roedel <>
Signed-off-by: Sasha Levin <>
 drivers/iommu/intel-svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c
index 188f4eaed6e5..fd8730b2cd46 100644
--- a/drivers/iommu/intel-svm.c
+++ b/drivers/iommu/intel-svm.c
@@ -293,7 +293,7 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_
 	int pasid_max;
 	int ret;
-	if (!iommu)
+	if (!iommu || dmar_disabled)
 		return -EINVAL;
 	if (dev_is_pci(dev)) {

iommu mailing list

      parent reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
2020-01-16 16:52 ` [PATCH AUTOSEL 4.19 219/671] iommu: Fix IOMMU debugfs fallout Sasha Levin
2020-01-16 16:52 ` Sasha Levin [this message]

Reply instructions:

You may reply publically 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:

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

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

IOMMU Archive on

Archives are clonable:
	git clone --mirror linux-iommu/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 linux-iommu linux-iommu/ \
	public-inbox-index linux-iommu

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone