bugGNU GRUB - Bugs: bug #43443, GRUB fails to handle 'absent'...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #43443: GRUB fails to handle 'absent' (zero) indirect block inode table entries on ext2 volumes

Submitted by:  Peter Nelson <peterdn>
Submitted on:  Sun 19 Oct 2014 11:59:48 PM UTC  
 
Category: FilesystemSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: ClosedRelease: 
Release: Git masterReproducibility: Every Time
Planned Release: None

Sun 19 Oct 2014 11:59:48 PM UTC, original submission:

Linux (or at least Ubuntu 14.04) appears to set an indirect block ID (in an ext2 file's inode table) to 0 to indicate that all child blocks are zero-filled if there's a large gap in that file. If GRUB is asked to read such a file via a {multiboot|module|cat|testload|...} command, it fails with "error: attempt to read or write outside of disk `hd0'". This is because GRUB attempts to follow the the `0' entry and ends up reading garbage in the block it thinks is the sub-table.


Steps to reproduce:

1) Create and/or otherwise mount a disposable ext2 formatted disk(-image):

2) Install GRUB on the disk

3) Create a file with a large zero-filled gap (just enough to ensure every block under the entire first-indirect entry is zero-filled):

4) Verify that the only blocks associated with this inode are the root doubly-indirect block, its child single-indirect block and grandchild direct block:

5) Boot from test.img in bochs or otherwise; at GRUB command prompt try to load the file:


I've attached a patch that simply checks whether a block ID is 0 before attempting to follow the indirection chain. It appears to fix this issue in my case.

Peter Nelson <peterdn>

 

Attached Files
file #32302:  ext2_absent_block.patch added by peterdn (521B - application/octet-stream - Patch for issue)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by phcoder (Updated the item)
  • -unavailable- added by peterdn (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 07 Dec 2014 04:58:11 PM UTCphcoderStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Sun 19 Oct 2014 11:59:48 PM UTCpeterdnAttached File-=>Added ext2_absent_block.patch, #32302

    Back to the top


    Powered by Savane 3.1-cleanup1