Page MenuHomeFreeBSD

vt: fix splash_cpu logos use of vd_drawrect
ClosedPublic

Authored by sg2342_googlemail.com on Feb 9 2022, 1:27 AM.
Tags
None
Referenced Files
F172438115: D34220.id.diff
Fri, Sep 18, 11:26 AM
F172403520: D34220.id102547.diff
Fri, Sep 18, 6:02 AM
F172389627: D34220.diff
Fri, Sep 18, 3:53 AM
Unknown Object (File)
Wed, Sep 16, 7:50 PM
Unknown Object (File)
Sat, Sep 12, 7:24 AM
Unknown Object (File)
Thu, Sep 10, 3:46 PM
Unknown Object (File)
Thu, Sep 3, 4:21 AM
Unknown Object (File)
Thu, Sep 3, 4:04 AM

Details

Summary

This fixes a memory corruption (author clearly did not intend to write to a non-existing
pixel column).

In the (extremely unlikely) case of vd->vd_height == vt_logo_sprite_height ; the
vd_drawrect code will write outside of frame-buffer memory.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/vt/vt_cpulogos.c
138–139

We also want to subtract one from vt_logo_sprite_height as well, right?

But I am a little surprised we don't do any dimension validation in vd_drawrect implementations s.t. we get memory corruption.

subtract one from vt_logo_sprite_height as well

i was glad that there was no dimension validation in vt_fb_drawrect(), otherwise https://reviews.freebsd.org/D34221 would be more complicated to do.

subtract one from vt_logo_sprite_height as well

Thanks.

i was glad that there was no dimension validation in vt_fb_drawrect(), otherwise https://reviews.freebsd.org/D34221 would be more complicated to do.

I suppose you could validate in setpixel instead.

This revision is now accepted and ready to land.Feb 9 2022, 3:00 AM

Can you provide author info (for git commit --author)

Author: Stefan Grundmann <sg2342@googlemail.com>

This revision was automatically updated to reflect the committed changes.