From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Harish Chegondi <harish.chegondi@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 1/1] drm/xe/eustall: Fix a possible pointer dereference after free
Date: Wed, 12 Mar 2025 15:09:40 -0700 [thread overview]
Message-ID: <87v7sd3nq3.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <eae49a414a7314921108e0388810aaee6261ad92.1741800396.git.harish.chegondi@intel.com>
On Wed, 12 Mar 2025 10:31:20 -0700, Harish Chegondi wrote:
>
> If devm_add_action_or_reset() isn't successful, xe_eu_stall_fini()
> is invoked. So, unsuccessful return from devm_add_action_or_reset()
> shouldn't dereference gt->eu_stall as xe_eu_stall_fini() already
> frees it. Fix this issue.
Needs a Fixes tag. No need to resend the patch, I will add the tag when
merging this. With that this is:
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
>
> Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_eu_stall.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_eu_stall.c b/drivers/gpu/drm/xe/xe_eu_stall.c
> index 88a92baf5c95..f2bb9168967c 100644
> --- a/drivers/gpu/drm/xe/xe_eu_stall.c
> +++ b/drivers/gpu/drm/xe/xe_eu_stall.c
> @@ -222,13 +222,7 @@ int xe_eu_stall_init(struct xe_gt *gt)
> goto exit_free;
> }
>
> - ret = devm_add_action_or_reset(xe->drm.dev, xe_eu_stall_fini, gt);
> - if (ret)
> - goto exit_destroy;
> -
> - return 0;
> -exit_destroy:
> - destroy_workqueue(gt->eu_stall->buf_ptr_poll_wq);
> + return devm_add_action_or_reset(xe->drm.dev, xe_eu_stall_fini, gt);
> exit_free:
> mutex_destroy(>->eu_stall->stream_lock);
> kfree(gt->eu_stall);
> --
> 2.48.1
>
next prev parent reply other threads:[~2025-03-12 22:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-12 17:31 [PATCH 1/1] drm/xe/eustall: Fix a possible pointer dereference after free Harish Chegondi
2025-03-12 17:40 ` ✓ CI.Patch_applied: success for series starting with [1/1] " Patchwork
2025-03-12 17:40 ` ✓ CI.checkpatch: " Patchwork
2025-03-12 17:42 ` ✓ CI.KUnit: " Patchwork
2025-03-12 18:05 ` ✓ CI.Build: " Patchwork
2025-03-12 18:07 ` ✓ CI.Hooks: " Patchwork
2025-03-12 18:09 ` ✓ CI.checksparse: " Patchwork
2025-03-12 18:31 ` ✓ Xe.CI.BAT: " Patchwork
2025-03-12 22:09 ` Dixit, Ashutosh [this message]
2025-03-13 9:25 ` ✓ Xe.CI.Full: " Patchwork
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=87v7sd3nq3.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=harish.chegondi@intel.com \
--cc=intel-xe@lists.freedesktop.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