vt: lock Giant around kbd calls in CONS_GETINFO

Note that keyboards are stored in an array and are not freed (just
"unregistered" by clearing some fields) so a race would be limited to
obtaining stale information about an unregistered keyboard.

Reported by:	CTurt
MFC after:	3 days
This commit is contained in:
emaste 2016-07-26 15:34:26 +00:00
parent abad5e749f
commit ff041dec2b

View File

@ -2228,9 +2228,11 @@ skip_thunk:
return (EINVAL);
if (vw == vd->vd_curwindow) {
mtx_lock(&Giant);
kbd = kbd_get_keyboard(vd->vd_keyboard);
if (kbd != NULL)
vt_save_kbd_state(vw, kbd);
mtx_unlock(&Giant);
}
vi->m_num = vd->vd_curwindow->vw_number + 1;