[PATCH 0/3] vt: make the console_lock ordering explicit for three variables

Jaidev Shastri via B4 Relay posted 3 patches 2 days, 14 hours ago
drivers/tty/vt/vt.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
[PATCH 0/3] vt: make the console_lock ordering explicit for three variables
Posted by Jaidev Shastri via B4 Relay 2 days, 14 hours ago
Three variables in vt.c are written on one path and read on another with
plain accesses on both sides: fg_console between redraw_screen() and
vt_console_print(), console_blanked between do_blank_screen() and
do_unblank_screen(), and the vc_cons[] slot between vc_deallocate() and
console_callback().

Every one of these pairs is serialised by console_lock today, so no behaviour
changes. The patches state the publication order in the accessors rather than
leaving it implicit in the lock, so the dependency is visible where the
variables are used.

Found with MBCheck, a static herd7-based memory consistency checker.
Compile-tested on arm64 with W=1, no new warnings.

---
Jaidev Shastri (3):
      vt: order the fg_console switch against vt_console_print()
      vt: order console_blanked between blanking and unblanking
      vt: order the vc_cons[] clear against console_callback()

 drivers/tty/vt/vt.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
---
base-commit: 93f51579e7df248780214094418f205253383cc5
change-id: 20260921-mb-vt-ca00f48031f0

Best regards,
--  
Jaidev Shastri <jaidevshastri@vt.edu>