Skip to contentSkip to conversation

/dev on tmpfs. How to label?

DISCUSSION AlannY 2 participants 4 messages Jan 28, 2010 SELinux security module

lore
Share & tools
lore

AlannY

author
#0 lore raw

Hi there. I'm still trying to install SELinux on Archlinux. I've already done step with /sbin/load_policy -i at initramfs. But now have another difficult to solve problem.

Archlinux at boot time (at /etc/rc.sysinit) mount /dev at tmpfs so:

/bin/mount -n -t tmpfs none /dev -o mode=0755

As you can see, nodes at /dev never have correct context, because they are temporary created and at shutdown deleted.

I see there are 2 ways to solve:

1. recrack Archlinux boot process and make not mount /dev at tmpfs.
2. Somehow relabel all nodes created at boot.

What do you think about it? Is there any distro, which mounts /dev at tmpfs and have working SELinux?

Thanks for patience.

Signature · 8 lines
   )\._.,--....,'``.
  /,   _.. \   _\  (`._ ,.
 `._.-(,_..'--(,_..'`-.;.' 

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw
Quoted 11 lines · AlannY

Hi there. I'm still trying to install SELinux on Archlinux. I've already done step with /sbin/load_policy -i at initramfs. But now have another difficult to solve problem.

Archlinux at boot time (at /etc/rc.sysinit) mount /dev at tmpfs so:

/bin/mount -n -t tmpfs none /dev -o mode=0755

As you can see, nodes at /dev never have correct context, because they are temporary created and at shutdown deleted.

Quoted 6 lines

I see there are 2 ways to solve:

1. recrack Archlinux boot process and make not mount /dev at tmpfs.
2. Somehow relabel all nodes created at boot.

What do you think about it? Is there any distro, which mounts /dev at tmpfs and have working SELinux?

Most distros do that these days, and it works fine in Fedora, for example.

The technique used in Fedora is to run restorecon -R /dev from rc.sysinit to set the contexts on the /dev nodes set up before the policy load, and udev is already SELinux-aware (if built with SELinux support enabled) and should label any dynamically created nodes appropriately once SELinux policy has loaded.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
author
#2 lore raw
Quoted 8 lines · Stephen Smalley

Most distros do that these days, and it works fine in Fedora, for example.

The technique used in Fedora is to run restorecon -R /dev from rc.sysinit to set the contexts on the /dev nodes set up before the policy load, and udev is already SELinux-aware (if built with SELinux support enabled) and should label any dynamically created nodes appropriately once SELinux policy has loaded.

Ok. I've built udev --with-selinux and it seems now I have a good context (or maybe right?).

Well, my Controlling term: user_u:object_r:user_tty_device_t:s0. Is it normal?

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#3 lore raw
Quoted 10 lines · AlannY
Quoted 8 lines · Stephen Smalley

Most distros do that these days, and it works fine in Fedora, for example.

The technique used in Fedora is to run restorecon -R /dev from rc.sysinit to set the contexts on the /dev nodes set up before the policy load, and udev is already SELinux-aware (if built with SELinux support enabled) and should label any dynamically created nodes appropriately once SELinux policy has loaded.

Quoted 3 lines

Ok. I've built udev --with-selinux and it seems now I have a good context (or maybe right?).

Well, my Controlling term: user_u:object_r:user_tty_device_t:s0. Is it normal?

Yes. user_tty_device_t for a tty, user_devpts_t for a pty.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.