Bug 237326 - md: read past end of bitmap file causes md device initialization to fail
Summary: md: read past end of bitmap file causes md device initialization to fail
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.0
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: Ivan Vecera
QA Contact: Martin Jenner
URL:
Whiteboard:
Depends On:
Blocks: 425461
TreeView+ depends on / blocked
 
Reported: 2007-04-20 20:06 UTC by Paul Clements
Modified: 2008-05-21 14:42 UTC (History)
1 user (show)

Fixed In Version: RHBA-2008-0314
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-21 14:42:33 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0314 0 normal SHIPPED_LIVE Updated kernel packages for Red Hat Enterprise Linux 5.2 2008-05-20 18:43:34 UTC

Description Paul Clements 2007-04-20 20:06:10 UTC
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 20:06:10 UTC
Created attachment 153209 [details]
kernel patch

Comment 2 RHEL Program Management 2007-08-31 12:13:40 UTC
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 17:27:01 UTC
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 14:42:33 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/RHBA-2008-0314.html



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