Re: udev-140 Bug: udevadm test changing mode of /dev to 660, so making /dev unusuable for users

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mittwoch, 18. März 2009, Kay Sievers wrote:
> On Wed, Mar 18, 2009 at 16:00, Matthias Schwarzott <zzam@xxxxxxxxxx> wrote:
> > On Mittwoch, 18. März 2009, Matthias Schwarzott wrote:
> >> This time I have a very strange error. I tried what happens when using
> >> # udevadm test /sys/class/mem/null
> >>
> >> and strange, a bit later some user processes had problems accessing
> >> /dev/null. A quick check showed, that the permissions of /dev were
> >> destroyed.
> >>
> >> # ls -ld /dev /dev/null
> >> drw-rw---- 16 root root 4280 18. Mär 11:14 /dev
> >> crw-rw-rw-  1 root root 1, 3 17. Mär 08:05 /dev/null
> >
> > I found out how the error occurs:
> > It is a difference between
> > A. udevadm test /sys/class/mem/null/
> > and
> > B. udevadm test /sys/class/mem/null
> >
> > Case A was the case that showed the error behaviour. It seems udevadm is
> > confused by the trailing slash. This behaviour seems to be there since
> > ages.
>
> Should be fixed now.
>
Works fine, thanks for the quick fix.

Still I can easily find more ways to fool udevadm test going wrong.

# udevadm test /sys/class/mem/null/./
Fail in the same way.
udev_event_execute_rules: no node name set, will use kernel name '.'

Maybe it helps to make the node creation abort in case of rename failure, 
patch attached. But I have no real understanding of all codepathes there, so 
maybe this solution is not possible/correct.

Regards
Matthias
diff --git a/udev/udev-node.c b/udev/udev-node.c
index 74ec00b..92a680d 100644
--- a/udev/udev-node.c
+++ b/udev/udev-node.c
@@ -106,6 +106,7 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod
 			if (err != 0) {
 				err(udev, "rename(%s, %s) failed: %m\n", file_tmp, file);
 				unlink(file_tmp);
+				goto exit;
 			}
 		}
 	} else {

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux