public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Joerg Roedel <joerg.roedel@amd.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org
Subject: Re: [PATCH] x86: fix broken flushing in GART nofullflush path
Date: Tue, 2 Dec 2008 21:24:18 +0100	[thread overview]
Message-ID: <20081202202417.GM29705@8bytes.org> (raw)
In-Reply-To: <20081202192759.GD15342@elte.hu>

On Tue, Dec 02, 2008 at 08:27:59PM +0100, Ingo Molnar wrote:
> 
> * Joerg Roedel <joerg.roedel@amd.com> wrote:
> 
> > In the non-default nofullflush case the GART is only flushed when
> > next_bit wraps around. But it can happen that an unmap operation unmaps
> > memory which is behind the current next_bit location. If these addresses
> > are reused it may result in stale GART IO/TLB entries. Fix this by
> > setting the GART next_bit always behind an unmapped location.
> > 
> > Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
> > ---
> >  arch/x86/kernel/pci-gart_64.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> applied to tip/x86/iommu, thanks Joerg!
> 
> a stale iotlb should not cause any problems in this particular GART case, 
> right? It might be a security leak in a security-domain enforcing iotlb 
> case, but the GART is a DMA bouncing helper in essence. Can you see any 
> failure mode of this bug?

It can cause data corruption because the GART redirects the IO to a
wrong address because of a stale entry in its TLB. I found this bug
after I fixed the same issue in the AMD IOMMU code (commit 80be308d).

The reason this was not found earlier is that lazy flushing is not the
default in GART. But I didn't try to trigger the bug.

Joerg

  reply	other threads:[~2008-12-02 20:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 19:16 [PATCH] x86: fix broken flushing in GART nofullflush path Joerg Roedel
2008-12-02 19:27 ` Ingo Molnar
2008-12-02 20:24   ` Joerg Roedel [this message]
2008-12-03  9:02     ` Ingo Molnar

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=20081202202417.GM29705@8bytes.org \
    --to=joro@8bytes.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /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