misc/127270: fsck_msdosfs may crash

Anatoly Borodin anatoly.borodin at gmail.com
Wed Sep 10 15:30:02 UTC 2008


>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 at 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:


More information about the freebsd-bugs mailing list