From: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
To: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
Cc: marc.zyngier-5wv7dgnIgG8@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] iommu: Avoid NULL group dereference
Date: Thu, 17 Aug 2017 17:41:01 +0200 [thread overview]
Message-ID: <20170817154101.GL16908@8bytes.org> (raw)
In-Reply-To: <59a6c4f0a790eea40e2b2f2be840b63317dd44e4.1502966326.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
On Thu, Aug 17, 2017 at 11:40:08AM +0100, Robin Murphy wrote:
> The recently-removed FIXME in iommu_get_domain_for_dev() turns out to
> have been a little misleading, since that check is still worthwhile even
> when groups *are* universal. We have a few IOMMU-aware drivers which
> only care whether their device is already attached to an existing domain
> or not, for which the previous behaviour of iommu_get_domain_for_dev()
> was ideal, and who now crash if their device does not have an IOMMU.
>
> With IOMMU groups now serving as a reliable indicator of whether a
> device has an IOMMU or not (barring false-positives from VFIO no-IOMMU
> mode), drivers could arguably do this:
>
> group = iommu_group_get(dev);
> if (group) {
> domain = iommu_get_domain_for_dev(dev);
> iommu_group_put(group);
> }
Okay, so just to check I got it right: Drivers do the above to check
whether a device is managed by an IOMMU, and that crashes now because
the 'group == NULL' check was removed?
Regards,
Joerg
WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro@8bytes.org>
To: Robin Murphy <robin.murphy@arm.com>
Cc: iommu@lists.linux-foundation.org, shawn.lin@rock-chips.com,
marc.zyngier@arm.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu: Avoid NULL group dereference
Date: Thu, 17 Aug 2017 17:41:01 +0200 [thread overview]
Message-ID: <20170817154101.GL16908@8bytes.org> (raw)
In-Reply-To: <59a6c4f0a790eea40e2b2f2be840b63317dd44e4.1502966326.git.robin.murphy@arm.com>
On Thu, Aug 17, 2017 at 11:40:08AM +0100, Robin Murphy wrote:
> The recently-removed FIXME in iommu_get_domain_for_dev() turns out to
> have been a little misleading, since that check is still worthwhile even
> when groups *are* universal. We have a few IOMMU-aware drivers which
> only care whether their device is already attached to an existing domain
> or not, for which the previous behaviour of iommu_get_domain_for_dev()
> was ideal, and who now crash if their device does not have an IOMMU.
>
> With IOMMU groups now serving as a reliable indicator of whether a
> device has an IOMMU or not (barring false-positives from VFIO no-IOMMU
> mode), drivers could arguably do this:
>
> group = iommu_group_get(dev);
> if (group) {
> domain = iommu_get_domain_for_dev(dev);
> iommu_group_put(group);
> }
Okay, so just to check I got it right: Drivers do the above to check
whether a device is managed by an IOMMU, and that crashes now because
the 'group == NULL' check was removed?
Regards,
Joerg
next prev parent reply other threads:[~2017-08-17 15:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-17 10:40 [PATCH] iommu: Avoid NULL group dereference Robin Murphy
2017-08-17 10:40 ` Robin Murphy
2017-08-17 10:51 ` Marc Zyngier
[not found] ` <59a6c4f0a790eea40e2b2f2be840b63317dd44e4.1502966326.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2017-08-17 15:41 ` Joerg Roedel [this message]
2017-08-17 15:41 ` Joerg Roedel
[not found] ` <20170817154101.GL16908-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2017-08-17 16:56 ` Robin Murphy
2017-08-17 16:56 ` Robin Murphy
2017-08-18 9:42 ` Joerg Roedel
2017-08-18 0:49 ` Shawn Lin
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=20170817154101.GL16908@8bytes.org \
--to=joro-zlv9swrftaidnm+yrofe0a@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marc.zyngier-5wv7dgnIgG8@public.gmane.org \
--cc=robin.murphy-5wv7dgnIgG8@public.gmane.org \
--cc=shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.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 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.