* [PATCH] x86, efi: initial the local variable of DataSize to zero
@ 2013-05-02 14:07 Lee, Chun-Yi
[not found] ` <1367503621-13004-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Lee, Chun-Yi @ 2013-05-02 14:07 UTC (permalink / raw)
To: matt.fleming-ral2JQCrhuEAvxtiuMwx3w, mjg59-1xO5oi07KQx4cg9Nei1l7Q
Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee, Chun-Yi,
Matthew Garrett, H. Peter Anvin
That will be better initial the value of DataSize to zero for the input of
GetVariable(), otherwise we will feed a random value. The debug log of input
DataSize like this:
...
[ 195.915612] EFI Variables Facility v0.08 2004-May-17
[ 195.915819] efi: size: 18446744071581821342
[ 195.915969] efi: size': 18446744071581821342
[ 195.916324] efi: size: 18446612150714306560
[ 195.916632] efi: size': 18446612150714306560
[ 195.917159] efi: size: 18446612150714306560
[ 195.917453] efi: size': 18446612150714306560
...
The size' is value that was returned by BIOS.
After applied this patch:
[ 82.442042] EFI Variables Facility v0.08 2004-May-17
[ 82.442202] efi: size: 0
[ 82.442360] efi: size': 1039
[ 82.443828] efi: size: 0
[ 82.444127] efi: size': 2616
[ 82.447057] efi: size: 0
[ 82.447356] efi: size': 5832
...
Found on Acer Aspire V3 BIOS, it will not return the size of data if we input a
non-zero DataSize.
Cc: Matthew Garrett <mjg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Matt Fleming <matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: H. Peter Anvin <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Lee, Chun-Yi <jlee-IBi9RG/b67k@public.gmane.org>
---
arch/x86/platform/efi/efi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index e4a86a6..cb59732 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -204,7 +204,7 @@ static efi_status_t virt_efi_get_next_variable(unsigned long *name_size,
}
if (boot_used_size && !finished) {
- unsigned long size;
+ unsigned long size = 0;
u32 attr;
efi_status_t s;
void *tmp;
--
1.6.0.2
^ permalink raw reply related [flat|nested] 6+ messages in thread[parent not found: <1367503621-13004-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org>]
* Re: [PATCH] x86, efi: initial the local variable of DataSize to zero [not found] ` <1367503621-13004-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org> @ 2013-05-03 8:50 ` Matt Fleming 0 siblings, 0 replies; 6+ messages in thread From: Matt Fleming @ 2013-05-03 8:50 UTC (permalink / raw) To: Lee, Chun-Yi Cc: matt.fleming-ral2JQCrhuEAvxtiuMwx3w, mjg59-1xO5oi07KQx4cg9Nei1l7Q, linux-efi-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee, Chun-Yi, Matthew Garrett, H. Peter Anvin On Thu, 02 May, at 10:07:01PM, Lee, Chun-Yi wrote: > That will be better initial the value of DataSize to zero for the input of > GetVariable(), otherwise we will feed a random value. The debug log of input > DataSize like this: > > ... > [ 195.915612] EFI Variables Facility v0.08 2004-May-17 > [ 195.915819] efi: size: 18446744071581821342 > [ 195.915969] efi: size': 18446744071581821342 > [ 195.916324] efi: size: 18446612150714306560 > [ 195.916632] efi: size': 18446612150714306560 > [ 195.917159] efi: size: 18446612150714306560 > [ 195.917453] efi: size': 18446612150714306560 > ... > > The size' is value that was returned by BIOS. > > After applied this patch: > [ 82.442042] EFI Variables Facility v0.08 2004-May-17 > [ 82.442202] efi: size: 0 > [ 82.442360] efi: size': 1039 > [ 82.443828] efi: size: 0 > [ 82.444127] efi: size': 2616 > [ 82.447057] efi: size: 0 > [ 82.447356] efi: size': 5832 > ... > > Found on Acer Aspire V3 BIOS, it will not return the size of data if we input a > non-zero DataSize. > > Cc: Matthew Garrett <mjg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > Cc: Matt Fleming <matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > Cc: H. Peter Anvin <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org> > Signed-off-by: Lee, Chun-Yi <jlee-IBi9RG/b67k@public.gmane.org> > --- > arch/x86/platform/efi/efi.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) Applied, thanks. -- Matt Fleming, Intel Open Source Technology Center ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] x86, efi: initial the local variable of DataSize to zero
@ 2013-04-26 17:19 Lee, Chun-Yi
[not found] ` <1366996767-8234-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Lee, Chun-Yi @ 2013-04-26 17:19 UTC (permalink / raw)
To: matt.fleming-ral2JQCrhuEAvxtiuMwx3w, mjg59-1xO5oi07KQx4cg9Nei1l7Q
Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee, Chun-Yi,
Matthew Garrett, H. Peter Anvin
That will be better initial the value of DataSize to zero for the input of
GetVariable(), otherwise we will feed a random value. The debug log of input
DataSize like this:
...
[ 195.915612] EFI Variables Facility v0.08 2004-May-17
[ 195.915819] efi: size: 18446744071581821342
[ 195.915969] efi: size': 18446744071581821342
[ 195.916324] efi: size: 18446612150714306560
[ 195.916632] efi: size': 18446612150714306560
[ 195.917159] efi: size: 18446612150714306560
[ 195.917453] efi: size': 18446612150714306560
...
Found on Acer Aspire V3 BIOS, it will not return the size of data if we input a
non-zero DataSize.
Cc: Matthew Garrett <mjg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Matt Fleming <matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: H. Peter Anvin <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Lee, Chun-Yi <jlee-IBi9RG/b67k@public.gmane.org>
---
arch/x86/platform/efi/efi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index e4a86a6..cb59732 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -204,7 +204,7 @@ static efi_status_t virt_efi_get_next_variable(unsigned long *name_size,
}
if (boot_used_size && !finished) {
- unsigned long size;
+ unsigned long size = 0;
u32 attr;
efi_status_t s;
void *tmp;
--
1.6.0.2
^ permalink raw reply related [flat|nested] 6+ messages in thread[parent not found: <1366996767-8234-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org>]
* Re: [PATCH] x86, efi: initial the local variable of DataSize to zero [not found] ` <1366996767-8234-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org> @ 2013-04-29 9:55 ` Matt Fleming 2013-04-29 10:25 ` joeyli 1 sibling, 0 replies; 6+ messages in thread From: Matt Fleming @ 2013-04-29 9:55 UTC (permalink / raw) To: Lee, Chun-Yi Cc: matt.fleming-ral2JQCrhuEAvxtiuMwx3w, mjg59-1xO5oi07KQx4cg9Nei1l7Q, linux-efi-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Lee, Chun-Yi, H. Peter Anvin On 26/04/13 18:19, Lee, Chun-Yi wrote: > That will be better initial the value of DataSize to zero for the input of > GetVariable(), otherwise we will feed a random value. The debug log of input > DataSize like this: > > ... > [ 195.915612] EFI Variables Facility v0.08 2004-May-17 > [ 195.915819] efi: size: 18446744071581821342 > [ 195.915969] efi: size': 18446744071581821342 > [ 195.916324] efi: size: 18446612150714306560 > [ 195.916632] efi: size': 18446612150714306560 > [ 195.917159] efi: size: 18446612150714306560 > [ 195.917453] efi: size': 18446612150714306560 > ... > > Found on Acer Aspire V3 BIOS, it will not return the size of data if we input a > non-zero DataSize. > > Cc: Matthew Garrett <mjg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > Cc: Matt Fleming <matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > Cc: H. Peter Anvin <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org> > Signed-off-by: Lee, Chun-Yi <jlee-IBi9RG/b67k@public.gmane.org> > --- > arch/x86/platform/efi/efi.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c > index e4a86a6..cb59732 100644 > --- a/arch/x86/platform/efi/efi.c > +++ b/arch/x86/platform/efi/efi.c > @@ -204,7 +204,7 @@ static efi_status_t virt_efi_get_next_variable(unsigned long *name_size, > } > > if (boot_used_size && !finished) { > - unsigned long size; > + unsigned long size = 0; > u32 attr; > efi_status_t s; > void *tmp; > Looks good to me. Matthew? -- Matt Fleming, Intel Open Source Technology Center ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86, efi: initial the local variable of DataSize to zero [not found] ` <1366996767-8234-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org> 2013-04-29 9:55 ` Matt Fleming @ 2013-04-29 10:25 ` joeyli [not found] ` <1367231111.22858.55.camel-ONCj+Eqt86TasUa73XJKwA@public.gmane.org> 1 sibling, 1 reply; 6+ messages in thread From: joeyli @ 2013-04-29 10:25 UTC (permalink / raw) To: matt.fleming-ral2JQCrhuEAvxtiuMwx3w, mjg59-1xO5oi07KQx4cg9Nei1l7Q Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Matthew Garrett, H. Peter Anvin 於 六,2013-04-27 於 01:19 +0800,Lee, Chun-Yi 提到: > That will be better initial the value of DataSize to zero for the input of > GetVariable(), otherwise we will feed a random value. The debug log of input > DataSize like this: > > ... > [ 195.915612] EFI Variables Facility v0.08 2004-May-17 > [ 195.915819] efi: size: 18446744071581821342 > [ 195.915969] efi: size': 18446744071581821342 > [ 195.916324] efi: size: 18446612150714306560 > [ 195.916632] efi: size': 18446612150714306560 > [ 195.917159] efi: size: 18446612150714306560 > [ 195.917453] efi: size': 18446612150714306560 > ... After applied patch, the log of size like this: [ 82.442042] EFI Variables Facility v0.08 2004-May-17 [ 82.442202] efi: size: 0 [ 82.442360] efi: size': 1039 [ 82.443828] efi: size: 0 [ 82.444127] efi: size': 2616 [ 82.447057] efi: size: 0 [ 82.447356] efi: size': 5832 [ 82.452669] efi: size: 0 [ 82.453128] efi: size': 1 [ 82.454339] efi: size: 0 [ 82.454843] efi: size': 1 [ 82.456173] efi: size: 0 [ 82.456764] efi: size': 8 [ 82.458194] efi: size: 0 [ 82.458905] efi: size': 4 The size' is the return value of Acer BIOS, it return right size value then we feed zero DataSize. Thanks a lot! Joey Lee > > Found on Acer Aspire V3 BIOS, it will not return the size of data if we input a > non-zero DataSize. > > Cc: Matthew Garrett <mjg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > Cc: Matt Fleming <matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > Cc: H. Peter Anvin <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org> > Signed-off-by: Lee, Chun-Yi <jlee-IBi9RG/b67k@public.gmane.org> > --- > arch/x86/platform/efi/efi.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c > index e4a86a6..cb59732 100644 > --- a/arch/x86/platform/efi/efi.c > +++ b/arch/x86/platform/efi/efi.c > @@ -204,7 +204,7 @@ static efi_status_t virt_efi_get_next_variable(unsigned long *name_size, > } > > if (boot_used_size && !finished) { > - unsigned long size; > + unsigned long size = 0; > u32 attr; > efi_status_t s; > void *tmp; ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <1367231111.22858.55.camel-ONCj+Eqt86TasUa73XJKwA@public.gmane.org>]
* Re: [PATCH] x86, efi: initial the local variable of DataSize to zero [not found] ` <1367231111.22858.55.camel-ONCj+Eqt86TasUa73XJKwA@public.gmane.org> @ 2013-04-29 10:34 ` joeyli 0 siblings, 0 replies; 6+ messages in thread From: joeyli @ 2013-04-29 10:34 UTC (permalink / raw) To: matt.fleming-ral2JQCrhuEAvxtiuMwx3w Cc: mjg59-1xO5oi07KQx4cg9Nei1l7Q, linux-efi-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Matthew Garrett, H. Peter Anvin 於 一,2013-04-29 於 18:25 +0800,joeyli 提到: > 於 六,2013-04-27 於 01:19 +0800,Lee, Chun-Yi 提到: > > That will be better initial the value of DataSize to zero for the input of > > GetVariable(), otherwise we will feed a random value. The debug log of input > > DataSize like this: > > > > ... > > [ 195.915612] EFI Variables Facility v0.08 2004-May-17 > > [ 195.915819] efi: size: 18446744071581821342 > > [ 195.915969] efi: size': 18446744071581821342 > > [ 195.916324] efi: size: 18446612150714306560 > > [ 195.916632] efi: size': 18446612150714306560 > > [ 195.917159] efi: size: 18446612150714306560 > > [ 195.917453] efi: size': 18446612150714306560 > > ... > > After applied patch, the log of size like this: > > [ 82.442042] EFI Variables Facility v0.08 2004-May-17 > [ 82.442202] efi: size: 0 > [ 82.442360] efi: size': 1039 > [ 82.443828] efi: size: 0 > [ 82.444127] efi: size': 2616 > [ 82.447057] efi: size: 0 > [ 82.447356] efi: size': 5832 > [ 82.452669] efi: size: 0 > [ 82.453128] efi: size': 1 > [ 82.454339] efi: size: 0 > [ 82.454843] efi: size': 1 > [ 82.456173] efi: size: 0 > [ 82.456764] efi: size': 8 > [ 82.458194] efi: size: 0 > [ 82.458905] efi: size': 4 > > The size' is the return value of Acer BIOS, it return right size value > then we feed zero DataSize. ^^^^^^^^^ when Sorry for typo! Joey Lee > > > Thanks a lot! > Joey Lee > > > > > Found on Acer Aspire V3 BIOS, it will not return the size of data if we input a > > non-zero DataSize. > > > > Cc: Matthew Garrett <mjg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > > Cc: Matt Fleming <matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > > Cc: H. Peter Anvin <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org> > > Signed-off-by: Lee, Chun-Yi <jlee-IBi9RG/b67k@public.gmane.org> > > --- > > arch/x86/platform/efi/efi.c | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c > > index e4a86a6..cb59732 100644 > > --- a/arch/x86/platform/efi/efi.c > > +++ b/arch/x86/platform/efi/efi.c > > @@ -204,7 +204,7 @@ static efi_status_t virt_efi_get_next_variable(unsigned long *name_size, > > } > > > > if (boot_used_size && !finished) { > > - unsigned long size; > > + unsigned long size = 0; > > u32 attr; > > efi_status_t s; > > void *tmp; > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-efi" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-05-03 8:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-02 14:07 [PATCH] x86, efi: initial the local variable of DataSize to zero Lee, Chun-Yi
[not found] ` <1367503621-13004-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org>
2013-05-03 8:50 ` Matt Fleming
-- strict thread matches above, loose matches on Subject: below --
2013-04-26 17:19 Lee, Chun-Yi
[not found] ` <1366996767-8234-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org>
2013-04-29 9:55 ` Matt Fleming
2013-04-29 10:25 ` joeyli
[not found] ` <1367231111.22858.55.camel-ONCj+Eqt86TasUa73XJKwA@public.gmane.org>
2013-04-29 10:34 ` joeyli
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox