Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Sep 2008 15:26:43 GMT
From:      Anatoly Borodin <anatoly.borodin@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/127270: fsck_msdosfs may crash
Message-ID:  <200809101526.m8AFQhC6082061@www.freebsd.org>
Resent-Message-ID: <200809101530.m8AFU163041787@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         127270
>Category:       misc
>Synopsis:       fsck_msdosfs may crash
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 10 15:30:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Anatoly Borodin
>Release:        7.1-PRERELEASE
>Organization:
>Environment:
FreeBSD hp.home 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Mon Sep  1 16:07:24 EEST 2008     anatoly.borodin@gmail.com:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
I use some FAT32 filesystem from a file image. It has errors, so I tried to check it with fsck_msdosfs /dev/md0 and got this:

** /dev/md0
Floating exception (core dumped)

I compiled fsck_msdosfs with debug information and found the faulty code block at /usr/src/sbin/fsck_msdosfs/boot.c:174

        boot->ClusterOffset = (boot->RootDirEnts * 32 + boot->BytesPerSec - 1)
            / boot->BytesPerSec
            + boot->ResSectors
            + boot->FATs * boot->FATsecs
            - CLUST_FIRST * boot->SecPerClust;

It fails because in my case boot->BytesPerSec == 0. IMHO such condition should be checked, fixed in the FS, but not crashed.

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809101526.m8AFQhC6082061>