linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Shivaprasad G Bhat <sbhat@linux.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>,
	iommu@lists.linux.dev, linuxppc-dev@lists.ozlabs.org
Cc: venkat88@linux.vnet.ibm.com, jroedel@suse.de,
	gbatra@linux.vnet.ibm.com, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, aneesh.kumar@kernel.org,
	jgg@ziepe.ca, tpearson@raptorengineering.com, npiggin@gmail.com,
	bgray@linux.ibm.com, naveen.n.rao@linux.ibm.com,
	vaibhav@linux.ibm.com, aik@amd.com
Subject: Re: [PATCH v2] powerpc/iommu: Fix the iommu group reference leak during platform domain attach
Date: Thu, 15 Feb 2024 19:27:23 +0530	[thread overview]
Message-ID: <ca971b81-9e4f-4baa-aee4-f62fb71b4629@linux.ibm.com> (raw)
In-Reply-To: <875xyq791x.fsf@mail.lhotse>

On 2/15/24 08:01, Michael Ellerman wrote:
> Shivaprasad G Bhat <sbhat@linux.ibm.com> writes:
>> The function spapr_tce_platform_iommu_attach_dev() is missing to call
>> iommu_group_put() when the domain is already set. This refcount leak
>> shows up with BUG_ON() during DLPAR remove operation as,
<snip>
>>    [c0000013aed5fd10] [c0000000005bfeb4] vfs_write+0xf8/0x488
>>    [c0000013aed5fdc0] [c0000000005c0570] ksys_write+0x84/0x140
>>    [c0000013aed5fe10] [c000000000033358] system_call_exception+0x138/0x330
>>    [c0000013aed5fe50] [c00000000000d05c] system_call_vectored_common+0x15c/0x2ec
>>    --- interrupt: 3000 at 0x20000433acb4
>>    <snip>
>>    ---[ end trace 0000000000000000 ]---
>>
>> The patch makes the iommu_group_get() call only when using it there by
>> avoiding the leak.
>>
>> Fixes: a8ca9fc9134c ("powerpc/iommu: Do not do platform domain attach atctions after probe")
>> Reported-by: Venkat Rao Bagalkote <venkat88@linux.vnet.ibm.com>
>> Closes: https://lore.kernel.org/all/274e0d2b-b5cc-475e-94e6-8427e88e271d@linux.vnet.ibm.com
>> Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
>> ---
>> Changelog:
>> v1: https://lore.kernel.org/all/170784021983.6249.10039296655906636112.stgit@linux.ibm.com/
>>   - Minor refactor to call the iommu_group_get() only if required.
>>   - Updated the title, description and signature(Closes/Reported-by).
> Sorry I already applied v1.
>
> If you send this as a patch on top of v1 with a new change log I can
> merge it as a cleanup/rework.

I have posted the cleanup patch at 
https://lore.kernel.org/linux-iommu/170800513841.2411.13524607664262048895.stgit@linux.ibm.com/

Thank you!

Shivaprasad

> cheers

      reply	other threads:[~2024-02-15 13:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14 18:09 [PATCH v2] powerpc/iommu: Fix the iommu group reference leak during platform domain attach Shivaprasad G Bhat
2024-02-14 18:10 ` Jason Gunthorpe
2024-02-15  2:31 ` Michael Ellerman
2024-02-15 13:57   ` Shivaprasad G Bhat [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=ca971b81-9e4f-4baa-aee4-f62fb71b4629@linux.ibm.com \
    --to=sbhat@linux.ibm.com \
    --cc=aik@amd.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=bgray@linux.ibm.com \
    --cc=gbatra@linux.vnet.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=tpearson@raptorengineering.com \
    --cc=vaibhav@linux.ibm.com \
    --cc=venkat88@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).