Bug 176545

Summary: loadkeys requires root priviledge starting with kernel.org 2.6.14.4
Product: [Fedora] Fedora Reporter: Vassili Leonov <vleo>
Component: kbdAssignee: Miloslav Trmač <mitr>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 1.12-10.fc4.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-12-25 13:12:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vassili Leonov 2005-12-25 12:38:52 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051130 Firefox/1.5

Description of problem:
After upgrading kernel to kernel.org 2.6.14.4 logging in as a regular user results in error messages about inability to set keyboard map, since it became a root priviledged operation as a result of patch included in 2.6.14.4:

=======================================================================
commit 6ca4c553e663b1eebe5630e70fd7cb39c4b910e3
Author: Daniel Drake <dsd>
Date:   Fri Dec 2 20:56:21 2005 +0000

    [PATCH] setkeys needs root
    
    This patch combines commit 0b360adbdb54d5b98b78d57ba0916bc4b8871968 (make
    setkeys root-only) and commit e3f17f0f6e98f58edb13cb38810d93e6d4808e68 (only
    disallow setting by users)
    
       Because people can play games reprogramming keys and leaving traps for the
       next user of the console.
    
    Signed-off-by: Greg Kroah-Hartman <gregkh>
=======================================================================

Version-Release number of selected component (if applicable):
kbb-1.12-10

How reproducible:
Always

Steps to Reproduce:
1. upgrade (patch) kernel.org kernel 2.6.14 to 2.6.14.4, reboot
2. log in as a regular user
3. watch the error messages

Actual Results:  dhcp04 login: vleo
Password:
Last login: Sun Dec 25 00:35:54 from hydra.lml
Keymap 0: Permission denied
Keymap 1: Permission denied
Keymap 2: Permission denied
KDSKBENT: Operation not permitted
loadkeys: could not deallocate keymap 3
[vleo@dhcp04 ~]$


Expected Results:  dhcp04 login: vleo
Password:
Last login: Sun Dec 25 00:35:54 from hydra.lml
[vleo@dhcp04 ~]$

Additional info:

I'm also submitting this as a buggy patch complain to the patch contributors. It's easy to fix the problem in an ad hoc way, but needs some architectural thought to fix it properly. I think, since kernel maintainers decided to include the patch into 2.6.14.4, then they will be able to make recommendation as to how to fix this FC4 problem, or will retract the patch.
I do not think it's a FC4 kernel issue. It's either kbd or kernel.org kernel issue.
This is part of the strace for loadkeys illustrating the new behaviour, run as a regular user:

[pid  2600] open("/dev/tty", O_RDWR)    = 3
[pid  2600] ioctl(3, KDGKBTYPE, 0xbfcb9247) = 0
[pid  2600] ioctl(3, KDGKBMODE, 0xbfcb95f8) = 0
[pid  2600] ioctl(3, KDSKBENT, 0xbfcb92f4) = -1 EPERM (Operation not permitted)

Comment 1 Vassili Leonov 2005-12-25 12:44:20 UTC
file that is patched:

linux-2.6.14.4/drivers/char/vt_ioctl.c

Comment 2 Miloslav Trmač 2005-12-25 13:12:38 UTC
The FC4 update kbd-1.12-10.fc4.1 removes the loadkeys invocation on login,
so these error messages should not appear any more.

Please update to the updated kbd package and reopen this bug report if it fails
to fix the problem.

Comment 3 Vassili Leonov 2005-12-25 15:03:18 UTC
Indeed, update of kbd to kbd-1.12-10.fc4.1 (done with 'yum update kbd') fixed
the problem.