public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Fenghua Yu <fenghua.yu@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, "Zhao, Yu" <yu.zhao@intel.com>,
	lkml <linux-kernel@vger.kernel.org>,
	iommu <iommu@lists.linux-foundation.org>
Subject: Re: [PATCH] Intel-IOMMU Alignment Issue in dma_pte_clear_range()
Date: Mon, 06 Apr 2009 14:48:22 -0700	[thread overview]
Message-ID: <1239054502.22733.102.camel@macbook.infradead.org> (raw)
In-Reply-To: <20090406182149.GA28529@linux-os.sc.intel.com>

On Mon, 2009-04-06 at 11:21 -0700, Fenghua Yu wrote:
> This issue was pointed out by Linus.
> 
> In dma_pte_clear_range() in intel-iommu.c
> 
> start = PAGE_ALIGN(start);
> end &= PAGE_MASK;
> npages = (end - start) / VTD_PAGE_SIZE;
> 
> In partial page case, start could be bigger than end and npages will be
> negative.
> 
> Currently the issue doesn't show up as a real bug in testing because start and
> end have been aligned to page boundary already by all callers. So the issue has
> been hiden. But it is dangerous programming practice.
> 
> The following patch fixes the issue. It's applied on iommu-2.6.git tree.
> 
> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>

Applied to git://git.infradead.org/iommu-2.6.git; thanks.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


      reply	other threads:[~2009-04-06 21:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1238507922.3294.35.camel@macbook.infradead.org>
     [not found] ` <alpine.LFD.2.00.0904031140520.19690@localhost.localdomain>
     [not found]   ` <20090403191923.GA7772@linux-os.sc.intel.com>
2009-04-06 18:21     ` [PATCH] Intel-IOMMU Alignment Issue in dma_pte_clear_range() Fenghua Yu
2009-04-06 21:48       ` David Woodhouse [this message]

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=1239054502.22733.102.camel@macbook.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=fenghua.yu@intel.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    --cc=yu.zhao@intel.com \
    /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