public inbox for iommu@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Andrei Dulea <adulea@amazon.de>
Cc: iommu@lists.linux-foundation.org,
	"Jan H. Schönherr" <jschoenh@amazon.de>
Subject: Re: [PATCH 1/4] iommu/amd: Fix pages leak in free_pagetable()
Date: Tue, 24 Sep 2019 11:21:01 +0200	[thread overview]
Message-ID: <20190924092101.GA11453@8bytes.org> (raw)
In-Reply-To: <20190913144231.21382-2-adulea@amazon.de>

Hi Andrei,

On Fri, Sep 13, 2019 at 04:42:28PM +0200, Andrei Dulea wrote:
> Take into account the gathered freelist in free_sub_pt(), otherwise we
> end up leaking all that pages.
> 
> Fixes: 409afa44f9ba ("iommu/amd: Introduce free_sub_pt() function")
> Signed-off-by: Andrei Dulea <adulea@amazon.de>
> ---
>  drivers/iommu/amd_iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index 1ed3b98324ba..138547446345 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -1425,7 +1425,7 @@ static void free_pagetable(struct protection_domain *domain)
>  	BUG_ON(domain->mode < PAGE_MODE_NONE ||
>  	       domain->mode > PAGE_MODE_6_LEVEL);
>  
> -	free_sub_pt(root, domain->mode, freelist);
> +	freelist = free_sub_pt(root, domain->mode, freelist);

What a stupid mistake, thanks for fixing this. That is a clear example
which shows that we need more reviewers. Applied the whole series.


Thanks again,

       Joerg

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2019-09-24  9:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13 14:42 [PATCH 0/4] iommu/amd: re-mapping fixes Andrei Dulea via iommu
2019-09-13 14:42 ` [PATCH 1/4] iommu/amd: Fix pages leak in free_pagetable() Andrei Dulea via iommu
2019-09-24  9:21   ` Joerg Roedel [this message]
2019-09-13 14:42 ` [PATCH 2/4] iommu/amd: Fix downgrading default page-sizes in alloc_pte() Andrei Dulea via iommu
2019-09-13 14:42 ` [PATCH 3/4] iommu/amd: Introduce first_pte_l7() helper Andrei Dulea via iommu
2019-09-13 14:42 ` [PATCH 4/4] iommu/amd: Unmap all L7 PTEs when downgrading page-sizes Andrei Dulea via iommu

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=20190924092101.GA11453@8bytes.org \
    --to=joro@8bytes.org \
    --cc=adulea@amazon.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jschoenh@amazon.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