Bug 81069 - fdisk -s overflow
Summary: fdisk -s overflow
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: util-linux
Version: 7.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Elliot Lee
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-01-03 23:25 UTC by Thomas Dickson
Modified: 2007-04-18 16:49 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-01-13 21:50:29 UTC
Embargoed:


Attachments (Terms of Use)
This is a patch to sfdisk.c to fix the problem (569 bytes, patch)
2003-01-03 23:33 UTC, Thomas Dickson
no flags Details | Diff

Description Thomas Dickson 2003-01-03 23:25:03 UTC
Description of problem:


The current 7.3 version of fdisk does not correctly respond to the fdisk -s 
command if the drive is over a certain size (at least 1 terabyte). It returns a 
negative number. The problem is in the ioctl call to BLKGETSIZE, which returns a 
UNSIGNED LONG, but fdisk expects a long.




Version-Release number of selected component (if applicable):


2.11n




How reproducible:


run fdisk -s /dev/sda when sda is really big (1.3 terabytes)




Steps to Reproduce:


1. Get a disk over a terabyte (RAID)


2. run fdisk -s on the device


3. compare to fdisk -l on the same device


    


Actual results:


-857118750




Expected results:


1290364897




Additional info:


Error is in fdisk.c

Comment 1 Thomas Dickson 2003-01-03 23:33:42 UTC
Created attachment 89117 [details]
This is a patch to sfdisk.c to fix the problem

Given that the problem is simple and in the last lines of code, we fixed it
ourselves. This patch fixes sfdisk.c - to do the same to fdisk.c should be
trivial.

Thomas Dickson
InoStor, INC.
Poway, CA

Comment 2 Elliot Lee 2003-01-13 21:50:29 UTC
Thanks, will be fixed in 2.11y-2


Note You need to log in before you can comment on or make changes to this bug.