[Cbe-oss-dev] [PATCH 1/2] ps3fb: prevent use after free of fb_info

Geert Uytterhoeven Geert.Uytterhoeven at sonycom.com
Thu Jan 10 19:36:27 EST 2008


On Thu, 10 Jan 2008, Jeremy Kerr wrote:
> In ps3fb_shutdown, freeing the framebuffer will cause fb_info (in
> dev->core.driver_data) to be free()ed, which we potentially access
> from the ps3fbd kthread.
> 
> This change frees the framebuffer after stopping the ps3fbd kthread.
> 
> Signed-off-by: Jeremy Kerr <jk at ozlabs.org>
> 
> ---
>  drivers/video/ps3fb.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
> index b312890..ae07e02 100644
> --- a/drivers/video/ps3fb.c
> +++ b/drivers/video/ps3fb.c
> @@ -1234,12 +1234,6 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev)
>  	ps3fb_flip_ctl(0, &ps3fb);	/* flip off */

This disables flipping, but there's indeed a slight chance ps3fb.is_kicked is
still 1, ...


>  	ps3fb.dinfo->irq.mask = 0;
>  
> -	if (info) {
> -		unregister_framebuffer(info);
> -		fb_dealloc_cmap(&info->cmap);
> -		framebuffer_release(info);

... so ps3fbd needs info after this.

Thanks for the patches!

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven at sonycom.com
Internet: http://www.sony-europe.com/

Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619


More information about the cbe-oss-dev mailing list