Date: Mon, 1 Aug 2016 19:50:28 +0000 (UTC) From: Ed Maste <emaste@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303632 - stable/11/sys/dev/vt Message-ID: <201608011950.u71JoSsq059091@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emaste Date: Mon Aug 1 19:50:28 2016 New Revision: 303632 URL: https://svnweb.freebsd.org/changeset/base/303632 Log: MFC r303338: 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 Approved by: re (gjb, kib) Modified: stable/11/sys/dev/vt/vt_core.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/vt/vt_core.c ============================================================================== --- stable/11/sys/dev/vt/vt_core.c Mon Aug 1 19:49:42 2016 (r303631) +++ stable/11/sys/dev/vt/vt_core.c Mon Aug 1 19:50:28 2016 (r303632) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608011950.u71JoSsq059091>