GNU 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
Submitter: | Peter Nelson <peterdn> | ||
Submitted: | Sun 19 Oct 2014 11:59:48 PM UTC | ||
Category: | Filesystem | Severity: | Major |
Priority: | 5 - Normal | Item Group: | Software Error |
Status: | Fixed | Privacy: | Public |
Assigned to: | None | Originator Name: | |
Open/Closed: | Closed | Release: | Git master |
Release: | Reproducibility: | Every Time | |
Planned Release: | None |
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
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 3 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2014-12-07 | phcoder | Status | None | Fixed | |
Open/Closed | Open | Closed | |||
2014-10-19 | peterdn | Attached File | - | Added ext2_absent_block.patch, #32302 |
Powered by Savane 3.13-d3ae.
Corresponding source code
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.