public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage
@ 2017-02-14 21:54 Jeff Westfahl
  2017-02-14 22:40 ` Jim.Dailey
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Westfahl @ 2017-02-14 21:54 UTC (permalink / raw)
  To: edk2-devel

The format specifier for the LoadOptions field of the LoadedImage protocol
is "%s". However, the data in LoadOptions is often generic binary data. A
format specifier of "%x" is more appropriate for this field.

Using "dh -v" with format specifier "%s" on BIOS images based on EDK II
source before commit 891d844 can cause a crash.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
---
 ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index 0d51627c5f..273a4201bc 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -354,7 +354,7 @@
                                                   "     DeviceHandle..: %%H%x%%N\r\n"
                                                   "     FilePath......: %%H%x%%N\r\n"
                                                   "     OptionsSize...: %%H%x%%N\r\n"
-                                                  "     LoadOptions...: %%H%s%%N\r\n"
+                                                  "     LoadOptions...: %%H%x%%N\r\n"
                                                   "     ImageBase.....: %%H%x%%N\r\n"
                                                   "     ImageSize.....: %%H%Lx%%N\r\n"
                                                   "     CodeType......: %%H%s%%N\r\n"
-- 
2.11.0.windows.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage
  2017-02-14 21:54 [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage Jeff Westfahl
@ 2017-02-14 22:40 ` Jim.Dailey
  2017-02-14 22:44   ` Jim.Dailey
  0 siblings, 1 reply; 10+ messages in thread
From: Jim.Dailey @ 2017-02-14 22:40 UTC (permalink / raw)
  To: jeff.westfahl, edk2-devel

Dell - Internal Use - Confidential  

Jeff,

Perhaps a better approach is to print *all* the LoadOptions data as hex bytes?

In addition, one might first analyze the LoadOptions data, and, when apropos,
print obvious strings as strings?

Regards,
Jim

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jeff Westfahl
Sent: Tuesday, February 14, 2017 3:54 PM
To: edk2-devel@lists.01.org
Subject: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage

The format specifier for the LoadOptions field of the LoadedImage protocol
is "%s". However, the data in LoadOptions is often generic binary data. A
format specifier of "%x" is more appropriate for this field.

Using "dh -v" with format specifier "%s" on BIOS images based on EDK II
source before commit 891d844 can cause a crash.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
---
 ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index 0d51627c5f..273a4201bc 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -354,7 +354,7 @@
                                                   "     DeviceHandle..: %%H%x%%N\r\n"
                                                   "     FilePath......: %%H%x%%N\r\n"
                                                   "     OptionsSize...: %%H%x%%N\r\n"
-                                                  "     LoadOptions...: %%H%s%%N\r\n"
+                                                  "     LoadOptions...: %%H%x%%N\r\n"
                                                   "     ImageBase.....: %%H%x%%N\r\n"
                                                   "     ImageSize.....: %%H%Lx%%N\r\n"
                                                   "     CodeType......: %%H%s%%N\r\n"
-- 
2.11.0.windows.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage
  2017-02-14 22:40 ` Jim.Dailey
@ 2017-02-14 22:44   ` Jim.Dailey
  2017-02-15 20:41     ` Jeff Westfahl
  0 siblings, 1 reply; 10+ messages in thread
From: Jim.Dailey @ 2017-02-14 22:44 UTC (permalink / raw)
  To: jeff.westfahl, edk2-devel

Please disregard the earlier "Confidential" text. The stupid plug-in that adds this
does not show the text in the mail when it is composed in text mode, so I often
forget to turn this "feature" off when posting.  Sorry.

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Dailey, Jim
Sent: Tuesday, February 14, 2017 4:40 PM
To: jeff.westfahl@ni.com; edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage

Jeff,

Perhaps a better approach is to print *all* the LoadOptions data as hex bytes?

In addition, one might first analyze the LoadOptions data, and, when apropos,
print obvious strings as strings?

Regards,
Jim

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jeff Westfahl
Sent: Tuesday, February 14, 2017 3:54 PM
To: edk2-devel@lists.01.org
Subject: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage

The format specifier for the LoadOptions field of the LoadedImage protocol
is "%s". However, the data in LoadOptions is often generic binary data. A
format specifier of "%x" is more appropriate for this field.

Using "dh -v" with format specifier "%s" on BIOS images based on EDK II
source before commit 891d844 can cause a crash.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
---
 ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index 0d51627c5f..273a4201bc 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -354,7 +354,7 @@
                                                   "     DeviceHandle..: %%H%x%%N\r\n"
                                                   "     FilePath......: %%H%x%%N\r\n"
                                                   "     OptionsSize...: %%H%x%%N\r\n"
-                                                  "     LoadOptions...: %%H%s%%N\r\n"
+                                                  "     LoadOptions...: %%H%x%%N\r\n"
                                                   "     ImageBase.....: %%H%x%%N\r\n"
                                                   "     ImageSize.....: %%H%Lx%%N\r\n"
                                                   "     CodeType......: %%H%s%%N\r\n"
-- 
2.11.0.windows.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage
  2017-02-14 22:44   ` Jim.Dailey
@ 2017-02-15 20:41     ` Jeff Westfahl
  2017-02-17 16:54       ` Jeff Westfahl
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Westfahl @ 2017-02-15 20:41 UTC (permalink / raw)
  To: edk2-devel

Jim,

I agree that those are good ideas. However, such an implementation would 
still crash on a BIOS built against the EDK II before commit 891d844. I 
think it might be best to resolve the crash with the simple patch I have 
made, and defer your suggestions for now.

Regards,
Jeff

On Tue, 14 Feb 2017, Jim.Dailey@dell.com wrote:

> Please disregard the earlier "Confidential" text. The stupid plug-in that adds this
> does not show the text in the mail when it is composed in text mode, so I often
> forget to turn this "feature" off when posting.  Sorry.
>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Dailey, Jim
> Sent: Tuesday, February 14, 2017 4:40 PM
> To: jeff.westfahl@ni.com; edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage
>
> Jeff,
>
> Perhaps a better approach is to print *all* the LoadOptions data as hex bytes?
>
> In addition, one might first analyze the LoadOptions data, and, when apropos,
> print obvious strings as strings?
>
> Regards,
> Jim
>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jeff Westfahl
> Sent: Tuesday, February 14, 2017 3:54 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage
>
> The format specifier for the LoadOptions field of the LoadedImage protocol
> is "%s". However, the data in LoadOptions is often generic binary data. A
> format specifier of "%x" is more appropriate for this field.
>
> Using "dh -v" with format specifier "%s" on BIOS images based on EDK II
> source before commit 891d844 can cause a crash.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
> ---
> ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> index 0d51627c5f..273a4201bc 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> @@ -354,7 +354,7 @@
>                                                   "     DeviceHandle..: %%H%x%%N\r\n"
>                                                   "     FilePath......: %%H%x%%N\r\n"
>                                                   "     OptionsSize...: %%H%x%%N\r\n"
> -                                                  "     LoadOptions...: %%H%s%%N\r\n"
> +                                                  "     LoadOptions...: %%H%x%%N\r\n"
>                                                   "     ImageBase.....: %%H%x%%N\r\n"
>                                                   "     ImageSize.....: %%H%Lx%%N\r\n"
>                                                   "     CodeType......: %%H%s%%N\r\n"
> -- 
> 2.11.0.windows.3
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage
  2017-02-15 20:41     ` Jeff Westfahl
@ 2017-02-17 16:54       ` Jeff Westfahl
  2017-02-17 17:27         ` Carsey, Jaben
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Westfahl @ 2017-02-17 16:54 UTC (permalink / raw)
  To: Jeff Westfahl; +Cc: edk2-devel, jaben.carsey, ruiyu.ni

Jaben, Ruiyu,

Sorry, I forgot to cc you as the ShellPkg maintainers when I submitted 
this patch.

Regards,
Jeff Westfahl

On Wed, 15 Feb 2017, Jeff Westfahl wrote:

> Jim,
>
> I agree that those are good ideas. However, such an implementation would 
> still crash on a BIOS built against the EDK II before commit 891d844. I think 
> it might be best to resolve the crash with the simple patch I have made, and 
> defer your suggestions for now.
>
> Regards,
> Jeff
>
> On Tue, 14 Feb 2017, Jim.Dailey@dell.com wrote:
>
>> Please disregard the earlier "Confidential" text. The stupid plug-in that 
>> adds this
>> does not show the text in the mail when it is composed in text mode, so I 
>> often
>> forget to turn this "feature" off when posting.  Sorry.
>> 
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of 
>> Dailey, Jim
>> Sent: Tuesday, February 14, 2017 4:40 PM
>> To: jeff.westfahl@ni.com; edk2-devel@lists.01.org
>> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format 
>> specifier for LoadedImage
>> 
>> Jeff,
>> 
>> Perhaps a better approach is to print *all* the LoadOptions data as hex 
>> bytes?
>> 
>> In addition, one might first analyze the LoadOptions data, and, when 
>> apropos,
>> print obvious strings as strings?
>> 
>> Regards,
>> Jim
>> 
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jeff 
>> Westfahl
>> Sent: Tuesday, February 14, 2017 3:54 PM
>> To: edk2-devel@lists.01.org
>> Subject: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format specifier 
>> for LoadedImage
>> 
>> The format specifier for the LoadOptions field of the LoadedImage protocol
>> is "%s". However, the data in LoadOptions is often generic binary data. A
>> format specifier of "%x" is more appropriate for this field.
>> 
>> Using "dh -v" with format specifier "%s" on BIOS images based on EDK II
>> source before commit 891d844 can cause a crash.
>> 
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
>> ---
>> ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni 
>> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
>> index 0d51627c5f..273a4201bc 100644
>> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
>> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
>> @@ -354,7 +354,7 @@
>>                                                   "     DeviceHandle..: 
>> %%H%x%%N\r\n"
>>                                                   "     FilePath......: 
>> %%H%x%%N\r\n"
>>                                                   "     OptionsSize...: 
>> %%H%x%%N\r\n"
>> -                                                  "     LoadOptions...: 
>> %%H%s%%N\r\n"
>> +                                                  "     LoadOptions...: 
>> %%H%x%%N\r\n"
>>                                                   "     ImageBase.....: 
>> %%H%x%%N\r\n"
>>                                                   "     ImageSize.....: 
>> %%H%Lx%%N\r\n"
>>                                                   "     CodeType......: 
>> %%H%s%%N\r\n"
>> -- 
>> 2.11.0.windows.3
>> 
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
>> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage
  2017-02-17 16:54       ` Jeff Westfahl
@ 2017-02-17 17:27         ` Carsey, Jaben
  2017-02-17 17:35           ` Jim.Dailey
  0 siblings, 1 reply; 10+ messages in thread
From: Carsey, Jaben @ 2017-02-17 17:27 UTC (permalink / raw)
  To: Jeff Westfahl; +Cc: edk2-devel@lists.01.org, Ni, Ruiyu, Carsey, Jaben

I was reading the email.  I was also waiting and making sure there was consensus since I didn't have a strong opinion.  I will let Ray check also, but I think the fix is good.

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

> -----Original Message-----
> From: Jeff Westfahl [mailto:jeff.westfahl@ni.com]
> Sent: Friday, February 17, 2017 8:55 AM
> To: Jeff Westfahl <jeff.westfahl@ni.com>
> Cc: edk2-devel@lists.01.org; Carsey, Jaben <jaben.carsey@intel.com>; Ni,
> Ruiyu <ruiyu.ni@intel.com>
> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
> specifier for LoadedImage
> Importance: High
> 
> Jaben, Ruiyu,
> 
> Sorry, I forgot to cc you as the ShellPkg maintainers when I submitted
> this patch.
> 
> Regards,
> Jeff Westfahl
> 
> On Wed, 15 Feb 2017, Jeff Westfahl wrote:
> 
> > Jim,
> >
> > I agree that those are good ideas. However, such an implementation would
> > still crash on a BIOS built against the EDK II before commit 891d844. I think
> > it might be best to resolve the crash with the simple patch I have made,
> and
> > defer your suggestions for now.
> >
> > Regards,
> > Jeff
> >
> > On Tue, 14 Feb 2017, Jim.Dailey@dell.com wrote:
> >
> >> Please disregard the earlier "Confidential" text. The stupid plug-in that
> >> adds this
> >> does not show the text in the mail when it is composed in text mode, so I
> >> often
> >> forget to turn this "feature" off when posting.  Sorry.
> >>
> >> -----Original Message-----
> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> >> Dailey, Jim
> >> Sent: Tuesday, February 14, 2017 4:40 PM
> >> To: jeff.westfahl@ni.com; edk2-devel@lists.01.org
> >> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
> >> specifier for LoadedImage
> >>
> >> Jeff,
> >>
> >> Perhaps a better approach is to print *all* the LoadOptions data as hex
> >> bytes?
> >>
> >> In addition, one might first analyze the LoadOptions data, and, when
> >> apropos,
> >> print obvious strings as strings?
> >>
> >> Regards,
> >> Jim
> >>
> >> -----Original Message-----
> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Jeff
> >> Westfahl
> >> Sent: Tuesday, February 14, 2017 3:54 PM
> >> To: edk2-devel@lists.01.org
> >> Subject: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
> specifier
> >> for LoadedImage
> >>
> >> The format specifier for the LoadOptions field of the LoadedImage
> protocol
> >> is "%s". However, the data in LoadOptions is often generic binary data. A
> >> format specifier of "%x" is more appropriate for this field.
> >>
> >> Using "dh -v" with format specifier "%s" on BIOS images based on EDK II
> >> source before commit 891d844 can cause a crash.
> >>
> >> Contributed-under: TianoCore Contribution Agreement 1.0
> >> Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
> >> ---
> >> ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git
> a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> >> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> >> index 0d51627c5f..273a4201bc 100644
> >> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> >> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> >> @@ -354,7 +354,7 @@
> >>                                                   "     DeviceHandle..:
> >> %%H%x%%N\r\n"
> >>                                                   "     FilePath......:
> >> %%H%x%%N\r\n"
> >>                                                   "     OptionsSize...:
> >> %%H%x%%N\r\n"
> >> -                                                  "     LoadOptions...:
> >> %%H%s%%N\r\n"
> >> +                                                  "     LoadOptions...:
> >> %%H%x%%N\r\n"
> >>                                                   "     ImageBase.....:
> >> %%H%x%%N\r\n"
> >>                                                   "     ImageSize.....:
> >> %%H%Lx%%N\r\n"
> >>                                                   "     CodeType......:
> >> %%H%s%%N\r\n"
> >> --
> >> 2.11.0.windows.3
> >>
> >> _______________________________________________
> >> edk2-devel mailing list
> >> edk2-devel@lists.01.org
> >> https://lists.01.org/mailman/listinfo/edk2-devel
> >> _______________________________________________
> >> edk2-devel mailing list
> >> edk2-devel@lists.01.org
> >> https://lists.01.org/mailman/listinfo/edk2-devel
> >>
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> >


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage
  2017-02-17 17:27         ` Carsey, Jaben
@ 2017-02-17 17:35           ` Jim.Dailey
  2017-02-17 17:37             ` Carsey, Jaben
  0 siblings, 1 reply; 10+ messages in thread
From: Jim.Dailey @ 2017-02-17 17:35 UTC (permalink / raw)
  To: jaben.carsey; +Cc: ruiyu.ni, edk2-devel, jeff.westfahl

My point was that printing one byte of the data as hex is not much better (as far
as avoiding the crash is concerned) than simply not printing the data at all.  If
we are just trying to avoid the crash, printing nothing is even simpler.

If the correct representation is hex bytes, fine; but why print only 1 of them
and not all of them?


-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Carsey, Jaben
Sent: Friday, February 17, 2017 11:28 AM
To: Jeff Westfahl <jeff.westfahl@ni.com>
Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Carsey, Jaben <jaben.carsey@intel.com>; edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage

I was reading the email.  I was also waiting and making sure there was consensus since I didn't have a strong opinion.  I will let Ray check also, but I think the fix is good.

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

> -----Original Message-----
> From: Jeff Westfahl [mailto:jeff.westfahl@ni.com]
> Sent: Friday, February 17, 2017 8:55 AM
> To: Jeff Westfahl <jeff.westfahl@ni.com>
> Cc: edk2-devel@lists.01.org; Carsey, Jaben <jaben.carsey@intel.com>; Ni,
> Ruiyu <ruiyu.ni@intel.com>
> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
> specifier for LoadedImage
> Importance: High
> 
> Jaben, Ruiyu,
> 
> Sorry, I forgot to cc you as the ShellPkg maintainers when I submitted
> this patch.
> 
> Regards,
> Jeff Westfahl
> 
> On Wed, 15 Feb 2017, Jeff Westfahl wrote:
> 
> > Jim,
> >
> > I agree that those are good ideas. However, such an implementation would
> > still crash on a BIOS built against the EDK II before commit 891d844. I think
> > it might be best to resolve the crash with the simple patch I have made,
> and
> > defer your suggestions for now.
> >
> > Regards,
> > Jeff
> >
> > On Tue, 14 Feb 2017, Jim.Dailey@dell.com wrote:
> >
> >> Please disregard the earlier "Confidential" text. The stupid plug-in that
> >> adds this
> >> does not show the text in the mail when it is composed in text mode, so I
> >> often
> >> forget to turn this "feature" off when posting.  Sorry.
> >>
> >> -----Original Message-----
> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> >> Dailey, Jim
> >> Sent: Tuesday, February 14, 2017 4:40 PM
> >> To: jeff.westfahl@ni.com; edk2-devel@lists.01.org
> >> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
> >> specifier for LoadedImage
> >>
> >> Jeff,
> >>
> >> Perhaps a better approach is to print *all* the LoadOptions data as hex
> >> bytes?
> >>
> >> In addition, one might first analyze the LoadOptions data, and, when
> >> apropos,
> >> print obvious strings as strings?
> >>
> >> Regards,
> >> Jim
> >>
> >> -----Original Message-----
> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Jeff
> >> Westfahl
> >> Sent: Tuesday, February 14, 2017 3:54 PM
> >> To: edk2-devel@lists.01.org
> >> Subject: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
> specifier
> >> for LoadedImage
> >>
> >> The format specifier for the LoadOptions field of the LoadedImage
> protocol
> >> is "%s". However, the data in LoadOptions is often generic binary data. A
> >> format specifier of "%x" is more appropriate for this field.
> >>
> >> Using "dh -v" with format specifier "%s" on BIOS images based on EDK II
> >> source before commit 891d844 can cause a crash.
> >>
> >> Contributed-under: TianoCore Contribution Agreement 1.0
> >> Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
> >> ---
> >> ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git
> a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> >> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> >> index 0d51627c5f..273a4201bc 100644
> >> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> >> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> >> @@ -354,7 +354,7 @@
> >>                                                   "     DeviceHandle..:
> >> %%H%x%%N\r\n"
> >>                                                   "     FilePath......:
> >> %%H%x%%N\r\n"
> >>                                                   "     OptionsSize...:
> >> %%H%x%%N\r\n"
> >> -                                                  "     LoadOptions...:
> >> %%H%s%%N\r\n"
> >> +                                                  "     LoadOptions...:
> >> %%H%x%%N\r\n"
> >>                                                   "     ImageBase.....:
> >> %%H%x%%N\r\n"
> >>                                                   "     ImageSize.....:
> >> %%H%Lx%%N\r\n"
> >>                                                   "     CodeType......:
> >> %%H%s%%N\r\n"
> >> --
> >> 2.11.0.windows.3
> >>
> >> _______________________________________________
> >> edk2-devel mailing list
> >> edk2-devel@lists.01.org
> >> https://lists.01.org/mailman/listinfo/edk2-devel
> >> _______________________________________________
> >> edk2-devel mailing list
> >> edk2-devel@lists.01.org
> >> https://lists.01.org/mailman/listinfo/edk2-devel
> >>
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> >
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage
  2017-02-17 17:35           ` Jim.Dailey
@ 2017-02-17 17:37             ` Carsey, Jaben
  2017-02-17 17:43               ` Jeff Westfahl
  0 siblings, 1 reply; 10+ messages in thread
From: Carsey, Jaben @ 2017-02-17 17:37 UTC (permalink / raw)
  To: Jim.Dailey@dell.com
  Cc: Ni, Ruiyu, edk2-devel@lists.01.org, jeff.westfahl@ni.com,
	Carsey, Jaben

I think that the long term solution may improve upon this one, but if the data is hex, then printing in hex at all would seem to be the logical first step.

> -----Original Message-----
> From: Jim.Dailey@dell.com [mailto:Jim.Dailey@dell.com]
> Sent: Friday, February 17, 2017 9:36 AM
> To: Carsey, Jaben <jaben.carsey@intel.com>
> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org;
> jeff.westfahl@ni.com
> Subject: RE: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
> specifier for LoadedImage
> Importance: High
> 
> My point was that printing one byte of the data as hex is not much better (as
> far
> as avoiding the crash is concerned) than simply not printing the data at all.  If
> we are just trying to avoid the crash, printing nothing is even simpler.
> 
> If the correct representation is hex bytes, fine; but why print only 1 of them
> and not all of them?
> 
> 
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Carsey, Jaben
> Sent: Friday, February 17, 2017 11:28 AM
> To: Jeff Westfahl <jeff.westfahl@ni.com>
> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Carsey, Jaben
> <jaben.carsey@intel.com>; edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
> specifier for LoadedImage
> 
> I was reading the email.  I was also waiting and making sure there was
> consensus since I didn't have a strong opinion.  I will let Ray check also, but I
> think the fix is good.
> 
> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
> 
> > -----Original Message-----
> > From: Jeff Westfahl [mailto:jeff.westfahl@ni.com]
> > Sent: Friday, February 17, 2017 8:55 AM
> > To: Jeff Westfahl <jeff.westfahl@ni.com>
> > Cc: edk2-devel@lists.01.org; Carsey, Jaben <jaben.carsey@intel.com>; Ni,
> > Ruiyu <ruiyu.ni@intel.com>
> > Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
> > specifier for LoadedImage
> > Importance: High
> >
> > Jaben, Ruiyu,
> >
> > Sorry, I forgot to cc you as the ShellPkg maintainers when I submitted
> > this patch.
> >
> > Regards,
> > Jeff Westfahl
> >
> > On Wed, 15 Feb 2017, Jeff Westfahl wrote:
> >
> > > Jim,
> > >
> > > I agree that those are good ideas. However, such an implementation
> would
> > > still crash on a BIOS built against the EDK II before commit 891d844. I think
> > > it might be best to resolve the crash with the simple patch I have made,
> > and
> > > defer your suggestions for now.
> > >
> > > Regards,
> > > Jeff
> > >
> > > On Tue, 14 Feb 2017, Jim.Dailey@dell.com wrote:
> > >
> > >> Please disregard the earlier "Confidential" text. The stupid plug-in that
> > >> adds this
> > >> does not show the text in the mail when it is composed in text mode, so
> I
> > >> often
> > >> forget to turn this "feature" off when posting.  Sorry.
> > >>
> > >> -----Original Message-----
> > >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
> Of
> > >> Dailey, Jim
> > >> Sent: Tuesday, February 14, 2017 4:40 PM
> > >> To: jeff.westfahl@ni.com; edk2-devel@lists.01.org
> > >> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
> > >> specifier for LoadedImage
> > >>
> > >> Jeff,
> > >>
> > >> Perhaps a better approach is to print *all* the LoadOptions data as hex
> > >> bytes?
> > >>
> > >> In addition, one might first analyze the LoadOptions data, and, when
> > >> apropos,
> > >> print obvious strings as strings?
> > >>
> > >> Regards,
> > >> Jim
> > >>
> > >> -----Original Message-----
> > >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
> Of
> > Jeff
> > >> Westfahl
> > >> Sent: Tuesday, February 14, 2017 3:54 PM
> > >> To: edk2-devel@lists.01.org
> > >> Subject: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
> > specifier
> > >> for LoadedImage
> > >>
> > >> The format specifier for the LoadOptions field of the LoadedImage
> > protocol
> > >> is "%s". However, the data in LoadOptions is often generic binary data. A
> > >> format specifier of "%x" is more appropriate for this field.
> > >>
> > >> Using "dh -v" with format specifier "%s" on BIOS images based on EDK II
> > >> source before commit 891d844 can cause a crash.
> > >>
> > >> Contributed-under: TianoCore Contribution Agreement 1.0
> > >> Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
> > >> ---
> > >> ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 2 +-
> > >> 1 file changed, 1 insertion(+), 1 deletion(-)
> > >>
> > >> diff --git
> > a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> > >> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> > >> index 0d51627c5f..273a4201bc 100644
> > >> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> > >> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> > >> @@ -354,7 +354,7 @@
> > >>                                                   "     DeviceHandle..:
> > >> %%H%x%%N\r\n"
> > >>                                                   "     FilePath......:
> > >> %%H%x%%N\r\n"
> > >>                                                   "     OptionsSize...:
> > >> %%H%x%%N\r\n"
> > >> -                                                  "     LoadOptions...:
> > >> %%H%s%%N\r\n"
> > >> +                                                  "     LoadOptions...:
> > >> %%H%x%%N\r\n"
> > >>                                                   "     ImageBase.....:
> > >> %%H%x%%N\r\n"
> > >>                                                   "     ImageSize.....:
> > >> %%H%Lx%%N\r\n"
> > >>                                                   "     CodeType......:
> > >> %%H%s%%N\r\n"
> > >> --
> > >> 2.11.0.windows.3
> > >>
> > >> _______________________________________________
> > >> edk2-devel mailing list
> > >> edk2-devel@lists.01.org
> > >> https://lists.01.org/mailman/listinfo/edk2-devel
> > >> _______________________________________________
> > >> edk2-devel mailing list
> > >> edk2-devel@lists.01.org
> > >> https://lists.01.org/mailman/listinfo/edk2-devel
> > >>
> > > _______________________________________________
> > > edk2-devel mailing list
> > > edk2-devel@lists.01.org
> > > https://lists.01.org/mailman/listinfo/edk2-devel
> > >
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage
  2017-02-17 17:37             ` Carsey, Jaben
@ 2017-02-17 17:43               ` Jeff Westfahl
  2017-02-17 18:12                 ` Jim.Dailey
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Westfahl @ 2017-02-17 17:43 UTC (permalink / raw)
  To: Carsey, Jaben
  Cc: Jim.Dailey@dell.com, Ni, Ruiyu, edk2-devel@lists.01.org,
	jeff.westfahl@ni.com

Using "%s" tries to print the data as text, but crashes if the pointer 
to that data is garbage. Using "%x" just prints the value of the pointer, 
whether it's valid or not. It doesn't print any of the actual data.

On Fri, 17 Feb 2017, Carsey, Jaben wrote:

> I think that the long term solution may improve upon this one, but if the data is hex, then printing in hex at all would seem to be the logical first step.
>
>> -----Original Message-----
>> From: Jim.Dailey@dell.com [mailto:Jim.Dailey@dell.com]
>> Sent: Friday, February 17, 2017 9:36 AM
>> To: Carsey, Jaben <jaben.carsey@intel.com>
>> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org;
>> jeff.westfahl@ni.com
>> Subject: RE: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
>> specifier for LoadedImage
>> Importance: High
>>
>> My point was that printing one byte of the data as hex is not much better (as
>> far
>> as avoiding the crash is concerned) than simply not printing the data at all.  If
>> we are just trying to avoid the crash, printing nothing is even simpler.
>>
>> If the correct representation is hex bytes, fine; but why print only 1 of them
>> and not all of them?
>>
>>
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>> Carsey, Jaben
>> Sent: Friday, February 17, 2017 11:28 AM
>> To: Jeff Westfahl <jeff.westfahl@ni.com>
>> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Carsey, Jaben
>> <jaben.carsey@intel.com>; edk2-devel@lists.01.org
>> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
>> specifier for LoadedImage
>>
>> I was reading the email.  I was also waiting and making sure there was
>> consensus since I didn't have a strong opinion.  I will let Ray check also, but I
>> think the fix is good.
>>
>> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
>>
>>> -----Original Message-----
>>> From: Jeff Westfahl [mailto:jeff.westfahl@ni.com]
>>> Sent: Friday, February 17, 2017 8:55 AM
>>> To: Jeff Westfahl <jeff.westfahl@ni.com>
>>> Cc: edk2-devel@lists.01.org; Carsey, Jaben <jaben.carsey@intel.com>; Ni,
>>> Ruiyu <ruiyu.ni@intel.com>
>>> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
>>> specifier for LoadedImage
>>> Importance: High
>>>
>>> Jaben, Ruiyu,
>>>
>>> Sorry, I forgot to cc you as the ShellPkg maintainers when I submitted
>>> this patch.
>>>
>>> Regards,
>>> Jeff Westfahl
>>>
>>> On Wed, 15 Feb 2017, Jeff Westfahl wrote:
>>>
>>>> Jim,
>>>>
>>>> I agree that those are good ideas. However, such an implementation
>> would
>>>> still crash on a BIOS built against the EDK II before commit 891d844. I think
>>>> it might be best to resolve the crash with the simple patch I have made,
>>> and
>>>> defer your suggestions for now.
>>>>
>>>> Regards,
>>>> Jeff
>>>>
>>>> On Tue, 14 Feb 2017, Jim.Dailey@dell.com wrote:
>>>>
>>>>> Please disregard the earlier "Confidential" text. The stupid plug-in that
>>>>> adds this
>>>>> does not show the text in the mail when it is composed in text mode, so
>> I
>>>>> often
>>>>> forget to turn this "feature" off when posting.  Sorry.
>>>>>
>>>>> -----Original Message-----
>>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
>> Of
>>>>> Dailey, Jim
>>>>> Sent: Tuesday, February 14, 2017 4:40 PM
>>>>> To: jeff.westfahl@ni.com; edk2-devel@lists.01.org
>>>>> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
>>>>> specifier for LoadedImage
>>>>>
>>>>> Jeff,
>>>>>
>>>>> Perhaps a better approach is to print *all* the LoadOptions data as hex
>>>>> bytes?
>>>>>
>>>>> In addition, one might first analyze the LoadOptions data, and, when
>>>>> apropos,
>>>>> print obvious strings as strings?
>>>>>
>>>>> Regards,
>>>>> Jim
>>>>>
>>>>> -----Original Message-----
>>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
>> Of
>>> Jeff
>>>>> Westfahl
>>>>> Sent: Tuesday, February 14, 2017 3:54 PM
>>>>> To: edk2-devel@lists.01.org
>>>>> Subject: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
>>> specifier
>>>>> for LoadedImage
>>>>>
>>>>> The format specifier for the LoadOptions field of the LoadedImage
>>> protocol
>>>>> is "%s". However, the data in LoadOptions is often generic binary data. A
>>>>> format specifier of "%x" is more appropriate for this field.
>>>>>
>>>>> Using "dh -v" with format specifier "%s" on BIOS images based on EDK II
>>>>> source before commit 891d844 can cause a crash.
>>>>>
>>>>> Contributed-under: TianoCore Contribution Agreement 1.0
>>>>> Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
>>>>> ---
>>>>> ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 2 +-
>>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git
>>> a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
>>>>> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
>>>>> index 0d51627c5f..273a4201bc 100644
>>>>> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
>>>>> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
>>>>> @@ -354,7 +354,7 @@
>>>>>                                                   "     DeviceHandle..:
>>>>> %%H%x%%N\r\n"
>>>>>                                                   "     FilePath......:
>>>>> %%H%x%%N\r\n"
>>>>>                                                   "     OptionsSize...:
>>>>> %%H%x%%N\r\n"
>>>>> -                                                  "     LoadOptions...:
>>>>> %%H%s%%N\r\n"
>>>>> +                                                  "     LoadOptions...:
>>>>> %%H%x%%N\r\n"
>>>>>                                                   "     ImageBase.....:
>>>>> %%H%x%%N\r\n"
>>>>>                                                   "     ImageSize.....:
>>>>> %%H%Lx%%N\r\n"
>>>>>                                                   "     CodeType......:
>>>>> %%H%s%%N\r\n"
>>>>> --
>>>>> 2.11.0.windows.3
>>>>>
>>>>> _______________________________________________
>>>>> edk2-devel mailing list
>>>>> edk2-devel@lists.01.org
>>>>> https://lists.01.org/mailman/listinfo/edk2-devel
>>>>> _______________________________________________
>>>>> edk2-devel mailing list
>>>>> edk2-devel@lists.01.org
>>>>> https://lists.01.org/mailman/listinfo/edk2-devel
>>>>>
>>>> _______________________________________________
>>>> edk2-devel mailing list
>>>> edk2-devel@lists.01.org
>>>> https://lists.01.org/mailman/listinfo/edk2-devel
>>>>
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage
  2017-02-17 17:43               ` Jeff Westfahl
@ 2017-02-17 18:12                 ` Jim.Dailey
  0 siblings, 0 replies; 10+ messages in thread
From: Jim.Dailey @ 2017-02-17 18:12 UTC (permalink / raw)
  To: jeff.westfahl; +Cc: ruiyu.ni, edk2-devel, jaben.carsey

Dell - Internal Use - Confidential  

Thanks, Jeff.  I wasn't thinking that through properly.

Printing the address and size seems ok.  Then one could use dmem, for
example, to dump the actual data.


-----Original Message-----
From: Jeff Westfahl [mailto:jeff.westfahl@ni.com] 
Sent: Friday, February 17, 2017 11:44 AM
To: Carsey, Jaben <jaben.carsey@intel.com>
Cc: Dailey, Jim <Jim_Dailey@Dell.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org; jeff.westfahl@ni.com
Subject: RE: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage

Using "%s" tries to print the data as text, but crashes if the pointer 
to that data is garbage. Using "%x" just prints the value of the pointer, 
whether it's valid or not. It doesn't print any of the actual data.

On Fri, 17 Feb 2017, Carsey, Jaben wrote:

> I think that the long term solution may improve upon this one, but if the data is hex, then printing in hex at all would seem to be the logical first step.
>
>> -----Original Message-----
>> From: Jim.Dailey@dell.com [mailto:Jim.Dailey@dell.com]
>> Sent: Friday, February 17, 2017 9:36 AM
>> To: Carsey, Jaben <jaben.carsey@intel.com>
>> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org;
>> jeff.westfahl@ni.com
>> Subject: RE: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
>> specifier for LoadedImage
>> Importance: High
>>
>> My point was that printing one byte of the data as hex is not much better (as
>> far
>> as avoiding the crash is concerned) than simply not printing the data at all.  If
>> we are just trying to avoid the crash, printing nothing is even simpler.
>>
>> If the correct representation is hex bytes, fine; but why print only 1 of them
>> and not all of them?
>>
>>
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>> Carsey, Jaben
>> Sent: Friday, February 17, 2017 11:28 AM
>> To: Jeff Westfahl <jeff.westfahl@ni.com>
>> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Carsey, Jaben
>> <jaben.carsey@intel.com>; edk2-devel@lists.01.org
>> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
>> specifier for LoadedImage
>>
>> I was reading the email.  I was also waiting and making sure there was
>> consensus since I didn't have a strong opinion.  I will let Ray check also, but I
>> think the fix is good.
>>
>> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
>>
>>> -----Original Message-----
>>> From: Jeff Westfahl [mailto:jeff.westfahl@ni.com]
>>> Sent: Friday, February 17, 2017 8:55 AM
>>> To: Jeff Westfahl <jeff.westfahl@ni.com>
>>> Cc: edk2-devel@lists.01.org; Carsey, Jaben <jaben.carsey@intel.com>; Ni,
>>> Ruiyu <ruiyu.ni@intel.com>
>>> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
>>> specifier for LoadedImage
>>> Importance: High
>>>
>>> Jaben, Ruiyu,
>>>
>>> Sorry, I forgot to cc you as the ShellPkg maintainers when I submitted
>>> this patch.
>>>
>>> Regards,
>>> Jeff Westfahl
>>>
>>> On Wed, 15 Feb 2017, Jeff Westfahl wrote:
>>>
>>>> Jim,
>>>>
>>>> I agree that those are good ideas. However, such an implementation
>> would
>>>> still crash on a BIOS built against the EDK II before commit 891d844. I think
>>>> it might be best to resolve the crash with the simple patch I have made,
>>> and
>>>> defer your suggestions for now.
>>>>
>>>> Regards,
>>>> Jeff
>>>>
>>>> On Tue, 14 Feb 2017, Jim.Dailey@dell.com wrote:
>>>>
>>>>> Please disregard the earlier "Confidential" text. The stupid plug-in that
>>>>> adds this
>>>>> does not show the text in the mail when it is composed in text mode, so
>> I
>>>>> often
>>>>> forget to turn this "feature" off when posting.  Sorry.
>>>>>
>>>>> -----Original Message-----
>>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
>> Of
>>>>> Dailey, Jim
>>>>> Sent: Tuesday, February 14, 2017 4:40 PM
>>>>> To: jeff.westfahl@ni.com; edk2-devel@lists.01.org
>>>>> Subject: Re: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
>>>>> specifier for LoadedImage
>>>>>
>>>>> Jeff,
>>>>>
>>>>> Perhaps a better approach is to print *all* the LoadOptions data as hex
>>>>> bytes?
>>>>>
>>>>> In addition, one might first analyze the LoadOptions data, and, when
>>>>> apropos,
>>>>> print obvious strings as strings?
>>>>>
>>>>> Regards,
>>>>> Jim
>>>>>
>>>>> -----Original Message-----
>>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
>> Of
>>> Jeff
>>>>> Westfahl
>>>>> Sent: Tuesday, February 14, 2017 3:54 PM
>>>>> To: edk2-devel@lists.01.org
>>>>> Subject: [edk2] [PATCH] ShellPkg/HandleParsingLib: Correct format
>>> specifier
>>>>> for LoadedImage
>>>>>
>>>>> The format specifier for the LoadOptions field of the LoadedImage
>>> protocol
>>>>> is "%s". However, the data in LoadOptions is often generic binary data. A
>>>>> format specifier of "%x" is more appropriate for this field.
>>>>>
>>>>> Using "dh -v" with format specifier "%s" on BIOS images based on EDK II
>>>>> source before commit 891d844 can cause a crash.
>>>>>
>>>>> Contributed-under: TianoCore Contribution Agreement 1.0
>>>>> Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
>>>>> ---
>>>>> ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 2 +-
>>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git
>>> a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
>>>>> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
>>>>> index 0d51627c5f..273a4201bc 100644
>>>>> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
>>>>> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
>>>>> @@ -354,7 +354,7 @@
>>>>>                                                   "     DeviceHandle..:
>>>>> %%H%x%%N\r\n"
>>>>>                                                   "     FilePath......:
>>>>> %%H%x%%N\r\n"
>>>>>                                                   "     OptionsSize...:
>>>>> %%H%x%%N\r\n"
>>>>> -                                                  "     LoadOptions...:
>>>>> %%H%s%%N\r\n"
>>>>> +                                                  "     LoadOptions...:
>>>>> %%H%x%%N\r\n"
>>>>>                                                   "     ImageBase.....:
>>>>> %%H%x%%N\r\n"
>>>>>                                                   "     ImageSize.....:
>>>>> %%H%Lx%%N\r\n"
>>>>>                                                   "     CodeType......:
>>>>> %%H%s%%N\r\n"
>>>>> --
>>>>> 2.11.0.windows.3
>>>>>
>>>>> _______________________________________________
>>>>> edk2-devel mailing list
>>>>> edk2-devel@lists.01.org
>>>>> https://lists.01.org/mailman/listinfo/edk2-devel
>>>>> _______________________________________________
>>>>> edk2-devel mailing list
>>>>> edk2-devel@lists.01.org
>>>>> https://lists.01.org/mailman/listinfo/edk2-devel
>>>>>
>>>> _______________________________________________
>>>> edk2-devel mailing list
>>>> edk2-devel@lists.01.org
>>>> https://lists.01.org/mailman/listinfo/edk2-devel
>>>>
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
>


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-02-17 18:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-14 21:54 [PATCH] ShellPkg/HandleParsingLib: Correct format specifier for LoadedImage Jeff Westfahl
2017-02-14 22:40 ` Jim.Dailey
2017-02-14 22:44   ` Jim.Dailey
2017-02-15 20:41     ` Jeff Westfahl
2017-02-17 16:54       ` Jeff Westfahl
2017-02-17 17:27         ` Carsey, Jaben
2017-02-17 17:35           ` Jim.Dailey
2017-02-17 17:37             ` Carsey, Jaben
2017-02-17 17:43               ` Jeff Westfahl
2017-02-17 18:12                 ` Jim.Dailey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox