lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 28 Nov 2021 23:16:53 -0800
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     lianzhi chang <changlianzhi@...ontech.com>
Cc:     linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
        jirislaby@...nel.org, andriy.shevchenko@...ux.intel.com,
        282827961@...com
Subject: Re: [PATCH v18] tty: Fix the keyboard led light display problem

Hi,

On Mon, Nov 29, 2021 at 12:04:45PM +0800, lianzhi chang wrote:
> +	/*
> +	 * When switching VT, according to the value of kb->kbdmode,
> +	 * judge whether it is necessary to force the keyboard light
> +	 * state to be issued.
> +	 */
> +	kb = kbd_table + fg_console;
> +	if (kb->kbdmode != VC_RAW ||
> +		 kb->kbdmode != VC_MEDIUMRAW ||
> +		 kb->kbdmode != VC_OFF) {

Please do not do that. Even if kbdmode is one of those states if might
be set up to show LED pattern set by ioctls (KDSETLED), so you still
want to restore LEDs.

Also, you are trying optimize something that happens pretty infrequently
and it is really easy to get it wrong. It is much safer to let the
kernel [re]set LEDs regardless of kbdmode and then let X do its own
thing.

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ