[prev in list] [next in list] [prev in thread] [next in thread]
List: win-pv-devel
Subject: Re: [win-pv-devel] [PATCH] Dont include null terminator in synthesized VendorId identifier
From: Paul Durrant <Paul.Durrant () citrix ! com>
Date: 2016-10-03 7:28:16
Message-ID: 6d797202480e4807a8785614c40040b2 () AMSPEX02CL03 ! citrite ! net
[Download RAW message or body]
> -----Original Message-----
> From: win-pv-devel [mailto:win-pv-devel-bounces@lists.xenproject.org] On
> Behalf Of owen.smith@citrix.com
> Sent: 30 September 2016 17:30
> To: win-pv-devel@lists.xenproject.org
> Cc: Owen Smith <owen.smith@citrix.com>
> Subject: [win-pv-devel] [PATCH] Dont include null terminator in synthesized
> VendorId identifier
>
> From: Owen Smith <owen.smith@citrix.com>
>
> The VendorId identifier on SCSI page 83 is 16 bytes long (+header)
> When synthesizing the inquiry data, either by global flag, or missing
> xenstore data (sm-data/scsi/0x12/0x83), the NULL terminator on the
> VendorId should not be included in the field. When this happens, any
> query will decode 3 identifiers (VendorId, EUI64, VendorSpecific)
> instead of the intended 2 (VendorId, VendorSpecific).
> This breaks the XenServer VSS provider that uses the VendorSpecific
> identifier to retrieve the vdi-uuid. This is only an issue when the inquiry
> data is synthesized and additional identifiers are required, which is not
> a common use case.
>
> Signed-off-by: Owen Smith <owen.smith@citrix.com>
Acked-by: Paul Durrant <paul.durrant@citrix.com>
> ---
> src/xenvbd/pdoinquiry.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/src/xenvbd/pdoinquiry.c b/src/xenvbd/pdoinquiry.c
> index be7dd84..4460f3d 100644
> --- a/src/xenvbd/pdoinquiry.c
> +++ b/src/xenvbd/pdoinquiry.c
> @@ -42,7 +42,7 @@
> #define GUID_LENGTH 36
>
> // 00 00 00 00 00 00 00 00 "XENSRC 00000000"
> -#define PAGE83_MIN_SIZE (4 + 4 + 16 + 1)
> +#define PAGE83_MIN_SIZE (4 + 4 + 16)
>
> // 00 00 00 00 + GUID_LENGTH
> #define VDI_ID_LENGTH (4 + GUID_LENGTH)
> @@ -331,13 +331,14 @@ __HandlePage83(
> PCHAR Data = (PCHAR)Srb->DataBuffer;
> ULONG Length = Srb->DataTransferLength;
>
> - RtlZeroMemory(Data, Length);
> - if (DriverParameters.SynthesizeInquiry ||
> + RtlZeroMemory(Data, Length);
> + if (DriverParameters.SynthesizeInquiry ||
> Inquiry == NULL ||
> Inquiry->Page83.Data == NULL ||
> Inquiry->Page83.Length == 0) {
> // generate the id page data
> PVPD_IDENTIFICATION_DESCRIPTOR Id;
> + CHAR Buffer[17];
>
> if (Length < PAGE83_MIN_SIZE)
> return FALSE;
> @@ -349,7 +350,8 @@ __HandlePage83(
> Id->CodeSet = VpdCodeSetAscii;
> Id->IdentifierType = VpdIdentifierTypeVendorId;
> Id->IdentifierLength = 16;
> - (VOID) RtlStringCchPrintfA((PCHAR)Id->Identifier, 17, "XENSRC %08u",
> TargetId);
> + (VOID)RtlStringCchPrintfA(Buffer, 17, "XENSRC %08u", TargetId);
> + RtlCopyMemory((PCHAR)Id->Identifier, Buffer, 16);
>
> Verbose("Target[%u] : INQUIRY Using Fake Page83 Data\n", TargetId);
>
> --
> 2.8.3
>
>
> _______________________________________________
> win-pv-devel mailing list
> win-pv-devel@lists.xenproject.org
> https://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
_______________________________________________
win-pv-devel mailing list
win-pv-devel@lists.xenproject.org
https://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic