From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add KD_X console mode to avoid keyboard passthrough
Date: Mon, 13 Oct 2008 23:12:44 -0400 [thread overview]
Message-ID: <20081014031244.GE8594@anvil.corenet.prv> (raw)
In-Reply-To: <20081012174710.GA5206@srcf.ucam.org>
Hi Matthew,
On Sun, Oct 12, 2008 at 06:47:10PM +0100, Matthew Garrett wrote:
> When using the evdev input driver, X currently claims the devices
> exclusively in order to prevent characters leaking through to the
> underlying VT. This has the downside that other consumers of input
> events no longer receive the keys - rfkill and mouseemu no longer work
> in the kernel, and hal is unable to pass through input events. Removing
> the exclusive access results in events being passed through to the
> underlying VT, which may result in leaking sensitive information.
>
> This patch adds an extra KD_X mode. It's semantically identical to
> KD_GRAPHICS, except that keyboard events are no longer sent to the
> console device. This allows X to avoid exclusive access without breaking
> any applications which depend upon the existing KD_GRAPHICS semantics.
>
Is this really needed? The current X does not leak anything onto its VT
and the new one should not have either, unless they forget to switch
virtual console into raw mode. Plus, if you make everything work with
KD_GRAPHICS you don't have to have new kernel.
>
> diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
> index 7b3a212..b0b8285 100644
> --- a/drivers/char/keyboard.c
> +++ b/drivers/char/keyboard.c
> @@ -1298,6 +1298,10 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
> static void kbd_event(struct input_handle *handle, unsigned int event_type,
> unsigned int event_code, int value)
> {
> + struct vc_data *vc = vc_cons[fg_console].d;
> +
> + if (vc->vc_mode == KD_X)
> + return;
This surely kills SysRq handling.
> if (event_type == EV_MSC && event_code == MSC_RAW && HW_RAW(handle->dev))
> kbd_rawcode(value);
> if (event_type == EV_KEY)
--
Dmitry
next prev parent reply other threads:[~2008-10-14 3:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-12 17:47 [PATCH] Add KD_X console mode to avoid keyboard passthrough Matthew Garrett
2008-10-14 3:12 ` Dmitry Torokhov [this message]
2008-10-14 11:25 ` Matthew Garrett
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=20081014031244.GE8594@anvil.corenet.prv \
--to=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@srcf.ucam.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;
as well as URLs for NNTP newsgroup(s).