From: Matthias Schwarzott <zzam@gentoo.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: udev-140 Bug: udevadm test changing mode of /dev to 660, so making /dev unusuable for users
Date: Wed, 18 Mar 2009 20:37:59 +0000 [thread overview]
Message-ID: <200903182138.00338.zzam@gentoo.org> (raw)
In-Reply-To: <200903181121.48924.zzam@gentoo.org>
[-- Attachment #1: Type: text/plain, Size: 1465 bytes --]
On Mittwoch, 18. März 2009, Kay Sievers wrote:
> On Wed, Mar 18, 2009 at 16:00, Matthias Schwarzott <zzam@gentoo.org> 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
[-- Attachment #2: udev-140-abort-node-creation-on-rename-failure.patch --]
[-- Type: text/x-diff, Size: 370 bytes --]
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 {
prev parent reply other threads:[~2009-03-18 20:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-18 10:21 udev-140 Bug: udevadm test changing mode of /dev to 660, so making /dev unusuable for users Matthias Schwarzott
2009-03-18 10:43 ` udev-140 Bug: udevadm test changing mode of /dev to 660, so Kay Sievers
2009-03-18 15:00 ` udev-140 Bug: udevadm test changing mode of /dev to 660, so making /dev unusuable for users Matthias Schwarzott
2009-03-18 17:52 ` udev-140 Bug: udevadm test changing mode of /dev to 660, so Kay Sievers
2009-03-18 20:37 ` Matthias Schwarzott [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200903182138.00338.zzam@gentoo.org \
--to=zzam@gentoo.org \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).