On Tue, Nov 02, 2004 at 11:19:41AM +0100, Nicolas Bouillon wrote:
> #/dev/hdb1
> LABEL=17Go /mnt/17Go ext3 errors=remount-ro 0 0
>
> In fact, the 17Go partition label is not present on my system anymore.
> Then, mount fails, that can be considered normal, but with a segfault...
I could reproduce this by having a LABEL=something in fstab of a system
without any volume labels present.
The check in mounted() doesn't handle the case where mount_get_devname()
returns NULL when it can't find the associated device. Instead it passes
the NULL pointer on to streq() which then causes the segfault.
The attached patch makes mounted() return immediately in that case. With
this mount outputs instead of segfaulting:
mount: special device LABEL=something does not exist
> Hope this bug can be fixed soon, but maybe not so critical as it appears
> first.
Message-ID: <email address hidden>
Date: Tue, 2 Nov 2004 14:08:36 +0100
From: Max Vozeler <email address hidden>
To: Nicolas Bouillon <email address hidden>,
<email address hidden>
Subject: Re: Bug#279306: mount -a segfault
--7iMSBzlTiPOCCT2k Disposition: inline
Content-Type: text/plain; charset=us-ascii
Content-
On Tue, Nov 02, 2004 at 11:19:41AM +0100, Nicolas Bouillon wrote:
> #/dev/hdb1
> LABEL=17Go /mnt/17Go ext3 errors=remount-ro 0 0
>
> In fact, the 17Go partition label is not present on my system anymore.
> Then, mount fails, that can be considered normal, but with a segfault...
I could reproduce this by having a LABEL=something in fstab of a system
without any volume labels present.
The check in mounted() doesn't handle the case where mount_get_devname()
returns NULL when it can't find the associated device. Instead it passes
the NULL pointer on to streq() which then causes the segfault.
The attached patch makes mounted() return immediately in that case. With
this mount outputs instead of segfaulting:
mount: special device LABEL=something does not exist
> Hope this bug can be fixed soon, but maybe not so critical as it appears
> first.
> Thanks.
Cheers,
Max
-- CA0E6ED889D5BD5 11B7CDA2DC
308E81E7B97963B
--7iMSBzlTiPOCCT2k Disposition: inline; filename= handle- null-devname
Content-Type: text/plain; charset=us-ascii
Content-
--- mount/mount.c.orig 2004-11-02 13:52:31.000000000 +0100
+++ mount/mount.c 2004-11-02 13:52:51.000000000 +0100
@@ -1190,6 +1190,8 @@
/* Handle possible UUID= and LABEL= in spec */ devname( spec0);
spec0 = mount_get_
+ if (!spec0)
+ return ret;
spec = canonicalize( spec0); node0);
node = canonicalize(
--7iMSBzlTiPOCC T2k--