* [PATCH] gpu-drm-tiny-cirrus: Add NULL check of pointer pipe->plane.state->fb in cirrus_pipe_update()
@ 2023-02-15 17:15 Alexander Sapozhnikov
2023-02-17 10:14 ` Thomas Zimmermann
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Sapozhnikov @ 2023-02-15 17:15 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: Alexandr Sapozhnikov, Sam Ravnborg, Ville Syrjälä,
Jani Nikula, Javier Martinez Canillas, David Airlie,
Daniel Vetter, virtualization, dri-devel, linux-kernel,
lvc-project
From: Alexandr Sapozhnikov <alsp705@gmail.com>
After having been compared to NULL value at cirrus.c:455, pointer 'pipe->plane.state->fb' is passed as
1st parameter in call to function 'cirrus_fb_blit_rect' at cirrus.c:461, where it is dereferenced at cirrus.c:316.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Alexandr Sapozhnikov <alsp705@gmail.com>
---
drivers/gpu/drm/tiny/cirrus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tiny/cirrus.c b/drivers/gpu/drm/tiny/cirrus.c
index 678c2ef..ffa7e61 100644
--- a/drivers/gpu/drm/tiny/cirrus.c
+++ b/drivers/gpu/drm/tiny/cirrus.c
@@ -455,7 +455,7 @@ static void cirrus_pipe_update(struct drm_simple_display_pipe *pipe,
if (state->fb && cirrus->cpp != cirrus_cpp(state->fb))
cirrus_mode_set(cirrus, &crtc->mode, state->fb);
- if (drm_atomic_helper_damage_merged(old_state, state, &rect))
+ if (state->fb && drm_atomic_helper_damage_merged(old_state, state, &rect))
cirrus_fb_blit_rect(state->fb, &shadow_plane_state->data[0], &rect);
}
--
2.5.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] gpu-drm-tiny-cirrus: Add NULL check of pointer pipe->plane.state->fb in cirrus_pipe_update()
2023-02-15 17:15 [PATCH] gpu-drm-tiny-cirrus: Add NULL check of pointer pipe->plane.state->fb in cirrus_pipe_update() Alexander Sapozhnikov
@ 2023-02-17 10:14 ` Thomas Zimmermann
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Zimmermann @ 2023-02-17 10:14 UTC (permalink / raw)
To: Alexander Sapozhnikov
Cc: linux-kernel, lvc-project, Jani Nikula, Sam Ravnborg,
Javier Martinez Canillas, dri-devel, virtualization
[-- Attachment #1.1: Type: text/plain, Size: 1529 bytes --]
Hi
Am 15.02.23 um 18:15 schrieb Alexander Sapozhnikov:
> From: Alexandr Sapozhnikov <alsp705@gmail.com>
>
> After having been compared to NULL value at cirrus.c:455, pointer 'pipe->plane.state->fb' is passed as
> 1st parameter in call to function 'cirrus_fb_blit_rect' at cirrus.c:461, where it is dereferenced at cirrus.c:316.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Alexandr Sapozhnikov <alsp705@gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
I'll add you patch to drm-misc-fixes.
Best regards
Thomas
> ---
> drivers/gpu/drm/tiny/cirrus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/tiny/cirrus.c b/drivers/gpu/drm/tiny/cirrus.c
> index 678c2ef..ffa7e61 100644
> --- a/drivers/gpu/drm/tiny/cirrus.c
> +++ b/drivers/gpu/drm/tiny/cirrus.c
> @@ -455,7 +455,7 @@ static void cirrus_pipe_update(struct drm_simple_display_pipe *pipe,
> if (state->fb && cirrus->cpp != cirrus_cpp(state->fb))
> cirrus_mode_set(cirrus, &crtc->mode, state->fb);
>
> - if (drm_atomic_helper_damage_merged(old_state, state, &rect))
> + if (state->fb && drm_atomic_helper_damage_merged(old_state, state, &rect))
> cirrus_fb_blit_rect(state->fb, &shadow_plane_state->data[0], &rect);
> }
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-17 10:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15 17:15 [PATCH] gpu-drm-tiny-cirrus: Add NULL check of pointer pipe->plane.state->fb in cirrus_pipe_update() Alexander Sapozhnikov
2023-02-17 10:14 ` Thomas Zimmermann
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®