dri-devel Archive mirror
 help / color / mirror / Atom feed
From: Liviu Dudau <liviu.dudau@arm.com>
To: Steven Price <steven.price@arm.com>
Cc: "Boris Brezillon" <boris.brezillon@collabora.com>,
	"Adrián Larumbe" <adrian.larumbe@collabora.com>,
	"Christopher Healy" <healych@amazon.com>,
	dri-devel@lists.freedesktop.org, kernel@collabora.com
Subject: Re: [PATCH 3/4] drm/panthor: Reset the FW VM to NULL on unplug
Date: Fri, 3 May 2024 12:47:36 +0100	[thread overview]
Message-ID: <ZjTO2OpDr9WKqgS4@e110455-lin.cambridge.arm.com> (raw)
In-Reply-To: <eba9c75d-ad1f-4c73-86de-624cb54e20a7@arm.com>

On Fri, May 03, 2024 at 10:22:13AM +0100, Steven Price wrote:
> On 02/05/2024 19:38, Boris Brezillon wrote:
> > This way get NULL derefs instead of use-after-free if the FW VM is
> > referenced after the device has been unplugged.
> > 
> > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> 
> Reviewed-by: Steven Price <steven.price@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> 
> > ---
> >  drivers/gpu/drm/panthor/panthor_fw.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
> > index b41685304a83..93165961a6b5 100644
> > --- a/drivers/gpu/drm/panthor/panthor_fw.c
> > +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> > @@ -1141,6 +1141,7 @@ void panthor_fw_unplug(struct panthor_device *ptdev)
> >  	 * state to keep the active_refcnt balanced.
> >  	 */
> >  	panthor_vm_put(ptdev->fw->vm);
> > +	ptdev->fw->vm = NULL;
> >  
> >  	panthor_gpu_power_off(ptdev, L2, ptdev->gpu_info.l2_present, 20000);
> >  }
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

  reply	other threads:[~2024-05-03 11:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02 18:38 [PATCH 0/4] drm/panthor: More reset fixes Boris Brezillon
2024-05-02 18:38 ` [PATCH 1/4] drm/panthor: Force an immediate reset on unrecoverable faults Boris Brezillon
2024-05-03  9:21   ` Steven Price
2024-05-03 11:23   ` Liviu Dudau
2024-05-02 18:38 ` [PATCH 2/4] drm/panthor: Keep a ref to the VM at the panthor_kernel_bo level Boris Brezillon
2024-05-03  9:22   ` Steven Price
2024-05-03 11:46   ` Liviu Dudau
2024-05-02 18:38 ` [PATCH 3/4] drm/panthor: Reset the FW VM to NULL on unplug Boris Brezillon
2024-05-03  9:22   ` Steven Price
2024-05-03 11:47     ` Liviu Dudau [this message]
2024-05-02 18:38 ` [PATCH 4/4] drm/panthor: Call panthor_sched_post_reset() even if the reset failed Boris Brezillon
2024-05-03  9:22   ` Steven Price
2024-05-03 11:49   ` Liviu Dudau
2024-05-13 11:40 ` [PATCH 0/4] drm/panthor: More reset fixes Boris Brezillon

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=ZjTO2OpDr9WKqgS4@e110455-lin.cambridge.arm.com \
    --to=liviu.dudau@arm.com \
    --cc=adrian.larumbe@collabora.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=healych@amazon.com \
    --cc=kernel@collabora.com \
    --cc=steven.price@arm.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 read-only IMAP folder(s) and NNTP newsgroup(s).