Input: keyboard - fix theoretical race on vt switch
A VT switch can theoretically change fg_console between vc = vc_cons[fg_console].d and kbd = kbd_table + fg_console Fix it by replacing the second fg_console with vc->vc_num. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
Родитель
71bb21b677
Коммит
0c09b2ac35
|
@ -1136,7 +1136,7 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode, unsigned char u
|
||||||
static void kbd_rawcode(unsigned char data)
|
static void kbd_rawcode(unsigned char data)
|
||||||
{
|
{
|
||||||
struct vc_data *vc = vc_cons[fg_console].d;
|
struct vc_data *vc = vc_cons[fg_console].d;
|
||||||
kbd = kbd_table + fg_console;
|
kbd = kbd_table + vc->vc_num;
|
||||||
if (kbd->kbdmode == VC_RAW)
|
if (kbd->kbdmode == VC_RAW)
|
||||||
put_queue(vc, data);
|
put_queue(vc, data);
|
||||||
}
|
}
|
||||||
|
@ -1157,7 +1157,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
|
||||||
tty->driver_data = vc;
|
tty->driver_data = vc;
|
||||||
}
|
}
|
||||||
|
|
||||||
kbd = kbd_table + fg_console;
|
kbd = kbd_table + vc->vc_num;
|
||||||
|
|
||||||
if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT)
|
if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT)
|
||||||
sysrq_alt = down ? keycode : 0;
|
sysrq_alt = down ? keycode : 0;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче