Skip to contentSkip to conversation

Breakage from patch: Only root should be able to set the N_MOUSE line discipline.

DISCUSSION Alan Cox 3 participants 5 messages Mar 1, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Alan Cox

author
#1 lore raw
Quoted 4 lines · Linux Kernel Mailing List

ChangeSet 1.1977.1.2, 2005/01/28 17:12:20+01:00, [email protected]

input: Only root should be able to set the N_MOUSE line discipline.

I finally had a chance to trace down why my mouse code for a little gui library started working differently and causing problems. This broken change breaks apps that use framebuffer in unpriviledged process form and want to use the mouse support in kernel and forces them to become setuid root or to revert to 2.4 style user space mouse drivers. If this functonality is root only kernel space it might as well be entirely deleted IMHO.

I can see no reason for this change - the ldisc is supposed to be configurable by non root users. It is reset on close/hangup in Linux so a user cannot jam a port up.

Can someone please justify this change. If not can it be reverted

Alan

#2 lore raw
Quoted 14 lines · Alan Cox
Quoted 4 lines · Linux Kernel Mailing List

ChangeSet 1.1977.1.2, 2005/01/28 17:12:20+01:00, [email protected]

input: Only root should be able to set the N_MOUSE line discipline.

I finally had a chance to trace down why my mouse code for a little gui library started working differently and causing problems. This broken change breaks apps that use framebuffer in unpriviledged process form and want to use the mouse support in kernel and forces them to become setuid root or to revert to 2.4 style user space mouse drivers. If this functonality is root only kernel space it might as well be entirely deleted IMHO.

Quoted 5 lines

I can see no reason for this change - the ldisc is supposed to be configurable by non root users. It is reset on close/hangup in Linux so a user cannot jam a port up.

Can someone please justify this change. If not can it be reverted

A nonprivileged user could inject mouse movement and/or keystrokes (using the sunkbd driver) into the input subsystem, taking over the console/X, where another user is logged in.

Simply using a slightly modified inputattach on a PTY will do the trick.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
author
#3 lore raw
Quoted 3 lines · Vojtech Pavlik

A nonprivileged user could inject mouse movement and/or keystrokes (using the sunkbd driver) into the input subsystem, taking over the console/X, where another user is logged in.

Ouch. Ok that explains much.

#4 lore raw
In reply to Vojtech Pavlik
Quoted 6 lines · Vojtech Pavlik

A nonprivileged user could inject mouse movement and/or keystrokes (using the sunkbd driver) into the input subsystem, taking over the console/X, where another user is logged in.

Simply using a slightly modified inputattach on a PTY will do the trick.

Might an alternative be to just make writes to N_MOUSE require privileges?

Ie "reading is ok, and changing to N_MOUSE is ok, but tryign to write a mouse packet is not"? The check should be easy enough to add to the ldisc.write thing?

Linus

#5 lore raw
Quoted 6 lines · Linus Torvalds
Quoted 5 lines · Vojtech Pavlik

A nonprivileged user could inject mouse movement and/or keystrokes (using the sunkbd driver) into the input subsystem, taking over the console/X, where another user is logged in.

Quoted 7 lines
Quoted 1 line

Simply using a slightly modified inputattach on a PTY will do the trick.

Might an alternative be to just make writes to N_MOUSE require privileges?

Ie "reading is ok, and changing to N_MOUSE is ok, but tryign to write a mouse packet is not"? The check should be easy enough to add to the ldisc.write thing?

No, since you wouldn't write anything to the device, the writes would happen on the other end of the pty.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR