[PATCH 1/2] vt: keyboard: Don't process Unicode characters in K_OFF mode

Myrrh Periwinkle posted 2 patches 3 months, 1 week ago
[PATCH 1/2] vt: keyboard: Don't process Unicode characters in K_OFF mode
Posted by Myrrh Periwinkle 3 months, 1 week ago
We don't process Unicode characters if the virtual terminal is in raw
mode, so there's no reason why we shouldn't do the same for K_OFF
(especially since people would expect K_OFF to actually turn off all VT
key processing).

Fixes: 9fc3de9c8356 ("vt: Add virtual console keyboard mode OFF")
Signed-off-by: Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>
Cc: stable@vger.kernel.org
---
 drivers/tty/vt/keyboard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
index dc585079c2fb8c92d37284701f15905a24161768..ee1d9c448c7ebf2f1456f6bd18e55a9681b036c2 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -1487,7 +1487,7 @@ static void kbd_keycode(unsigned int keycode, int down, bool hw_raw)
 		rc = atomic_notifier_call_chain(&keyboard_notifier_list,
 						KBD_UNICODE, &param);
 		if (rc != NOTIFY_STOP)
-			if (down && !raw_mode)
+			if (down && !(raw_mode || kbd->kbdmode == VC_OFF))
 				k_unicode(vc, keysym, !down);
 		return;
 	}

-- 
2.50.0
Re: [PATCH 1/2] vt: keyboard: Don't process Unicode characters in K_OFF mode
Posted by Jiri Slaby 2 months, 2 weeks ago
On 02. 07. 25, 16:17, Myrrh Periwinkle wrote:
> We don't process Unicode characters if the virtual terminal is in raw
> mode, so there's no reason why we shouldn't do the same for K_OFF
> (especially since people would expect K_OFF to actually turn off all VT
> key processing).

AFAICT

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

> Fixes: 9fc3de9c8356 ("vt: Add virtual console keyboard mode OFF")
> Signed-off-by: Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>
> Cc: stable@vger.kernel.org
> ---
>   drivers/tty/vt/keyboard.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
> index dc585079c2fb8c92d37284701f15905a24161768..ee1d9c448c7ebf2f1456f6bd18e55a9681b036c2 100644
> --- a/drivers/tty/vt/keyboard.c
> +++ b/drivers/tty/vt/keyboard.c
> @@ -1487,7 +1487,7 @@ static void kbd_keycode(unsigned int keycode, int down, bool hw_raw)
>   		rc = atomic_notifier_call_chain(&keyboard_notifier_list,
>   						KBD_UNICODE, &param);
>   		if (rc != NOTIFY_STOP)
> -			if (down && !raw_mode)
> +			if (down && !(raw_mode || kbd->kbdmode == VC_OFF))
>   				k_unicode(vc, keysym, !down);
>   		return;
>   	}
> 


-- 
js
suse labs