You are not logged in.

#1 2020-06-03 13:54:58

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 190
Website

[SOLVED] Where is the udev rule for /dev/null? (wrong permissions)

I am having issues with my system, which I have tracked down to /dev/null (and many other files in /dev) having the wrong permissions.  /dev/null is supposed to be 0666/root:root but mine is 0660/root:users.

If I manually fix the mode/owner/group, after each reboot they get set back to the wrong ones again.

Google says the udev rules for /dev/null are in /usr/lib/udev/rules.d/50-udev-default.rules but using grep I can't find the word "null" in any of the rules.

Where is the udev rule for /dev/null?

Last edited by Malvineous (2020-06-04 13:58:29)

Offline

#2 2020-06-03 14:09:27

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,858
Website

Re: [SOLVED] Where is the udev rule for /dev/null? (wrong permissions)

There isn't one. At least, not by default.

What does

udevadm test $(udevadm info -q path /dev/null)

tell you?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2020-06-03 14:15:44

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 190
Website

Re: [SOLVED] Where is the udev rule for /dev/null? (wrong permissions)

It says:

Load module index
Parsed configuration file /usr/lib/systemd/network/99-default.link
Created link configuration context.
Reading rules file: /usr/lib/udev/rules.d/01-md-raid-creating.rules
[...]
Reading rules file: /usr/lib/udev/rules.d/99-systemd.rules
Invalid inotify descriptor.
DEVPATH=/devices/virtual/mem/null
DEVNAME=/dev/null
DEVMODE=0666
MAJOR=1
MINOR=3
ACTION=add
SUBSYSTEM=mem
USEC_INITIALIZED=68207093
Unload module index
Unloaded link configuration context.

After running it the permissions on /dev/null are restored (until the next reboot), but the group is still incorrect.

Offline

#4 2020-06-03 14:23:27

seth
Member
Registered: 2012-09-03
Posts: 51,175

Re: [SOLVED] Where is the udev rule for /dev/null? (wrong permissions)

many […] files in /dev having the wrong permissions

You have some rule or other script in place to "fix" the permissions for some device (camera or so) and that rule has a bad match pattern?

Offline

#5 2020-06-03 14:30:46

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 190
Website

Re: [SOLVED] Where is the udev rule for /dev/null? (wrong permissions)

I do have custom rules but I have been using them for a long time (years) with no issue.  I am trying to migrate that working system onto this new one, and the new one has the wrong /dev permissions.

I can't figure out what could be causing it because it's a direct copy of the source system.  I used rsync to mirror the base filesystem (excluding things like /dev on devtmpfs) so all the rules are the same.  I just deleted everything in /etc/udev/rules.d/ so I'm rebooting now to see if that does anything.

EDIT: That was the problem!  I had this custom rules file:

# Make normal users able to capture events coming off the mouse
ENV{ID_VENDOR_ID}=="046d", ENV{ID_MODEL_ID}=="c525", GROUP="users", MODE="0660"
ENV{ID_VENDOR_ID}=="046d", ENV{ID_MODEL_ID}=="c52b", GROUP="users", MODE="0660"

What have I done wrong to make that rule work for years but only stop working now?  (Or rather work *too* well now, matching /dev/null, /dev/urandom, /dev/tty*, etc.)

(As to the rsync copy, I must've done a pacman system upgrade on the source machine but not rebooted, so this clone of the machine is running a newer version of udev - installed on the source machine but not yet running until the next reboot).

Last edited by Malvineous (2020-06-03 14:43:36)

Offline

#6 2020-06-03 18:41:14

seth
Member
Registered: 2012-09-03
Posts: 51,175

Re: [SOLVED] Where is the udev rule for /dev/null? (wrong permissions)

Try adding

SUBSYSTEM=="usb"

Offline

#7 2020-06-04 13:57:12

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 190
Website

Re: [SOLVED] Where is the udev rule for /dev/null? (wrong permissions)

Interesting, that fixed the problem, I wonder why that is?

Offline

#8 2020-06-04 14:11:57

seth
Member
Registered: 2012-09-03
Posts: 51,175

Re: [SOLVED] Where is the udev rule for /dev/null? (wrong permissions)

There was no context for the rule (so it would have met scsi, pci, everything) and my theory was that the ID match for the affected devices might have changed from 0 to * (/dev/null does not have a product/vendor ID and while this might previously have caused a mismatch, it's now just ignored)

Offline

#9 2020-06-05 20:16:21

loqs
Member
Registered: 2014-03-06
Posts: 17,369

Re: [SOLVED] Where is the udev rule for /dev/null? (wrong permissions)

Link to Malvineous's upstream bug report.

Offline

Board footer

Powered by FluxBB