Skip to contentSkip to conversation

mount accessing /dev/cdrom as a symlink

PATCH Luke Kenneth Casson Leighton 2 participants 3 messages Aug 28, 2004 – Aug 29, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

i had to add this to the mount.te policy in order to allow mount to actually succeed on a udev-automatically-created /dev/cdrom symlink (to /dev/hdc which is my ide cdrom drive).

so, the question is: should udev have relabelled that symlink correctly, or should mount be allowed to read device_t symlinks?

bearing in mind that it's the udev *SCRIPTS* in /etc/udev that will be creating the symlink, NOT the udevd program, nor the udev program, nor the udevsend program.

likely to have been /etc/udev/ide-devfs.sh that done it, 'guv.

l.

program/mount.te renamed from usr/share/selinux/policy/default.1.14/domains/program/mount.te +3 -0
@@ -96,3 +97,6 @@
 allow mount_t mnt_t:dir { getattr };
 dontaudit mount_t { userdomain kernel_t}:fd use;
 can_exec(mount_t, { sbin_t bin_t })
+
+allow mount_t device_t:lnk_file { read };
+	#EXE=/bin/mount  NAME=cdrom   :  read
Signature · 13 lines
--
Truth, honesty and respect are rare commodities that all spring from
the same well: Love.  If you love yourself and everyone and everything
around you, funnily and coincidentally enough, life gets a lot better.
--
<a href="http://lkcl.net">      lkcl.net      </a> <br />
<a href="mailto:[email protected]"> [email protected] </a> <br />


--
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 6 lines · Luke Kenneth Casson Leighton

i had to add this to the mount.te policy in order to allow mount to actually succeed on a udev-automatically-created /dev/cdrom symlink (to /dev/hdc which is my ide cdrom drive).

so, the question is: should udev have relabelled that symlink correctly, or should mount be allowed to read device_t symlinks?

Mount should be allowed to read device_t symlinks. There should be no symlink under /dev with a type other than device_t under the current design.

Signature · 9 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

--
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.
#2 lore raw
Quoted 10 lines · Russell Coker
Quoted 6 lines · Luke Kenneth Casson Leighton

i had to add this to the mount.te policy in order to allow mount to actually succeed on a udev-automatically-created /dev/cdrom symlink (to /dev/hdc which is my ide cdrom drive).

so, the question is: should udev have relabelled that symlink correctly, or should mount be allowed to read device_t symlinks?

Mount should be allowed to read device_t symlinks. There should be no symlink under /dev with a type other than device_t under the current design.

okay, great. so for once i DidTheRightThing. gosh.

--
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.