linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: iommu@lists.linux-foundation.org, ddutile@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] amd_iommu: Fix leak in free_pagetable()
Date: Thu, 20 Jun 2013 21:26:38 +0200	[thread overview]
Message-ID: <20130620192638.GD11309@8bytes.org> (raw)
In-Reply-To: <1371755280.30572.4.camel@ul30vt.home>

On Thu, Jun 20, 2013 at 01:08:00PM -0600, Alex Williamson wrote:
> On Thu, 2013-06-20 at 20:28 +0200, Joerg Roedel wrote:
> > Hmm, actually a recursive version would make more sense here. But since
> > recursion is a bad idea in the kernel, how about this approach instead:
> 
> It's a fixed maximum depth of recursion though, is it really that taboo?

Well, a recursive version would be better here because it has lower icache
impact than my patch. But the risk is if there is a bug in recursive
code and it goes on forever it will overwrite random kernel memory, with
undefined, potentially very bad, results (like data corruption, killed
filesystems and so on).

So in my opinion it is better to not take that risk whenever possible.

> > The IOMMU pagetables can have up to 3 levels, but the code
> 
> s/3/6/

Right, thanks.

> Seems like it should do the right thing

Ok, I also gave it some testing (started a vm, assigned and de-assigned
a device), so it should work as expected.

> Reviewed-by: Alex Williamson <alex.williamson@redhat.com>

Thanks,

	Joerg



  reply	other threads:[~2013-06-20 19:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18  1:48 [PATCH] amd_iommu: Fix leak in free_pagetable() Alex Williamson
2013-06-18  1:52 ` Alex Williamson
2013-06-20 18:28   ` Joerg Roedel
2013-06-20 19:08     ` Alex Williamson
2013-06-20 19:26       ` Joerg Roedel [this message]
2013-06-20 19:46         ` Alex Williamson
2013-06-20 20:04           ` 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=20130620192638.GD11309@8bytes.org \
    --to=joro@8bytes.org \
    --cc=alex.williamson@redhat.com \
    --cc=ddutile@redhat.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).