mount -a segfault

Bug #9835 reported by Debian Bug Importer
6
Affects Status Importance Assigned to Milestone
util-linux (Debian)
Fix Released
Unknown
util-linux (Ubuntu)
Fix Released
High
LaMont Jones

Bug Description

Automatically imported from Debian bug report #279306 http://bugs.debian.org/279306

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Automatically imported from Debian bug report #279306 http://bugs.debian.org/279306

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <E1COtty-0000Qy-00@localhost>
Date: Tue, 02 Nov 2004 09:20:26 +0100
From: Nicolas Bouillon <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: mount -a segfault

Package: mount
Version: 2.12h-2
Severity: grave
Justification: renders package unusable

On boot, the filesystems are not automaticaly mounted but "/", and some others filesystems like devfs or usbfs.
The others fs, like /boot, /home, or some /mnt/foo stuffs are not mounted.
Trying :
lisa:/home/bouil# export LANG=C
lisa:/home/bouil# mount -a
Segmentation fault
lisa:/home/bouil#

This can explain why nothing is automaticaly mounted at boot. Mounting each filesystem present on /etc/fstab manually works well.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.7
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)

Versions of packages mount depends on:
ii libc6 2.3.2.ds1-18 GNU C Library: Shared libraries an

-- no debconf information

Revision history for this message
In , Nicolas Bouillon (reportbug-debian) wrote : Bug find...

Re,

Sorry for spambug, but i have found what is the problem.
Commenting somes lines on my fstab gives me the conclusion that this
line is the probem :

#/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...

Hope this bug can be fixed soon, but maybe not so critical as it appears
first.
Thanks.

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Tue, 02 Nov 2004 11:19:41 +0100
From: Nicolas Bouillon <email address hidden>
To: <email address hidden>
Subject: Bug find...

Re,

Sorry for spambug, but i have found what is the problem.
Commenting somes lines on my fstab gives me the conclusion that this
line is the probem :

#/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...

Hope this bug can be fixed soon, but maybe not so critical as it appears
first.
Thanks.

Revision history for this message
In , Max Vozeler (max-hinterhof) wrote : Re: Bug#279306: mount -a segfault

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

--
308E81E7B97963BCA0E6ED889D5BD511B7CDA2DC

Revision history for this message
In , Max Vozeler (max-hinterhof) wrote :

retitle 279306 mount: segfaults on non-existing LABEL=
tags 279306 +patch
thanks

--
308E81E7B97963BCA0E6ED889D5BD511B7CDA2DC

Revision history for this message
Debian Bug Importer (debzilla) wrote :

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
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--
308E81E7B97963BCA0E6ED889D5BD511B7CDA2DC

--7iMSBzlTiPOCCT2k
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename=handle-null-devname

--- 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 */
  spec0 = mount_get_devname(spec0);
+ if (!spec0)
+ return ret;

  spec = canonicalize(spec0);
  node = canonicalize(node0);

--7iMSBzlTiPOCCT2k--

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Tue, 2 Nov 2004 14:11:37 +0100
From: Max Vozeler <email address hidden>
To: <email address hidden>
Subject: mount -a segfault

retitle 279306 mount: segfaults on non-existing LABEL=
tags 279306 +patch
thanks

--
308E81E7B97963BCA0E6ED889D5BD511B7CDA2DC

Revision history for this message
In , LaMont Jones (lamont) wrote : Bug#279306: fixed in util-linux 2.12h-3

Source: util-linux
Source-Version: 2.12h-3

We believe that the bug you reported is fixed in the latest version of
util-linux, which is due to be installed in the Debian FTP archive:

bsdutils_2.12h-3_i386.deb
  to pool/main/u/util-linux/bsdutils_2.12h-3_i386.deb
fdisk-udeb_2.12h-3_i386.udeb
  to pool/main/u/util-linux/fdisk-udeb_2.12h-3_i386.udeb
mount_2.12h-3_i386.deb
  to pool/main/u/util-linux/mount_2.12h-3_i386.deb
util-linux_2.12h-3.diff.gz
  to pool/main/u/util-linux/util-linux_2.12h-3.diff.gz
util-linux_2.12h-3.dsc
  to pool/main/u/util-linux/util-linux_2.12h-3.dsc
util-linux_2.12h-3_i386.deb
  to pool/main/u/util-linux/util-linux_2.12h-3_i386.deb

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
LaMont Jones <email address hidden> (supplier of updated util-linux package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Wed, 3 Nov 2004 10:09:43 -0700
Source: util-linux
Binary: util-linux fdisk-udeb util-linux-locales bsdutils mount
Architecture: i386 source
Version: 2.12h-3
Distribution: unstable
Urgency: low
Maintainer: LaMont Jones <email address hidden>
Changed-By: LaMont Jones <email address hidden>
Description:
 bsdutils - Basic utilities from 4.4BSD-Lite
 fdisk-udeb - Partition a hard drive (manual, cfdisk) (udeb)
 mount - Tools for mounting and manipulating filesystems
 util-linux - Miscellaneous system utilities
Closes: 279306
Changes:
 util-linux (2.12h-3) unstable; urgency=low
 .
   * Fix mount segv's. Closes: #279306
Files:
 0529d8a5781e55aa304628154a3bdaca 375852 base required util-linux_2.12h-3_i386.deb
 4d7d98643fdd534a6134dc7eb2e38e29 668 base required util-linux_2.12h-3.dsc
 953c5a91525c055f9a16b7a847c0d9c7 63518 base required bsdutils_2.12h-3_i386.deb
 ccb6b0638e002597e0ae89076e715f46 139612 base required mount_2.12h-3_i386.deb
 d004a39a36a5ef263c8b444114d1a3c9 68667 base required util-linux_2.12h-3.diff.gz
 dd45d89d68c394e296d0dd0265784139 537254 debian-installer extra fdisk-udeb_2.12h-3_i386.udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBiRVgzN/kmwoKyScRAkIWAJwJWi2FqxbFhmc/tJnUKdhZ0jteOgCgnNtJ
sPypE7RZlPo+2Qw/0PSfKdw=
=TWI1
-----END PGP SIGNATURE-----

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Wed, 03 Nov 2004 12:32:08 -0500
From: LaMont Jones <email address hidden>
To: <email address hidden>
Subject: Bug#279306: fixed in util-linux 2.12h-3

Source: util-linux
Source-Version: 2.12h-3

We believe that the bug you reported is fixed in the latest version of
util-linux, which is due to be installed in the Debian FTP archive:

bsdutils_2.12h-3_i386.deb
  to pool/main/u/util-linux/bsdutils_2.12h-3_i386.deb
fdisk-udeb_2.12h-3_i386.udeb
  to pool/main/u/util-linux/fdisk-udeb_2.12h-3_i386.udeb
mount_2.12h-3_i386.deb
  to pool/main/u/util-linux/mount_2.12h-3_i386.deb
util-linux_2.12h-3.diff.gz
  to pool/main/u/util-linux/util-linux_2.12h-3.diff.gz
util-linux_2.12h-3.dsc
  to pool/main/u/util-linux/util-linux_2.12h-3.dsc
util-linux_2.12h-3_i386.deb
  to pool/main/u/util-linux/util-linux_2.12h-3_i386.deb

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
LaMont Jones <email address hidden> (supplier of updated util-linux package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Wed, 3 Nov 2004 10:09:43 -0700
Source: util-linux
Binary: util-linux fdisk-udeb util-linux-locales bsdutils mount
Architecture: i386 source
Version: 2.12h-3
Distribution: unstable
Urgency: low
Maintainer: LaMont Jones <email address hidden>
Changed-By: LaMont Jones <email address hidden>
Description:
 bsdutils - Basic utilities from 4.4BSD-Lite
 fdisk-udeb - Partition a hard drive (manual, cfdisk) (udeb)
 mount - Tools for mounting and manipulating filesystems
 util-linux - Miscellaneous system utilities
Closes: 279306
Changes:
 util-linux (2.12h-3) unstable; urgency=low
 .
   * Fix mount segv's. Closes: #279306
Files:
 0529d8a5781e55aa304628154a3bdaca 375852 base required util-linux_2.12h-3_i386.deb
 4d7d98643fdd534a6134dc7eb2e38e29 668 base required util-linux_2.12h-3.dsc
 953c5a91525c055f9a16b7a847c0d9c7 63518 base required bsdutils_2.12h-3_i386.deb
 ccb6b0638e002597e0ae89076e715f46 139612 base required mount_2.12h-3_i386.deb
 d004a39a36a5ef263c8b444114d1a3c9 68667 base required util-linux_2.12h-3.diff.gz
 dd45d89d68c394e296d0dd0265784139 537254 debian-installer extra fdisk-udeb_2.12h-3_i386.udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBiRVgzN/kmwoKyScRAkIWAJwJWi2FqxbFhmc/tJnUKdhZ0jteOgCgnNtJ
sPypE7RZlPo+2Qw/0PSfKdw=
=TWI1
-----END PGP SIGNATURE-----

Revision history for this message
LaMont Jones (lamont) wrote :

Fixed in 2.12h-3ubuntu1

Changed in util-linux:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.