Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1340916

Re: [PATCH] amdgpu: fix NULL pointer dereference at tonga_check_states_equal

From Alex Deucher <alexdeucher@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] amdgpu: fix NULL pointer dereference at tonga_check_states_equal
Date 2016-02-23 19:00 +0100
Message-ID <r5ppE-jj-17@gated-at.bofh.it> (permalink)
References <r59NT-6nf-1@gated-at.bofh.it> <r5b3k-77q-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Applied.  thanks!

Alex

On Mon, Feb 22, 2016 at 9:21 PM, Zhu, Rex <Rex.Zhu@amd.com> wrote:
>
> Reviewed-by:  Rex Zhu <Rex.Zhu@amd.com>
>
> Best Regards
> Rex Zhu
>
> -----Original Message-----
> From: Bradley Pankow [mailto:btpankow@gmail.com]
> Sent: Tuesday, February 23, 2016 9:12 AM
> To: Deucher, Alexander; Zhu, Rex; Zhou, Jammy
> Cc: dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; Bradley Pankow
> Subject: [PATCH] amdgpu: fix NULL pointer dereference at tonga_check_states_equal
>
> The event_data passed from pem_fini was not cleared upon initialization.
> This caused NULL checks to pass and cast_const_phw_tonga_power_state to attempt to dereference an invalid pointer. Clear the event_data in pem_init and pem_fini before calling pem_handle_event.
>
> Signed-off-by: Bradley Pankow <btpankow@gmail.com>
> ---
>  drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c b/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c
> index 52a3efc..46410e3 100644
> --- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c
> @@ -31,7 +31,7 @@
>  static int pem_init(struct pp_eventmgr *eventmgr)  {
>         int result = 0;
> -       struct pem_event_data event_data;
> +       struct pem_event_data event_data = { {0} };
>
>         /* Initialize PowerPlay feature info */
>         pem_init_feature_info(eventmgr);
> @@ -52,7 +52,7 @@ static int pem_init(struct pp_eventmgr *eventmgr)
>
>  static void pem_fini(struct pp_eventmgr *eventmgr)  {
> -       struct pem_event_data event_data;
> +       struct pem_event_data event_data = { {0} };
>
>         pem_uninit_featureInfo(eventmgr);
>         pem_unregister_interrupts(eventmgr);
> --
> 2.7.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] amdgpu: fix NULL pointer dereference at tonga_check_states_equal Bradley Pankow <btpankow@gmail.com> - 2016-02-23 02:20 +0100
  RE: [PATCH] amdgpu: fix NULL pointer dereference at  tonga_check_states_equal "Zhu, Rex" <Rex.Zhu@amd.com> - 2016-02-23 03:40 +0100
    Re: [PATCH] amdgpu: fix NULL pointer dereference at tonga_check_states_equal Alex Deucher <alexdeucher@gmail.com> - 2016-02-23 19:00 +0100

csiph-web