From: Nirmoy Das <nirmoy.das@linux.intel.com>
To: Nirmoy Das <nirmoy.das@intel.com>, intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: Prevent potential null-ptr-deref in engine_init_common
Date: Wed, 18 Oct 2023 13:38:48 +0200 [thread overview]
Message-ID: <84558dd8-3bfa-100d-3bfc-e779ac4e54c8@linux.intel.com> (raw)
In-Reply-To: <20231011122547.7085-1-nirmoy.das@intel.com>
This now merged. CI errors are unrelated.
On 10/11/2023 2:25 PM, Nirmoy Das wrote:
> If measure_breadcrumb_dw() returns an error and bce isn't created,
> this commit ensures that intel_engine_destroy_pinned_context()
> is not called with a NULL bce.
>
> v2: Fix the subject s/UAF/null-ptr-deref(Jani)
>
> Fixes: b35274993680 ("drm/i915: Create a kernel context for GGTT updates")
> Cc: Oak Zeng <oak.zeng@intel.com>
> Cc: Andi Shyti <andi.shyti@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
> drivers/gpu/drm/i915/gt/intel_engine_cs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> index 179d9546865b..4a11219e560e 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> @@ -1491,7 +1491,8 @@ static int engine_init_common(struct intel_engine_cs *engine)
> return 0;
>
> err_bce_context:
> - intel_engine_destroy_pinned_context(bce);
> + if (bce)
> + intel_engine_destroy_pinned_context(bce);
> err_ce_context:
> intel_engine_destroy_pinned_context(ce);
> return ret;
WARNING: multiple messages have this Message-ID (diff)
From: Nirmoy Das <nirmoy.das@linux.intel.com>
To: Nirmoy Das <nirmoy.das@intel.com>, intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Prevent potential null-ptr-deref in engine_init_common
Date: Wed, 18 Oct 2023 13:38:48 +0200 [thread overview]
Message-ID: <84558dd8-3bfa-100d-3bfc-e779ac4e54c8@linux.intel.com> (raw)
In-Reply-To: <20231011122547.7085-1-nirmoy.das@intel.com>
This now merged. CI errors are unrelated.
On 10/11/2023 2:25 PM, Nirmoy Das wrote:
> If measure_breadcrumb_dw() returns an error and bce isn't created,
> this commit ensures that intel_engine_destroy_pinned_context()
> is not called with a NULL bce.
>
> v2: Fix the subject s/UAF/null-ptr-deref(Jani)
>
> Fixes: b35274993680 ("drm/i915: Create a kernel context for GGTT updates")
> Cc: Oak Zeng <oak.zeng@intel.com>
> Cc: Andi Shyti <andi.shyti@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
> drivers/gpu/drm/i915/gt/intel_engine_cs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> index 179d9546865b..4a11219e560e 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> @@ -1491,7 +1491,8 @@ static int engine_init_common(struct intel_engine_cs *engine)
> return 0;
>
> err_bce_context:
> - intel_engine_destroy_pinned_context(bce);
> + if (bce)
> + intel_engine_destroy_pinned_context(bce);
> err_ce_context:
> intel_engine_destroy_pinned_context(ce);
> return ret;
next prev parent reply other threads:[~2023-10-18 11:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-11 12:25 [Intel-gfx] [PATCH v2] drm/i915: Prevent potential null-ptr-deref in engine_init_common Nirmoy Das
2023-10-11 12:25 ` Nirmoy Das
2023-10-11 12:27 ` [Intel-gfx] " Andi Shyti
2023-10-11 12:27 ` Andi Shyti
2023-10-13 0:28 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Prevent potential null-ptr-deref in engine_init_common (rev2) Patchwork
2023-10-13 9:19 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Prevent potential null-ptr-deref in engine_init_common (rev3) Patchwork
2023-10-13 19:28 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Prevent potential null-ptr-deref in engine_init_common (rev4) Patchwork
2023-10-14 23:54 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-10-17 2:58 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Prevent potential null-ptr-deref in engine_init_common (rev6) Patchwork
2023-10-17 4:08 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-10-18 11:38 ` Nirmoy Das [this message]
2023-10-18 11:38 ` [PATCH v2] drm/i915: Prevent potential null-ptr-deref in engine_init_common Nirmoy Das
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=84558dd8-3bfa-100d-3bfc-e779ac4e54c8@linux.intel.com \
--to=nirmoy.das@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=nirmoy.das@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.