projects
/
profile
/
ivi
/
syslinux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
21af78f
)
diskio: check early for an impossible LBA value for CHS requests
author
H. Peter Anvin
<hpa@linux.intel.com>
Fri, 16 Jul 2010 23:25:53 +0000
(16:25 -0700)
committer
H. Peter Anvin
<hpa@linux.intel.com>
Fri, 16 Jul 2010 23:25:53 +0000
(16:25 -0700)
Make sure we don't end up trying to do a CHS request for a truly
absurd value, that could possibly be misconverted.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
core/fs/diskio.c
patch
|
blob
|
history
diff --git
a/core/fs/diskio.c
b/core/fs/diskio.c
index
822314c
..
cf9bf49
100644
(file)
--- a/
core/fs/diskio.c
+++ b/
core/fs/diskio.c
@@
-25,6
+25,9
@@
static int chs_rdwr_sectors(struct disk *disk, void *buf,
int retry;
uint32_t maxtransfer = disk->maxtransfer;
+ if (lba + disk->part_start >= 1024*256*63)
+ return 0; /* Impossible CHS request */
+
memset(&ireg, 0, sizeof ireg);
ireg.eax.b[1] = 0x02 + is_write;