Thread (40 messages) 40 messages, 4 authors, 2023-05-03

Re: [PATCH v2 17/19] fbdev: Validate info->screen_{base,buffer} in fb_ops implementations

From: Thomas Zimmermann <tzimmermann@suse.de>
Date: 2023-05-03 14:31:00
Also in: dri-devel

Hi

Am 03.05.23 um 11:51 schrieb Geert Uytterhoeven:
On Fri, Apr 28, 2023 at 2:26 PM Thomas Zimmermann [off-list ref] wrote:
quoted
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.

While bothi fields, screen_base and screen_buffer, are stored in the
both
quoted
same location, they refer to different address spaces. For correctness,
we want to test each field in exactly the code that uses it.
Not a direct comment for this patch: and later the union can be split
in two separate fields, to protect against misuse?
No idea. Currently we have sparse that warns about mismatching address 
spaces if the fields are mixed up. That's good enough, as far I'm concerned.

Best regards
Thomas
Gr{oetje,eeting}s,

                         Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                 -- Linus Torvalds
-- 
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)

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help