bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OSKit bug in partition checker


From: Jon Arney
Subject: OSKit bug in partition checker
Date: Sat, 30 Mar 2002 09:36:44 -0700

Hi,

This probably belongs on bug-oskit or something instead of
here, but I just thought I'd point out a problem I found
in the oskit St. Patrick's day release (and prior releases)
dealing with the partition table reading.  It manifested
itself when I began trying to use oskit-mach instead of
gnumach.

It seems that type promotion from 32 bit (oskit_size_t) 
to 64 bit (oskit_off_t) is not automatic and this bug
manifests itself on my system because of the very large
disk and extended partitions I'm using.

At any rate, the problem is that the offset for the read in
diskpart/find_blkio.c overflows on my system unless I explicitly
type-cast the variables to 64 bit offsets (oskit_off_t).

If allowed to overflow, we read the wrong portion of the
disk to find the extended partition entry and the table
gets very confused and can't read the extended partitions.

The following (one line) patch fixes the problem and I can
boot the Hurd with oskit-mach and see all my partitions.

*** oskit-20020317/diskpart/find_blkio.c.orig   Sat Mar 30 09:24:43 2002
--- oskit-20020317/diskpart/find_blkio.c        Sat Mar 30 09:25:00 2002
***************
*** 37,43 ****
        oskit_size_t nbytes;
  
        blksize = oskit_blkio_getblocksize(b);
!       err = oskit_blkio_read(b, buf, start * blksize, blksize,
&nbytes);
        if (err)
                return err;
  
--- 37,43 ----
        oskit_size_t nbytes;
  
        blksize = oskit_blkio_getblocksize(b);
!       err = oskit_blkio_read(b, buf, (oskit_off_t)start *
(oskit_off_t)blksize, blksize, &nbytes);
        if (err)
                return err;
  



Jonathan S. Arney
Software Engineer
jarney1@cox.net
------------------------------------------------------------------------
Some people call me a nihilist.
That would be true except I don't believe in nihilism.
------------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]