Skip to contentSkip to conversation

udev has had udev_selinux removed - argh!

DISCUSSION Luke Kenneth Casson Leighton 4 participants 6 messages Jul 29, 2004 – Jul 30, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

hi there,

gentoo have pulled udev from their distribution because the udev_selinux program has been removed from udev and replaced with a /etc/dev.d/default/selinux script.

whilst this is reported as "WorkingForRedHat(tm)", i would be very grateful if the functionality could be returned such that it can be optionally compiled back in.

udev_selinux is not like udev_dbus: udev_dbus was pulled because it took 1 millisecond per file (most likely due to dbus not having a threadpool and not having unix-domain-socket listeners in its server back-end).

i have a question for you: is there the possibility of a race condition in between udev creating nodes in /dev, and the scripts in /etc/dev.d/default getting at them?

for example, could /dev/usbtts0 be created if i plug in a USB modem, and hotplug or a manual process fire up pppd BEFORE /etc/dev.d/default/selinux gets to it?

because if so, things are going to fail unexpectedly.

how has this issue been addressed in udev, and also, whilst i realise that Fedora accept the /etc/dev.d/default/selinux change, it should concern you that gentoo do not [and therefore, like a lemming oblique stroke sheep, i'd rather not, for my debian distro].

l.

Signature · 20 lines
-- 
Information I post is with honesty, integrity, and the expectation that
you will take full responsibility if acting on the information contained,
and that, should you find it to be flawed or even mildly useful, you
will act with both honesty and integrity in return - and tell me.
--
<a href="http://lkcl.net">      lkcl.net      </a> <br />
<a href="mailto:[email protected]"> [email protected] </a> <br />



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_idG21&alloc_id040&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#1 lore raw
Quoted 5 lines · Luke Kenneth Casson Leighton

hi there,

gentoo have pulled udev from their distribution because the udev_selinux program has been removed from udev and replaced with a /etc/dev.d/default/selinux script.

No they have not. As the Gentoo udev maintainer, I would have heard about this :) I see it in the gentoo tree just fine.

Now as to issues if the "hardened Gentoo" people currently like to use udev or not, well that is a different issue...

Quoted 3 lines

whilst this is reported as "WorkingForRedHat(tm)", i would be very grateful if the functionality could be returned such that it can be optionally compiled back in.

Great, send me patches to do this. I'm not a selinux developer, so I rely on someone else to support this if they want to. The previous patches for selinux in udev were not working, so they were removed.

Quoted 3 lines

i have a question for you: is there the possibility of a race condition in between udev creating nodes in /dev, and the scripts in /etc/dev.d/default getting at them?

Only if your startup scripts are stupid. :)

Quoted 3 lines

for example, could /dev/usbtts0 be created if i plug in a USB modem, and hotplug or a manual process fire up pppd BEFORE /etc/dev.d/default/selinux gets to it?

That's a different question than the one above.
Sure, that could happen, it just proves that udev needs to have selinux support added into it, to prevent this from happening.

Quoted 1 line

because if so, things are going to fail unexpectedly.

Yup. Good luck :)

Quoted 5 lines

how has this issue been addressed in udev, and also, whilst i realise that Fedora accept the /etc/dev.d/default/selinux change, it should concern you that gentoo do not [and therefore, like a lemming oblique stroke sheep, i'd rather not, for my debian distro].

Again, patches are welcome.

thanks,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw

hello greg,

well i tried compiling udev-024 and it was a pain, plus i got udev-030 to work and decided it wasn't worth the effort, the users can JustLiveWithIt(tm) until it's fixed properly.

greg, do you have any objections to me doing a "proper" job, which is to patch udev-add.c to use some libselinux1 functions that will "prime" the selinux module with the right context, such that when the node (and the symlink!) are individually created, they are individually created with the correct context - there and then.

not post-creation, which is what udev_selinux and also the use of restorecon do.

l.

Quoted 7 lines · Greg KH
Quoted 5 lines · Luke Kenneth Casson Leighton

hi there,

gentoo have pulled udev from their distribution because the udev_selinux program has been removed from udev and replaced with a /etc/dev.d/default/selinux script.

Quoted 5 lines

No they have not. As the Gentoo udev maintainer, I would have heard about this :) I see it in the gentoo tree just fine.

Now as to issues if the "hardened Gentoo" people currently like to use udev or not, well that is a different issue...

ah, likely.

Quoted 37 lines
Quoted 3 lines

whilst this is reported as "WorkingForRedHat(tm)", i would be very grateful if the functionality could be returned such that it can be optionally compiled back in.

Great, send me patches to do this. I'm not a selinux developer, so I rely on someone else to support this if they want to. The previous patches for selinux in udev were not working, so they were removed.

Quoted 3 lines

i have a question for you: is there the possibility of a race condition in between udev creating nodes in /dev, and the scripts in /etc/dev.d/default getting at them?

Only if your startup scripts are stupid. :)

Quoted 3 lines

for example, could /dev/usbtts0 be created if i plug in a USB modem, and hotplug or a manual process fire up pppd BEFORE /etc/dev.d/default/selinux gets to it?

That's a different question than the one above.
Sure, that could happen, it just proves that udev needs to have selinux support added into it, to prevent this from happening.

Quoted 1 line

because if so, things are going to fail unexpectedly.

Yup. Good luck :)

Quoted 5 lines

how has this issue been addressed in udev, and also, whilst i realise that Fedora accept the /etc/dev.d/default/selinux change, it should concern you that gentoo do not [and therefore, like a lemming oblique stroke sheep, i'd rather not, for my debian distro].

Again, patches are welcome.

thanks,

greg k-h

Signature · 14 lines
-- 
Information I post is with honesty, integrity, and the expectation that
you will take full responsibility if acting on the information contained,
and that, should you find it to be flawed or even mildly useful, you
will act with both honesty and integrity in return - and tell me.
--
<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.
#3 lore raw
In reply to Luke Kenneth Casson Leighton
Quoted 11 lines · Luke Kenneth Casson Leighton

hello greg,

well i tried compiling udev-024 and it was a pain, plus i got udev-030 to work and decided it wasn't worth the effort, the users can JustLiveWithIt(tm) until it's fixed properly.

greg, do you have any objections to me doing a "proper" job, which is to patch udev-add.c to use some libselinux1 functions that will "prime" the selinux module with the right context, such that when the node (and the symlink!) are individually created, they are individually created with the correct context - there and then.

How do we solve the klibc build, if selinux is used internally? We've moved it to a external program for that reason.

Kay

-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
Quoted 7 lines · Kay Sievers
Quoted 6 lines · Luke Kenneth Casson Leighton

hello greg,

well i tried compiling udev-024 and it was a pain, plus i got udev-030 to work and decided it wasn't worth the effort, the users can JustLiveWithIt(tm) until it's fixed properly.

Quoted 8 lines
Quoted 5 lines

greg, do you have any objections to me doing a "proper" job, which is to patch udev-add.c to use some libselinux1 functions that will "prime" the selinux module with the right context, such that when the node (and the symlink!) are individually created, they are individually created with the correct context - there and then.

How do we solve the klibc build, if selinux is used internally? We've moved it to a external program for that reason.

if i understand you correctly (i don't know what klibc is):

i'd recommend leaving it up to distributions to decide to create (or not) two _separate_ packages, se_udev and udev.

if you can at least provide an option --with-selinux in the configure script, distros can make the decision.

l.

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

#5 lore raw
In reply to Luke Kenneth Casson Leighton
Quoted 2 lines · Kay Sievers

How do we solve the klibc build, if selinux is used internally? We've moved it to a external program for that reason.

Eventually initramfs tools will have to support selinux too, until then I think we can safely assume that people needing a klibc-linked udev will not use selinux.

Signature · 13 lines
ciao, |
Marco | [7369 inV7ugMmso4Kk]


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel