Ignore:
Timestamp:
Apr 21, 2017, 4:28:29 AM (5 weeks ago)
Author:
brainslayer
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.4/drivers/scsi/sr.c

    r29166 r31885  
    835835        struct scsi_mode_data data;
    836836        struct scsi_sense_hdr sshdr;
     837        unsigned int ms_len = 128;
    837838        int rc, n;
    838839
     
    861862
    862863        /* ask for mode page 0x2a */
    863         rc = scsi_mode_sense(cd->device, 0, 0x2a, buffer, 128,
     864        rc = scsi_mode_sense(cd->device, 0, 0x2a, buffer, ms_len,
    864865                             SR_TIMEOUT, 3, &data, NULL);
    865866
    866         if (!scsi_status_is_good(rc)) {
     867        if (!scsi_status_is_good(rc) || data.length > ms_len ||
     868            data.header_length + data.block_descriptor_length > data.length) {
    867869                /* failed, drive doesn't have capabilities mode page */
    868870                cd->cdi.speed = 1;
Note: See TracChangeset for help on using the changeset viewer.