Page MenuHomeFreeBSD

vt: Fix timer race between vtterm_splash() and vt_flush()
Needs ReviewPublic

Authored by quentin.thebault_defenso.fr on Wed, Sep 23, 2:43 PM.
Tags
None
Referenced Files
F173384508: D59928.diff
Fri, Sep 25, 2:51 PM
F173318894: D59928.diff
Fri, Sep 25, 5:20 AM
Unknown Object (File)
Thu, Sep 24, 3:09 PM
Unknown Object (File)
Thu, Sep 24, 2:58 PM
Unknown Object (File)
Wed, Sep 23, 10:17 PM
Unknown Object (File)
Wed, Sep 23, 8:04 PM
Unknown Object (File)
Wed, Sep 23, 7:55 PM
Unknown Object (File)
Wed, Sep 23, 7:35 PM
Subscribers

Details

Reviewers
vexeduxr
emaste
Summary

Current code leads to console text being drawn over the splash image.

Ensure vt_flush() does not draw over the splash image: vtterm_splash()
holds the vd_flush_lock via VT_FLUSH_LOCK(), or the vtbuf lock,
depending on the framebuffer backend, while it sets VDF_SPLASH and
blits. vt_flush() takes the same lock and re-checks VDF_SPLASH.

Sponsored by: Defenso
Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77209
Build 74092: arc lint + arc unit

Event Timeline

sys/dev/vt/vt_core.c
1743

Can we unlock right after setting VDF_SPLASH?

sys/dev/vt/vt_core.c
1743

Yes you are right that is enough. Once VDF_SPLASH is set the flush won´t stomp over our blit.

Release lock before blit rather than after.