aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorPhillip Susi <psusi@cfl.rr.com>2006-02-05 02:27:44 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-05 14:06:52 -0500
commita460ad62260def15c42130de253d6cfc32528a2f (patch)
tree6fd5b90db456ae6a333a224b8c1c975474bb3c27 /drivers/block
parentbd576c9523fbf23e94fb7dbe05d2ae1cf96864e4 (diff)
[PATCH] pktcdvd: Fix overflow for discs with large packets
The pktcdvd driver was using an 8 bit field to store the packet length obtained from the disc track info. This causes it to overflow packet length values of 128KB or more. I changed the field to 32 bits to fix this. The pktcdvd driver defaulted to its maximum allowed packet length when it detected a 0 in the track info field. I changed this to fail the operation and refuse to access the media. This seems more sane than attempting to access it with a value that almost certainly will not work. Signed-off-by: Peter Osterlund <petero2@telia.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/pktcdvd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 93affeeef7bd..d95e7e1ac355 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1639,7 +1639,7 @@ static int pkt_probe_settings(struct pktcdvd_device *pd)
1639 pd->settings.size = be32_to_cpu(ti.fixed_packet_size) << 2; 1639 pd->settings.size = be32_to_cpu(ti.fixed_packet_size) << 2;
1640 if (pd->settings.size == 0) { 1640 if (pd->settings.size == 0) {
1641 printk("pktcdvd: detected zero packet size!\n"); 1641 printk("pktcdvd: detected zero packet size!\n");
1642 pd->settings.size = 128; 1642 return -ENXIO;
1643 } 1643 }
1644 if (pd->settings.size > PACKET_MAX_SECTORS) { 1644 if (pd->settings.size > PACKET_MAX_SECTORS) {
1645 printk("pktcdvd: packet size is too big\n"); 1645 printk("pktcdvd: packet size is too big\n");