Avoids races of high-level syscons code with the sckbdevent handler. Patch for the syscons.c 1.459 (8-CURRENT from July 1st 2008). --- sys/dev/syscons/syscons.c.orig 2008-05-25 19:30:27.000000000 +0400 +++ sys/dev/syscons/syscons.c 2008-09-23 13:51:14.000000000 +0400 @@ -1583,6 +1583,7 @@ int s = spltty(); /* block sckbdevent and scrn_timer while we poll */ int c; + mtx_lock(&Giant); /* assert(sc_console != NULL) */ /* @@ -1594,11 +1595,13 @@ sccnupdate(scp); if (fkeycp < fkey.len) { + mtx_unlock(&Giant); splx(s); return fkey.str[fkeycp++]; } if (scp->sc->kbd == NULL) { + mtx_unlock(&Giant); splx(s); return -1; } @@ -1621,6 +1624,7 @@ scp->kbd_mode = cur_mode; kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); kbdd_disable(scp->sc->kbd); + mtx_unlock(&Giant); splx(s); switch (KEYFLAGS(c)) {