[PATCH 4/6] fbdev: Validate info->screen_{base, buffer} in fb_ops implementations

Thomas Zimmermann tzimmermann at suse.de
Thu Apr 27 13:54:33 UTC 2023


Hi

Am 26.04.23 um 16:56 schrieb Geert Uytterhoeven:
> Hi Thomas,
> 
> 
> On Tue, Apr 25, 2023 at 4:28 PM Thomas Zimmermann <tzimmermann at suse.de> wrote:
>> Push the test for info->screen_base from fb_read() and fb_write() into
>> the implementations of struct fb_ops.{fb_read,fb_write}. In cases where
>> the driver operates on info->screen_buffer, test this field instead.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> 
> Thanks for your patch!
> You forgot to mention why it is a good idea to duplicate this in all
> the implementations, instead of doing it once in the core?
> 
>>   drivers/video/fbdev/cobalt_lcdfb.c     |  6 ++++++
>>   drivers/video/fbdev/core/fb_sys_fops.c |  6 ++++++
>>   drivers/video/fbdev/core/fbmem.c       | 10 ++++++++--
>>   drivers/video/fbdev/sm712fb.c          |  4 ++--
>>   4 files changed, 22 insertions(+), 4 deletions(-)
> 
> Aren't there more fbdev drivers to fix, before you can move the checks
> in drivers/video/fbdev/core/fbmem.c?

I've found a few. And I've also found quite a number of drivers that use 
screen_base when they should use screen_buffer instead. I'll fix them as 
well.

Best regards
Thomas

> 
> Gr{oetje,eeting}s,
> 
>                          Geert
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20230427/2970e2b2/attachment.sig>


More information about the dri-devel mailing list