lkml.org 
[lkml]   [2017]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] scsi: sr: fix oob access in get_capabilities
From
Date


On 2017/3/18 7:29, Martin K. Petersen wrote:
> Kefeng Wang <wangkefeng.wang@huawei.com> writes:
>
> Kefeng,
>
>> root@localhost ~]# sg_modes -p 0x2a /dev/sr0
>> QEMU QEMU DVD-ROM 0.15 peripheral_type: cd/dvd [0x5]
>> Mode parameter header from MODE SENSE(10):
>> Invalid block descriptor length=512, ignore
>> Mode data length=36, medium type=0x70, specific param=0x00, longlba=0
>> Block descriptor length=0
>>>> MM capabilities and mechanical status (obsolete), page_control: current
>> 00 2a 12 00 00 71 60 29 00 02 c2 00 02 02 00 02 c2
>> 10 00 00 00 00
>> Unexpectedly received extra mode page responses, ignore
>
> That looks pretty broken.
>
> Could you try the following patch?

The issue still exists, the patch return zero in scsi_mode_sense(), but zero means
SAM_STAT_GOOD in scsi_status_is_good(), so n will be still bigger than 512;

Thanks,


\
 
 \ /
  Last update: 2017-03-20 07:02    [W:0.170 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site