# [SOLVED]Selinux enforcing targeted freezes mouse and keybord

## Spinmc

I tried conversion to hardened/selinux following the manual and, with only pax config options everything works fine.

With selinux (Targeted type) in permissive mode everything also works fine, but switching to enforcing mode, after booting, when xdm (kdm) loads, keyboard and mouse are freezed. The only thing I can do is CTRL+ALT+PRT+B to reboot.

This is the output of emerge --info: 

 *Quote:*   

> Portage 2.1.10.49 (hardened/linux/amd64/selinux, gcc-4.5.3, glibc-2.14.1-r3, 3.3.8-hardened x86_64)
> 
> =================================================================
> 
> System uname: Linux-3.3.8-hardened-x86_64-Intel-R-_Core-TM-2_Duo_CPU_P8600_@_2.40GHz-with-gentoo-2.1
> ...

 

And this is what contained in avc.log regardin the last (about) two boots:

 *Quote:*   

> Jun 22 11:27:30 localhost kernel: [  199.924873] type=1400 audit(1340357250.678:202): avc:  denied  { write } for  pid=1280 comm="udevd" name="udev" dev="tmpfs" ino=1266 scontext=system_u:system_r:udev_t tcontext=system_u:object_r:file_t tclass=dir
> 
> Jun 22 11:27:30 localhost kernel: [  199.924883] type=1400 audit(1340357250.678:203): avc:  denied  { add_name } for  pid=1280 comm="udevd" name="queue.tmp" scontext=system_u:system_r:udev_t tcontext=system_u:object_r:file_t tclass=dir
> 
> Jun 22 11:27:30 localhost kernel: [  199.924912] type=1400 audit(1340357250.678:204): avc:  denied  { create } for  pid=1280 comm="udevd" name="queue.tmp" scontext=system_u:system_r:udev_t tcontext=system_u:object_r:file_t tclass=file
> ...

 

I0ve read about another similar post on the forum, but it seems unrelated since I not found any X referements, moreover this is my first experience with selinux so i wouldn't know how to adapt that policy.

Thank you in advance

Edit:

As far as I've learned in these days, it looks like he culprit is the ~arched version of the kernel (hardened-sources-3.3.8 ). It early mounts the /tmp /dev/ and /run tmpfs's directories, but with wrong labels. Moreover I was forced to install this version of the kernel because of the bug #414789.

So finally I managed to warkaround the freeze by using the init script suggested for the initramfs-users so that thes directories can be well relabeled before switching to enforcing.

I hope it could help someone else.

----------

