Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
OBS:Server:2.6
grub
handle-incomplete-last-track
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File handle-incomplete-last-track of Package grub
From: Alexander Graf <agraf@suse.de> Subject: [PATCH] Fix grub access to incomplete tracks Date: Wed, 14 Dec 2011 18:23:00 +0100 When we have a disk in our system that has an LBA count that exceeds the track boundary limits, grub still tries to read all of the track into its buffer. This fails for obvious reasons, but can be easily circumvented: Just cap the amount of sectors we want to read to a sensible amount. That way we don't read beyond the end of the disk and the buffer is filled with sensible data up to the point where the higher layers should care about the data. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Balazs Kutil <bkutil@suse.cz> Acked-by: Torsten Duwe <duwe@suse.de> diff --git a/stage2/bios.c b/stage2/bios.c index 2d85e40..e3ad774 100644 --- a/stage2/bios.c +++ b/stage2/bios.c @@ -66,5 +66,11 @@ biosdisk (int read, int drive, struct geometry *geometry, #endif /* NO_BUGGY_BIOS_IN_THE_WORLD */ + /* For incomplete last tracks, just read as much as we can */ + if ((sector < geometry->total_sectors) && + (sector + nsec) > geometry->total_sectors) { + nsec = geometry->total_sectors - sector; + } + /* FIXME: sizeof (DAP) must be 0x10. Should assert that the compiler can't add any padding. */ dap.length = sizeof (dap);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor