Re: [PATCH] Input - keyboard: fix theoretical race on vt switch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 03, 2009 at 05:04:57PM +0100, Alan Jenkins wrote:
> Switching virtual consoles could change fg_console between
> 
> 	vc = vc_cons[fg_console].d
> and
> 	kbd = kbd_table + fg_console
> 
> Replace the second instance of fg_console with vc->vc_num.
> 
> Signed-off-by: Alan Jenkins <alan-jenkins@xxxxxxxxxxxxxx>
> ---
>  drivers/char/keyboard.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
> index 737be95..4b564c5 100644
> --- a/drivers/char/keyboard.c
> +++ b/drivers/char/keyboard.c
> @@ -1157,7 +1157,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
>  		tty->driver_data = vc;
>  	}
>  
> -	kbd = kbd_table + fg_console;
> +	kbd = kbd_table + vc->vc_num;

Hmm, I see more such cases there...

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux