From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <ahmad@a3f.at>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/3] input: console: skip unmappable keys
Date: Tue, 30 Mar 2021 07:27:11 +0200 [thread overview]
Message-ID: <20210330052711.GI609@pengutronix.de> (raw)
In-Reply-To: <20210329061810.1996248-1-ahmad@a3f.at>
On Mon, Mar 29, 2021 at 08:18:08AM +0200, Ahmad Fatoum wrote:
> The input console is in charge of turning input events to barebox
> console keycodes. The keymap array it uses to do so has NR_KEYS
> entries. Keycodes with values >= NR_KEYS can thus not be mapped.
> Ignore them instead of evaluating arbitrary memory contents beyond
> the buffer.
>
> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
> ---
> drivers/input/input.c | 3 +++
> 1 file changed, 3 insertions(+)
Applied, thanks
Sascha
>
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index bcc8667417d9..1df52f56c84d 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -165,6 +165,9 @@ static void input_console_notify(struct input_notifier *in,
> if (ic->modstate[4] || ic->modstate[5])
> modstate |= 1 << 2;
>
> + if (ev->code >= NR_KEYS)
> + return;
> +
> if (modstate & (1 << 1)) {
> ascii = keycode_bb_keys[ev->code];
> ascii = ascii >= 'a' ? CTL_CH(ascii) : 0;
> --
> 2.30.0
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2021-03-30 5:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-29 6:18 Ahmad Fatoum
2021-03-29 6:18 ` [PATCH 2/3] input: add virtio input driver Ahmad Fatoum
2021-03-29 6:18 ` [PATCH 3/3] input: virtio_input: add sound support Ahmad Fatoum
2021-03-30 5:27 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210330052711.GI609@pengutronix.de \
--to=sha@pengutronix.de \
--cc=ahmad@a3f.at \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox