mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lizhi Hou <lizhi.hou@amd.com>
To: Mario Limonciello <superm1@kernel.org>, <ogabbay@kernel.org>,
	<quic_jhugo@quicinc.com>, <dri-devel@lists.freedesktop.org>,
	<karol.wachowski@linux.intel.com>
Cc: <linux-kernel@vger.kernel.org>, <max.zhen@amd.com>,
	<sonal.santan@amd.com>
Subject: Re: [PATCH V1] accel/amdxdna: Fix mm_struct reference leak in aie2_populate_range()
Date: Thu, 11 Jun 2026 09:53:35 -0700	[thread overview]
Message-ID: <a02306aa-0470-d4e9-db7f-0f5c08b728b8@amd.com> (raw)
In-Reply-To: <621cc992-5de2-455b-a488-f89ed2a9a91a@kernel.org>

Applied to drm-misc-fixes

On 6/10/26 08:18, Mario Limonciello wrote:
>
>
> On 6/10/26 10:11, Lizhi Hou wrote:
>> aie2_populate_range() jumps back to the again label without calling
>> mmput(mm), leaking a reference to the mm_struct.
>>
>> Add the missing mmput() before jumping to again.
>>
>> Fixes: e486147c912f ("accel/amdxdna: Add BO import and export")
>> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
>> ---
>>   drivers/accel/amdxdna/aie2_ctx.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/accel/amdxdna/aie2_ctx.c 
>> b/drivers/accel/amdxdna/aie2_ctx.c
>> index 3e21e2dabe82..e0f30dbe0238 100644
>> --- a/drivers/accel/amdxdna/aie2_ctx.c
>> +++ b/drivers/accel/amdxdna/aie2_ctx.c
>> @@ -1041,6 +1041,7 @@ static int aie2_populate_range(struct 
>> amdxdna_gem_obj *abo)
>>             if (ret == -EBUSY) {
>>               amdxdna_umap_put(mapp);
>> +            mmput(mm);
>>               goto again;
>>           }
>>   @@ -1051,11 +1052,13 @@ static int aie2_populate_range(struct 
>> amdxdna_gem_obj *abo)
>>       if (mmu_interval_read_retry(&mapp->notifier, 
>> mapp->range.notifier_seq)) {
>>           up_write(&xdna->notifier_lock);
>>           amdxdna_umap_put(mapp);
>> +        mmput(mm);
>>           goto again;
>>       }
>>       mapp->invalid = false;
>>       up_write(&xdna->notifier_lock);
>>       amdxdna_umap_put(mapp);
>> +    mmput(mm);
>>       goto again;
>>     put_mm:
>

      reply	other threads:[~2026-06-11 16:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-10 15:11 Lizhi Hou
2026-06-10 15:18 ` Mario Limonciello
2026-06-11 16:53   ` Lizhi Hou [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=a02306aa-0470-d4e9-db7f-0f5c08b728b8@amd.com \
    --to=lizhi.hou@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=karol.wachowski@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=max.zhen@amd.com \
    --cc=ogabbay@kernel.org \
    --cc=quic_jhugo@quicinc.com \
    --cc=sonal.santan@amd.com \
    --cc=superm1@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

all inboxes | Powered by JetHome®