Bug 237326 - md: read past end of bitmap file causes md device initialization to fail
md: read past end of bitmap file causes md device initialization to fail
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.0
All Linux
medium Severity high
: ---
: ---
Assigned To: Ivan Vecera
Martin Jenner
:
Depends On:
Blocks: 425461
  Show dependency treegraph
 
Reported: 2007-04-20 16:06 EDT by Paul Clements
Modified: 2008-05-21 10:42 EDT (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2008-0314
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-21 10:42:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
kernel patch (3.25 KB, patch)
2007-04-20 16:06 EDT, Paul Clements
no flags Details | Diff

  None (edit)
Description Paul Clements 2007-04-20 16:06:10 EDT
Description of problem:

(from Neil Brown, md maintainer)

In most cases we check the size of the bitmap file before
reading data from it.  However when reading the superblock,
we always read the first PAGE_SIZE bytes, which might not 
always be appropriate.  So limit that read to the size of the
file if appropriate.

Also, we get the count of available bytes wrong in one place,
so that too can read past the end of the file.

Patch, which is in mainline and has been tested against the RHEL 5 kernel, attached.

Version-Release number of selected component (if applicable):
kernel: 2.6.18-8.1.1.el5
RHEL: redhat-release-5Server-5.0.0.7

How reproducible:
Always

Steps to Reproduce:
1. create md array with a bitmap file where bitmap file is on a filesystem with
block size smaller than page size -- md will try to read past the end of the
file, which causes the md array to fail

or

2. create md array with a bitmap file such that the size of the bitmap file is
close to the page size (within 256 bytes) -- this also causes md to read past
the end of the file, causing the md array to fail
Comment 1 Paul Clements 2007-04-20 16:06:10 EDT
Created attachment 153209 [details]
kernel patch
Comment 2 RHEL Product and Program Management 2007-08-31 08:13:40 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 4 Don Zickus 2008-01-21 12:27:01 EST
in 2.6.18-71.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5
Comment 7 errata-xmlrpc 2008-05-21 10:42:33 EDT
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/RHBA-2008-0314.html

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