Bug 1821560

Summary: viostor driver doesn't return correct serial number length.
Product: Red Hat Enterprise Linux 8 Reporter: Vadim Rozenfeld <vrozenfe>
Component: virtio-winAssignee: Vadim Rozenfeld <vrozenfe>
virtio-win sub component: virtio-win-prewhql QA Contact: menli <menli>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: ailan, jinzhao, juzhang, kanderso, lijin
Version: 8.3   
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-21 15:32:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vadim Rozenfeld 2020-04-07 04:56:59 UTC
Description of problem:
viostor driver doesn't correct serial number length.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. run Windows 10 VM with -device virtio-blk-pci,...,serial=xru01

2. download and install sg_utils for Windowsfrom http://sg.danny.cz/sg/p/sg3_utils-1.37exe.zip

3.run C:\sg3_utils>sg_vpd.exe -v --hex --page=0x80 d:

Actual results:

Unit serial number VPD page:
    inquiry cdb: 12 01 80 00 fc 00
    inquiry: pass-through requested 252 bytes but got 24 bytes
 00     00 80 00 14 78 72 75 30  31 00 00 00 00 00 00 00    ....xru01.......
 10     00 00 00 00 00 00 00 00                             ........



Expected results:
Unit serial number VPD page:
    inquiry cdb: 12 01 80 00 fc 00
    inquiry: pass-through requested 252 bytes but got 9 bytes
 00     00 80 00 05 78 72 75 30  31                         ....xru01


Additional info:

Comment 1 menli@redhat.com 2020-04-07 06:55:47 UTC
Hi Vadim,
we use command "wmic diskdrive get SerialNumber" to check serial number in our regular testing. I wonder whether this bug can lead some bad effect and do we need to add it to our regular testing?


Thanks
Menghuan

Comment 2 Vadim Rozenfeld 2020-04-07 08:23:54 UTC
(In reply to menli from comment #1)
> Hi Vadim,
> we use command "wmic diskdrive get SerialNumber" to check serial number in
> our regular testing. I wonder whether this bug can lead some bad effect and
> do we need to add it to our regular testing?
> 
> 
> Thanks
> Menghuan

Hi Menghuan,

"wmic diskdrive get SerialNumber" is completely fine for the most of the cases.
The problem is that viostor returns serial number (VPD page 0x80) as ASCII string
that is null-terminated , and most application will rely on that. But in addition 
to that miniport driver also reports the serial name string length, that can be 
just incorrect. So, if we want to see that viostor reports the correct serial name
string "wmic diskdrive get SerialNumber" can do it. However, if we want to see that all
parameters retuned by inquiring VPD page 0v80 are fine, then "sg_vpd.exe -v --hex --page=0x80" 
is the tool to check it.

Best,
Vadim.

Comment 3 menli@redhat.com 2020-04-07 08:46:21 UTC
(In reply to Vadim Rozenfeld from comment #2)
> (In reply to menli from comment #1)
> > Hi Vadim,
> > we use command "wmic diskdrive get SerialNumber" to check serial number in
> > our regular testing. I wonder whether this bug can lead some bad effect and
> > do we need to add it to our regular testing?
> > 
> > 
> > Thanks
> > Menghuan
> 
> Hi Menghuan,
> 
> "wmic diskdrive get SerialNumber" is completely fine for the most of the
> cases.
> The problem is that viostor returns serial number (VPD page 0x80) as ASCII
> string
> that is null-terminated , and most application will rely on that. But in
> addition 
> to that miniport driver also reports the serial name string length, that can
> be 
> just incorrect. So, if we want to see that viostor reports the correct
> serial name
> string "wmic diskdrive get SerialNumber" can do it. However, if we want to
> see that all
> parameters retuned by inquiring VPD page 0v80 are fine, then "sg_vpd.exe -v
> --hex --page=0x80" 
> is the tool to check it.
> 
> Best,
> Vadim.


Hi Vadim,

Got it,much thanks~

Thanks
Menghuan

Comment 4 menli@redhat.com 2020-04-26 07:43:55 UTC
verified the issue fixed  in build virtio-win-prewhql-0.1-181.iso.

Hi Vadim,
please  modify the bug status to on_qa first,so I can change it verified  status later,thanks.

Thanks

Menghuan

Comment 8 errata-xmlrpc 2020-07-21 15:32:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:3055