From: Joerg Roedel <jroedel@suse.de>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Joerg Roedel <joro@8bytes.org>,
iommu@lists.linux-foundation.org,
Oded Gabbay <oded.gabbay@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org, jbarnes@virtuousgeek.org
Subject: Re: [PATCH 4/4] iommu/vt-d: Do access checks before calling handle_mm_fault()
Date: Tue, 10 Nov 2015 15:52:26 +0100 [thread overview]
Message-ID: <20151110145226.GK2255@suse.de> (raw)
In-Reply-To: <1447166756.81031.66.camel@infradead.org>
On Tue, Nov 10, 2015 at 02:45:56PM +0000, David Woodhouse wrote:
> On Tue, 2015-11-10 at 14:26 +0100, Joerg Roedel wrote:
> > +static bool access_error(struct vm_area_struct *vma, struct
> > page_req_dsc *req)
> > +{
> > + return !((req->rd_req && (vma->vm_flags & VM_READ)) ||
> > + (req->wr_req && (vma->vm_flags & VM_WRITE)) ||
> > + (req->exe_req && (vma->vm_flags & VM_EXEC)));
> > +}
> > +
>
> This is a TLB fill request from the device — can it not be asking for
> *all* of read, write and exec privs? And you allow it to succeed if any
> *one* of the permissions that it asks for is available?
>
> Even if we don't see read+write in the same request, the VT-d spec does
> seem quite clear that we *will* see read+exec (§7.5.1.1 p7-17 of v2.3:
>
> • Execute Requested: If the PASID Present, Read Requested and Execute
> Requested fields are all 1, the request-with-PASID that encountered
> the recoverable fault that resulted in this page request, requires
> execute access to the page.
Okay, thanks for the clarification. The code above assumes that only one
of RWX is set. I'll update the patch to correctly check when multiple
bits are set.
Joerg
next prev parent reply other threads:[~2015-11-10 14:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-10 13:26 [PATCH 0/4] Implement access checks in iommu page fault paths Joerg Roedel
2015-11-10 13:26 ` [PATCH 1/4] iommu/amd: Do proper access checking before calling handle_mm_fault() Joerg Roedel
2015-11-10 13:26 ` [PATCH 2/4] iommu/amd: Correctly set flags for handle_mm_fault call Joerg Roedel
2015-11-10 13:26 ` [PATCH 3/4] iommu/amd: Cleanup error handling in do_fault() Joerg Roedel
2015-11-10 13:26 ` [PATCH 4/4] iommu/vt-d: Do access checks before calling handle_mm_fault() Joerg Roedel
2015-11-10 14:45 ` David Woodhouse
2015-11-10 14:52 ` Joerg Roedel [this message]
2015-11-10 17:43 ` Linus Torvalds
2015-11-10 17:57 ` Joerg Roedel
-- strict thread matches above, loose matches on Subject: below --
2015-11-17 15:11 [PATCH 0/4 v2] Implement access checks in iommu page fault paths Joerg Roedel
2015-11-17 15:11 ` [PATCH 4/4] iommu/vt-d: Do access checks before calling handle_mm_fault() Joerg Roedel
2015-11-20 15:35 ` David Woodhouse
2015-12-14 14:41 ` Joerg Roedel
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=20151110145226.GK2255@suse.de \
--to=jroedel@suse.de \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jbarnes@virtuousgeek.org \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oded.gabbay@gmail.com \
--cc=torvalds@linux-foundation.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