Bug#263079: udev: missing mknod on ppp
Quoted 3 lines · Luke Kenneth Casson Leighton
thank you for pointing me at the README.Debian because it makes clear that for SE/Linux there are certain /dev entries that may not get fired up by udev, and consequently won't have se/linux permissions set!
On debian, *all* devices are supposed to be created by udev if udev is installed (because /dev is a tmpfs).
I don't know why /dev/ppp is not being created on your system.
Quoted 2 lines
i've had to modify
/etc/init.d/udevto do a manual/sbin/restoreconon all entries listed in/etc/udev/links.conf.
This is a special-case, links.conf is supposed to be used *only* to create some symlinks and directories. I do not know enough about SE Linux to tell how it should be integrated with this.
Quoted 2 lines
i have some vague and rushed recollection of forcibly doing an
/sbin/restoreconin/etc/init.d/modutils, too.
/etc/init.d/modutils is 2.4.x stuff.
Quoted 3 lines
the issue is, therefore that
/etc/init.d/modutilswill endeavour to manually install modules at startup - even before udev is run - and it doesn't bother to set the selinux permissions.
No, it will not: udev is run S04 and module-init-tools at S20 of rcS.d.
Signature · 13 lines
ciao, | Marco | [7409 chrEQYAoOSJpw] ------------------------------------------------------- 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
Quoted 11 lines · Marco d'Itri
Quoted 2 lines · Luke Kenneth Casson Leighton
udev appears to be missing out ppp: i got a request to mknod
/dev/pppc 108 0 when running pon providerI see no sign of this being an udev bug.
Please upgrade your kernel and read again README.Debian. If you don't have/sys/class/ppp/ppp/dev, your kernel is too old.Signature · 2 lines
ciao, | Marco | [7408 op/KllxVxdFKI]
Script started on Tue Aug 3 00:07:18 2004
highfield:~# more /etc/motd Linux highfield 2.6.6-selinux1 #5 Tue May 18 16:33:29 GMT 2004 i686 GNU/Linux highfield:~# ls /sys/class/ppp/ppp/dev /sys/class/ppp/ppp/dev highfield:~# Script done on Tue Aug 3 00:07:30 2004
so this might be a kernel bug then?
thank you for pointing me at the README.Debian because it makes clear that for SE/Linux there are certain /dev entries that may not get fired up by udev, and consequently won't have se/linux permissions set!
i've had to modify /etc/init.d/udev to do a manual /sbin/restorecon on all entries listed in /etc/udev/links.conf.
i have some vague and rushed recollection of forcibly doing an /sbin/restorecon in /etc/init.d/modutils, too.
does anyone have any suggestions on how /etc/modutils should be dealt with on a tmpfs-mounted /dev?
bearing in mind that a [patched, see
http://hands.com/~lkcl/selinux/2.6.6 tmfs-xattr patch] selinux tmpfs would be mounted with NO initial selinux permissions, and that ANYTHING that goes into it will need to have a security context set on it for there to be any chance of it being accessible.
the issue is, therefore that /etc/init.d/modutils will endeavour to manually install modules at startup - even before udev is run - and it doesn't bother to set the selinux permissions.
and also, as this initial bug might be raising, if udev doesn't notice a device driver, /sbin/restorecon (or equivalent) won't ever get called.
ideas, anyone?
l.
-------------------------------------------------------
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
Quoted 11 lines · Marco d'Itri
Quoted 4 lines · Luke Kenneth Casson Leighton
thank you for pointing me at the README.Debian because it makes clear that for SE/Linux there are certain /dev entries that may not get fired up by udev, and consequently won't have se/linux permissions set!
On debian, *all* devices are supposed to be created by udev if udev is installed (because /dev is a tmpfs). I don't know why
/dev/pppis not being created on your system.
Bedause the ppp-generic module is not autoloaded (put it into /etc/modules or see below).
The same problem exists for all "non-hardware" modules. It can be solved by explicitly loading all these non-hardware modules at system startup. The following bootscriptlet loads all modules that potentially create devices and don't need hardware (i.e. exactly those drivers that are autoloaded on demand due to "char-major" aliases without udev):
KVERSION=`uname -r`
for module in `egrep '^alias (char|block)-major' \
/lib/modules/$KVERSION/modules.alias /etc/modprobe.conf | \
grep -v 1394 | awk '{print $3;}'`
do
modprobe $module
doneI think it should be a part of Debian udev package (add some blacklist facility if you wish). "grep -v 1394" is because of the kernel bug mentioned here:
http://lkml.org/lkml/2004/5/30/143
Signature · 16 lines
Alexander E. Patrakov ------------------------------------------------------- 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
Quoted 8 lines · Marco d'Itri
Quoted 3 lines · Luke Kenneth Casson Leighton
thank you for pointing me at the README.Debian because it makes clear that for SE/Linux there are certain /dev entries that may not get fired up by udev, and consequently won't have se/linux permissions set!
On debian, *all* devices are supposed to be created by udev if udev is installed (because /dev is a tmpfs).
I don't know why/dev/pppis not being created on your system.
this could have something to do with it: it looks like udev is not quick enough to create the device node in time for pppd to use it.
Aug 3 09:18:49 localhost udev[3255]: creating device node '/dev/ttyUSB0' Aug 3 09:18:54 localhost pppd[3258]: pppd is unable to open the /dev/ppp device. You need to create the /dev/ppp device node by executing the following command as root: ^Imknod /dev/ppp c 108 0 Aug 3 09:19:02 localhost kernel: CSLIP: code copyright 1989 Regents of the University of California Aug 3 09:19:02 localhost kernel: PPP generic driver version 2.4.2 Aug 3 09:19:02 localhost pppd[3270]: pppd 2.4.2 started by root, uid 0 Aug 3 09:19:02 localhost udev[3269]: creating device node '/dev/ppp'
Quoted 6 lines
Quoted 3 lines
i've had to modify
/etc/init.d/udevto do a manual/sbin/restoreconon all entries listed in/etc/udev/links.conf.This is a special-case, links.conf is supposed to be used *only* to create some symlinks and directories. I do not know enough about SE Linux to tell how it should be integrated with this.
i do.
i've patched my kernel to have tmpfs(shmfs) support se/linux attributes.
_anything_ that goes into the /dev-mounted tmpfs _must_ have selinux attributes set on them.
in the case of a persistent filesystem (ext2 etc) those attributes can be set once, and subsequently ignored.
of course, with a tmpfs, then it's a bit like saying it's okay to create entries in /dev with chmod 0000 and not calling chgrp, we'll do it later sort of thing.
so any symlinks and directories, also you _must_ call /sbin/restorecon or some equivalent.
i've patched udev-0.030 to do likewise: all inodes, all directories (including subdirectories) and all symlinks in fact all creates, are now created with the correct selinux context.
Quoted 9 lines
Quoted 3 lines
i have some vague and rushed recollection of forcibly doing an
/sbin/restoreconin/etc/init.d/modutils, too.
/etc/init.d/modutilsis 2.4.x stuff.Quoted 3 lines
the issue is, therefore that
/etc/init.d/modutilswill endeavour to manually install modules at startup - even before udev is run - and it doesn't bother to set the selinux permissions.No, it will not: udev is run S04 and module-init-tools at S20 of rcS.d.
hm, then should that order be reversed, or do you think that module-init-tools should be fixed?
(or other)
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.
Quoted 22 lines · Alexander E. Patrakov
Quoted 11 lines · Marco d'Itri
Quoted 4 lines · Luke Kenneth Casson Leighton
thank you for pointing me at the README.Debian because it makes clear that for SE/Linux there are certain /dev entries that may not get fired up by udev, and consequently won't have se/linux permissions set!
On debian, *all* devices are supposed to be created by udev if udev is installed (because /dev is a tmpfs). I don't know why
/dev/pppis not being created on your system.Bedause the ppp-generic module is not autoloaded (put it into
/etc/modulesor see below).The same problem exists for all "non-hardware" modules. It can be solved by explicitly loading all these non-hardware modules at system startup. The following bootscriptlet loads all modules that potentially create devices and don't need hardware (i.e. exactly those drivers that are autoloaded on demand due to "char-major" aliases without udev):
Quoted 8 lines
KVERSION=`uname -r`
for module in `egrep '^alias (char|block)-major' \
/lib/modules/$KVERSION/modules.alias /etc/modprobe.conf | \
grep -v 1394 | awk '{print $3;}'`
do
modprobe $module
doneokay.
in addition to calling modprobe, it is necessary to set selinux permissions.
now, modprobe has a pretty name, but the command to call up the module contains no information about what node is going to be created in /dev.
therefore, we have a problem.
without the name of the inode, the only way to set the selinux file permissions is to either guess or to just... endeavour to set the whole lot with this:
setfiles /etc/selinux/.../file_contexts/file_contexts /dev
this is totally yuk, but is a last resort measure.
anyone got any better ideas?
does anyone know whether doing the modprobe above will result in a hotplug event from the "non-hardware" devices, such that udev will be triggered, and a restorecon or createcon performed correctly?
marco kindly mentioned to me that some devices haven't been hooked into the pci-hotplug stuff yet.
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.
Quoted 1 line · Alexander E. Patrakov
Bedause the ppp-generic module is not autoloaded (put it into
I know. My fault then, I assumed that the user had RTFM as instructed.
Quoted 2 lines
The same problem exists for all "non-hardware" modules. It can be solved by explicitly loading all these non-hardware modules at system startup.
I have already seen the code you propose, but it does much more than
this: it loads almost *all* modules and I'm not inclined to add this to the default configuration.
The debian hotplug package, with my patches, is now able to autoload the modules for most hardware (notably floppy and rtc too), so the only non-autoloaded modules left are ppp_generic and loop.
Also, I do not believe that the udev init script should be in the business of loading drivers.
Signature · 13 lines
ciao, | Marco | [7411 pePSA8Hje7qDQ] ------------------------------------------------------- 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
Quoted 3 lines · Luke Kenneth Casson Leighton
does anyone know whether doing the modprobe above will result in a hotplug event from the "non-hardware" devices, such that udev will be triggered, and a restorecon or createcon performed correctly?
Yes, it will.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
the issue is, therefore that
/etc/init.d/modutilswill endeavour to manually install modules at startup - even before udev is run - and it doesn't bother to set the selinux permissions.No, it will not: udev is run S04 and module-init-tools at S20 of rcS.d.
hm, then should that order be reversed, or do you think that module-init-tools should be fixed?
I see nothing broken here.
Signature · 13 lines
ciao, | Marco | [7412 alLaOcAiVbgKs] ------------------------------------------------------- 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
Quoted 10 lines · Marco d'Itri
Quoted 1 line · Alexander E. Patrakov
Bedause the ppp-generic module is not autoloaded (put it into
I know. My fault then, I assumed that the user had RTFM as instructed.
Quoted 2 lines
The same problem exists for all "non-hardware" modules. It can be solved by explicitly loading all these non-hardware modules at system startup.
I have already seen the code you propose, but it does much more than
this: it loads almost *all* modules and I'm not inclined to add this to the default configuration.
It loads the following:
the modules that it is intended to load (good, see the list below) old cdrom drivers (bad)
watchdogs (very bad)
Quoted 3 lines
The debian hotplug package, with my patches, is now able to autoload the modules for most hardware (notably floppy and rtc too), so the only non-autoloaded modules left are
ppp_genericand loop.
You are an optimist. The more complete list of undetectable (and unloadable with udev) non-hardware modules in Debian Sarge that want to create devices is:
microcode
apm
ppdev
nvram
lp
loop
tun
ppp-generic
(not sure if I want to see sg here)
The list is rather short :) so they look like good candidates for /etc/modules. Also please solve the snd-pcm-oss-and-the-like problem:
add the following to modprobe.conf when installing udev:
install snd-pcm modprobe -i snd-pcm ; modprobe snd-pcm-oss ; true install snd-seq modprobe -i snd-seq ; modprobe snd-seq-oss ; true install parport modprobe -i parport ; modprobe lp ; modprobe \
ppdev ; true
install mptbase modprobe -i mptbase ; modprobe mptscsih ; modprobe \
mptctl ; modprobe mptlan ; true
install scsi-mod modprobe -i scsi-mod ; modprobe sd-mod ; modprobe \
sr-mod ; true # sg may be better added here
The problem is that module autoloading due to char-majors breaks with udev, and no package wants to load them instead. So you have virtually no choice: either put these entries into /etc/modules at udev installation (maybe after asking the user a question), or make a new package (that contains just these /etc/modules entries) and make the udev package recommend it, or just leave the current broken situation.
Signature · 13 lines
Alexander E. Patrakov ------------------------------------------------------- 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