From: Michael Ellerman <mpe@ellerman.id.au>
To: Andrew Donnellan <andrew.donnellan@au1.ibm.com>, linuxppc-dev@ozlabs.org
Cc: mikey@neuling.org, mrochs@linux.vnet.ibm.com,
imunsie@au1.ibm.com, vaibhav@linux.vnet.ibm.com
Subject: Re: [3/3] cxl: fix leak of ctx->mapping when releasing kernel API contexts
Date: Wed, 7 Oct 2015 21:10:55 +1100 (AEDT) [thread overview]
Message-ID: <20151007101055.211D31402B4@ozlabs.org> (raw)
In-Reply-To: <1443578287-7847-3-git-send-email-andrew.donnellan@au1.ibm.com>
On Wed, 2015-30-09 at 01:58:07 UTC, Andrew Donnellan wrote:
> When a context is created via the kernel API, ctx->mapping is allocated
> within the kernel and thus needs to be freed when the context is freed.
> reclaim_ctx() attempts to do this for contexts with the ctx->kernelapi flag
> set, but afu_release() (which can be called from the kernel API through
> cxl_fd_release()) sets ctx->mapping to NULL before calling
> cxl_context_free() to free the context.
>
> Add a check to afu_release() so that the mappings in contexts created via
> the kernel API are left alone so reclaim_ctx() can free them.
>
> Reported-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
> Fixes: 6f7f0b3df6d4 ("cxl: Add AFU virtual PHB and kernel API")
> Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
> Acked-by: Ian Munsie <imunsie@au1.ibm.com>
> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/5f81b95fe2a2de4ec51d46ff
cheers
next prev parent reply other threads:[~2015-10-07 10:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-30 1:58 [PATCH 1/3] cxl: fix leak of IRQ names in cxl_free_afu_irqs() Andrew Donnellan
2015-09-30 1:58 ` [PATCH 2/3] cxl: fix leak of ctx->irq_bitmap when releasing context via kernel API Andrew Donnellan
2015-09-30 6:01 ` Ian Munsie
2015-09-30 14:04 ` Matthew R. Ochs
2015-10-01 6:51 ` [2/3] " Michael Ellerman
2015-09-30 1:58 ` [PATCH 3/3] cxl: fix leak of ctx->mapping when releasing kernel API contexts Andrew Donnellan
2015-09-30 6:02 ` Ian Munsie
2015-09-30 14:04 ` Matthew R. Ochs
2015-10-01 6:51 ` [3/3] " Michael Ellerman
2015-10-07 10:10 ` Michael Ellerman [this message]
2015-09-30 14:03 ` [PATCH 1/3] cxl: fix leak of IRQ names in cxl_free_afu_irqs() Matthew R. Ochs
2015-10-01 6:49 ` [1/3] " Michael Ellerman
2015-10-01 6:51 ` Michael Ellerman
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=20151007101055.211D31402B4@ozlabs.org \
--to=mpe@ellerman.id.au \
--cc=andrew.donnellan@au1.ibm.com \
--cc=imunsie@au1.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=mikey@neuling.org \
--cc=mrochs@linux.vnet.ibm.com \
--cc=vaibhav@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).