From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
Linux Input <linux-input@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Jason Wessel <jason.wessel@windriver.com>
Subject: Re: [RFC] Input: implement sysrq as an input handler
Date: Thu, 1 Apr 2010 08:42:12 -0700 [thread overview]
Message-ID: <20100401154212.GA7900@core.coreip.homeip.net> (raw)
In-Reply-To: <20100401133454.GA1291@ucw.cz>
Hi Pavel,
On Thu, Apr 01, 2010 at 03:34:55PM +0200, Pavel Machek wrote:
> Hi!
>
> > > root isn't really a problem from a security PoV (well, maybe it is if the
> > > operation isn't constrained by capabilities). SAK can't protect you from
> > > root.
> > >
> > > _Normal_ userspace behaviour running a root process is a problem if it
> > > blocks these handles, though, both for SAK and regular SysRQ. I have lost
> > > count of how many times SysRQ+SUB delivered me from filesystem corruption
> > > and very annoying problems, both at home and at work.
> > >
> > > We are sort of trusting userspace to not break the one way out from severly
> > > hung systems while doing its normal day-to-day operations (as opposed to
> > > deliberately disabling SysRQ or remapping SAK, etc).
>
> If userspace disables sysrq during normal operation, that makes it
> useless.
>
> If normal user could do that, that's a security problem.
>
Yes, and...? This patch does not change the way one enables, disables,
intercepts, etc. SysRq and SAK compared to how it was handled when SysRq
was part of keyboard _input handler_. The only thisng this patch does is
moving the code into a _separate_ input handler.
> > > > That would require moving "these things", including their state
> > > > machines, into input core otherwise it would not know what events can be
> > > > trappable and which should be passed through. Or we should get rid of
> > > > EVIOCGRAB.
> > >
> > > Maybe we can add a flags field to input devices and input handlers, to be
> > > able to have the core behave differently when needed, without moving
> > > everything into the input core? Would that work, or would it need too much
> > > churn in the core?
> >
> > The problem is that device does not know what SysRq and especially SAK are.
> > User can reassign key codes and key symbols easily.
>
> That was not case in original implementation; it had hardcoded keymap.
The earth was also flat back then and the only keyboard was AT one. SAK
was always part of keymap so could be reassinged at any time.
>
> > I don't think we had any issues like this since 2.5 so I would not worry
> > about userspace too much. If anything we just need to review what stuff
> > we run as root (we do that anyway, right?).
>
> Hehe. If X can break sysrq, that's both X and sysrq problem.
Root can disable Sysrq... News at 11.
--
Dmitry
next prev parent reply other threads:[~2010-04-01 15:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-17 6:19 [RFC] Input: implement sysrq as an input handler Dmitry Torokhov
2010-03-19 0:00 ` Henrique de Moraes Holschuh
2010-03-19 0:09 ` Dmitry Torokhov
2010-03-19 16:06 ` Henrique de Moraes Holschuh
2010-03-19 18:03 ` Dmitry Torokhov
2010-03-20 2:53 ` Henrique de Moraes Holschuh
2010-03-22 4:59 ` Dmitry Torokhov
2010-04-01 13:34 ` Pavel Machek
2010-04-01 15:42 ` Dmitry Torokhov [this message]
2010-04-04 13:27 ` Pavel Machek
2010-04-16 5:33 ` Dmitry Torokhov
2010-03-19 0:13 ` Randy Dunlap
2010-03-19 0:30 ` Dmitry Torokhov
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=20100401154212.GA7900@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=hmh@hmh.eng.br \
--cc=jason.wessel@windriver.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
/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).