FS#26583 - [udev] wrong permissions on /dev/null
Attached to Project:
Arch Linux
Opened by Otto Allmendinger (OttoA) - Sunday, 23 October 2011, 11:23 GMT
Last edited by Tom Gundersen (tomegun) - Tuesday, 01 November 2011, 18:32 GMT
Opened by Otto Allmendinger (OttoA) - Sunday, 23 October 2011, 11:23 GMT
Last edited by Tom Gundersen (tomegun) - Tuesday, 01 November 2011, 18:32 GMT
|
Details
[tomegun: trimmed away unrelated stuff]
Upgrading udev to 174-1 caused some nodes under /dev/ to have the wrong permissions. For example, the permissions /dev/null are set to 0660 instead of 0666, causing all kinds of problems. Downgrade to 173-3 fixes all issues. |
This task depends upon
Closed by Tom Gundersen (tomegun)
Tuesday, 01 November 2011, 18:32 GMT
Reason for closing: None
Additional comments about closing: Nothing we can do. Remove old rules, or if a package ships with broken rules (they should not), report a bug.
Tuesday, 01 November 2011, 18:32 GMT
Reason for closing: None
Additional comments about closing: Nothing we can do. Remove old rules, or if a package ships with broken rules (they should not), report a bug.
I am not able to reproduce your problem with /dev/null. Could you point out any other wrong permissions? Any relevant errors in dmesg?
Just to make absolutely sure: you are booted using the stock Arch kernel?
I attached the outputs of "ls -lR /dev" (without timestamps), using udev-173 and udev-174 and the output of dmesg using udev-174
Dmesg indicates that udev starts *twice*, once version 173, later version 174.
With udev-173 it also starts twice on this system, but with the same version number.
devtree-udev-173 (33 KiB)
devtree-udev-174-postboot (31.9 KiB)
Delete /etc/udev/rules.d/*
Reinstall udev (and verify that the rule file dave mentioned is installed correctly)
Make sure /boot is mounted
mkinitcpio -p linux
Reboot.
Thanks for the fix, it also worked. I had some old udev rules under rules.d
I checked for the /dev/null rule to be added to the ramdisk:
# mkinitcpio -v -p linux
...
adding file: /lib/udev/rules.d/50-udev-default.rules
...
And
$ dmesg | grep udev
[ 1.006147] udevd[37]: starting version 174
[ 14.928376] udevd[332]: starting version 174
So that was not the problem. Then I killed udevd, started it in debugging mode and checked for errors, which gave me this:
[717.203453] [7046] parse_file: reading '/lib/udev/rules.d/90-alsa-restore.rules' as rules file
[717.203547] [7046] parse_file: reading '/lib/udev/rules.d/95-calibre.rules' as rules file
[717.203604] [7046] add_rule: unknown key 'BUS' in /lib/udev/rules.d/95-calibre.rules:2
[717.203633] [7046] add_rule: unknown key 'SYSFS{idProduct}' in /lib/udev/rules.d/95-calibre.rules:2
[717.203656] [7046] add_rule: unknown key 'SYSFS{idVendor}' in /lib/udev/rules.d/95-calibre.rules:2
[717.203770] [7046] util_lookup_group: specified group 'usb' unknown
[717.203822] [7046] parse_file: reading '/lib/udev/rules.d/95-cd-devices.rules' as rules file
Interestingly, this information did not appear in /var/log/daemond.log and in no other logfile.
Obviously, this is a faulty rule residing in /lib/udev/rules.d, like mentioned in this post except for the path.
I removed it, rebuilt my initrd and rebootet. Also I discovered an old calibre install on my system, but this is another topic.
Of course its my own fault, but the question is, WHY does udev stop working because of ONE single wrong rule?
I think now I finally understand what is going on. I had assumed your logs would be filled with warnings about broken rules if you had any SYSFS keys, but apparently not.
You are right that udev should not break just because of one broken key. I think a recent patch in git solves the issue by ignoring the whole rule, rather than just the broken key. I guess we still might get lots of problems even with that patch applied though (imagine a set of rules that starts with a rule that matches on SYSFS and jumps to "end" if it does (or does not) match, this set of rules would now be applied unconditionally to all devices as the first line is ignored.
The only thing we can do is to hunt down broken packages and fix their rules (there should have been warnings about this for years already).
I think now I finally understand what is going on. I had assumed your logs would be filled with warnings about broken rules if you had any SYSFS keys, but apparently not.
You are right that udev should not break just because of one broken key. I think a recent patch in git solves the issue by ignoring the whole rule, rather than just the broken key. I guess we still might get lots of problems even with that patch applied though (imagine a set of rules that starts with a rule that matches on SYSFS and jumps to "end" if it does (or does not) match, this set of rules would now be applied unconditionally to all devices as the first line is ignored.
The only thing we can do is to hunt down broken packages and fix their rules (there should have been warnings about this for years already).