6afabf0092
1. During CD probing, we read the TOC header to find the number of entries, then read the TOC itself. The header determines the number of entries, which determines the amount of data to read from the device into the softc in the CD_STATE_MEDIA_TOC_FULL state. We hard-code a limit of 99 tracks (plus one for the lead-out) in the softc, but were not validating that the size reported by the media would fit in this hard-coded limit. Kernel memory corruption could occur if not.[1] Add validation to check this, and refuse to cache the TOC if it would not fit. 2. The CDIOCPLAYTRACKS ioctl uses caller provided track numbers to index into the TOC, but we only validate the starting index. Add validation of the ending index. Also, raise the hard-coded limit from 100 tracks to 170, per a suggestion from Ken. Reported by: C Turt <ecturt@gmail.com> [1] Reviewed by: ken, avg MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32803 |
||
---|---|---|
.. | ||
scsi_all.c | ||
scsi_all.h | ||
scsi_cd.c | ||
scsi_cd.h | ||
scsi_ch.c | ||
scsi_ch.h | ||
scsi_da.c | ||
scsi_da.h | ||
scsi_enc_internal.h | ||
scsi_enc_safte.c | ||
scsi_enc_ses.c | ||
scsi_enc.c | ||
scsi_enc.h | ||
scsi_iu.h | ||
scsi_message.h | ||
scsi_pass.c | ||
scsi_pass.h | ||
scsi_pt.c | ||
scsi_pt.h | ||
scsi_sa.c | ||
scsi_sa.h | ||
scsi_ses.h | ||
scsi_sg.c | ||
scsi_sg.h | ||
scsi_targ_bh.c | ||
scsi_target.c | ||
scsi_targetio.h | ||
scsi_xpt.c | ||
smp_all.c | ||
smp_all.h |