Bugs(?) in the cdrom code

DAVID BALAZIC (david.balazic@uni-mb.si)
Mon, 27 Sep 1999 09:53:08 +0100 (MET)


linux 2.2.12

Possible bug in ide-cd.c ( ver. 4.53 ).
The capacity as reported by cdrom_read_capacity() is one block too short for
audio CDs on my system. ( Teac CD-532E-B as hdc on PIIX4 , Abit BH-6 board )

This means ( at least ) that the last block can not be read with ioctl CDROMREADAUDIO.
But it can be read as read lba = last-1 , nrblocks = 2 !
I believe in this case the kernel passes the command to the drive and it
performs the operation without problems.
The checks in ide_cdrom_dev_ioctl() for case CDROMREADAUDIO are weird.
It checks for nframes > capacity ????
It also check for lba >= capacity ( it should be lba > capacity on my system
to work OK with audio CDs )
But it does not check for lba + nframes > capacity !?

The problem is not present in 2.3.18 , there is note in
drivers/cdrom/cdrom.c , about needing an upper bound check on lba , but
currently it is not checked :-)

The read_toc code in ide-cd.c seems the same as in 2.2.12 though ...

-- 
David Balazic , student
E-mail   : 1stein@writeme.com     |     living in  sLOVEnija
home page: http://surf.to/stein
Computer: Amiga 1200 + Quantum LPS-340AT
--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/