Bug 177031 - device-mapper mirror log: avoid overrun while syncing
Summary: device-mapper mirror log: avoid overrun while syncing
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Alasdair Kergon
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks: 168430
TreeView+ depends on / blocked
 
Reported: 2006-01-05 15:58 UTC by Alasdair Kergon
Modified: 2007-11-30 22:07 UTC (History)
4 users (show)

Fixed In Version: RHSA-2006-0132
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-07 21:08:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
dm-log-fix-resync-device-limit.patch (419 bytes, patch)
2006-01-05 15:58 UTC, Alasdair Kergon
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2006:0132 0 qe-ready SHIPPED_LIVE Moderate: Updated kernel packages available for Red Hat Enterprise Linux 4 Update 3 2006-03-09 16:31:00 UTC

Description Alasdair Kergon 2006-01-05 15:58:08 UTC
The initial sync performed when creating a mirror can overrun the end of the
mapped sections of the underlying devices, corrupting data that doesn't
belong to device-mapper.

        do {
                *region = find_next_zero_bit((unsigned long *) lc->sync_bits,
                                             lc->region_count,
                                             lc->sync_search);
                lc->sync_search = *region + 1;
 
                if (*region == lc->region_count)
                        return 0;
 
        } while (log_test_bit(lc->recovering_bits, *region));

        log_set_bit(lc, lc->recovering_bits, *region);
                                                                                
If every bit up to lc->sync_bits is 1 (easily reproduced by setting
the 'nosync' option which is not supposed to do any syncing) *region gets set
to a value that exceeds lc->region_count and you see 'attempt to access beyond
end of device' errors.

Comment 1 Alasdair Kergon 2006-01-05 15:58:08 UTC
Created attachment 122833 [details]
dm-log-fix-resync-device-limit.patch

Comment 9 Red Hat Bugzilla 2006-03-07 21:08:46 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-2006-0132.html



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