Bug 158930 - 32-bit GETBLKSIZE ioctl overflows incorrectly on 64-bit hosts.
Summary: 32-bit GETBLKSIZE ioctl overflows incorrectly on 64-bit hosts.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Stephen Tweedie
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks: 156322
TreeView+ depends on / blocked
 
Reported: 2005-05-26 22:43 UTC by Stephen Tweedie
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version: RHSA-2005-514
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-10-05 13:18:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Fix EFBIG for 32-bit GETBLKSIZE ioctl compatibility (1.22 KB, patch)
2005-05-26 22:50 UTC, Stephen Tweedie
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2005:514 0 qe-ready SHIPPED_LIVE Important: Updated kernel packages available for Red Hat Enterprise Linux 4 Update 2 2005-10-05 04:00:00 UTC

Description Stephen Tweedie 2005-05-26 22:43:59 UTC
Description of problem:

The 32-bit compatibility GETBLKSIZE ioctl on 64-bit kernels truncates the 64-bit
long return value to 32-bits.  Unfortunately, this wraps back to zero at the 2TB
point, returning an incorrect device size.  On a 32-bit kernel, the ioctl
returns an EFBIG error on such an overflow, allowing the application to fall
back on an alternative method of determining the device size (such as the
GETBLKSIZE64 ioctl.)

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

kernel-2.6.9-6.37.EL

How reproducible:
100%

Steps to Reproduce:
1. Run the "verify-data" tool with "verify-data -Q /dev/$dev" on a device larger
than 2TB
(see http://people.redhat.com/sct/src/verify-data/ )

Actual results:
GETBLKSIZE returns incorrect size

Expected results:
GETBLKSIZE returns EFBIG

Comment 1 Stephen Tweedie 2005-05-26 22:45:14 UTC
This has only been seen in internal testing of >2TB devices.  It will be
encountered any time a 32-bit application attempts to determine device size on a
64-bit kernel for devices >2TB.

Comment 2 Stephen Tweedie 2005-05-26 22:50:11 UTC
Created attachment 114897 [details]
Fix EFBIG for 32-bit GETBLKSIZE ioctl compatibility

Comment 12 Red Hat Bugzilla 2005-10-05 13:18:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-514.html



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