* [PATCH] MdeModulePkg/Variable: Attribute combination should return EFI_UNSUPPORTED
@ 2023-02-09 22:30 Stuart Yoder
2023-02-10 2:37 ` [edk2-devel] " Michael D Kinney
2023-02-13 10:42 ` Sunny Wang
0 siblings, 2 replies; 5+ messages in thread
From: Stuart Yoder @ 2023-02-09 22:30 UTC (permalink / raw)
To: devel; +Cc: gaoliming, hao.a.wu, Sunny.Wang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4341
Commit 21320ef66989 broke some tests in the AuthVar_Conf test
in edk2-test. There are 2 testcases that invoke SetVariable
with the following attribute value:
(EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and the UEFI spec
says this should return EFI_UNSUPPORTED.
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Sunny Wang <Sunny.Wang@arm.com>
Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
---
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 6c1a3440ac..14c176887a 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -2676,7 +2676,11 @@ VariableServiceSetVariable (
//
// Only EFI_VARIABLE_NON_VOLATILE attribute is invalid
//
- return EFI_INVALID_PARAMETER;
+ if ((Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) != 0) {
+ return EFI_UNSUPPORTED;
+ } else {
+ return EFI_INVALID_PARAMETER;
+ }
} else if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
if (!mVariableModuleGlobal->VariableGlobal.AuthSupport) {
//
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [edk2-devel] [PATCH] MdeModulePkg/Variable: Attribute combination should return EFI_UNSUPPORTED
2023-02-09 22:30 [PATCH] MdeModulePkg/Variable: Attribute combination should return EFI_UNSUPPORTED Stuart Yoder
@ 2023-02-10 2:37 ` Michael D Kinney
2023-02-10 5:15 ` 回复: " gaoliming
2023-02-13 10:42 ` Sunny Wang
1 sibling, 1 reply; 5+ messages in thread
From: Michael D Kinney @ 2023-02-10 2:37 UTC (permalink / raw)
To: devel@edk2.groups.io, stuart.yoder@arm.com, Gao, Liming
Cc: Gao, Liming, Wu, Hao A, Sunny.Wang@arm.com, Kinney, Michael D
Liming,
This appears to be a regression from a commit on Jan 11, 2023.
I think this should be considered for edk2-stable202302
Mike
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Stuart Yoder
> Sent: Thursday, February 9, 2023 2:31 PM
> To: devel@edk2.groups.io
> Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Wu, Hao A <hao.a.wu@intel.com>; Sunny.Wang@arm.com
> Subject: [edk2-devel] [PATCH] MdeModulePkg/Variable: Attribute combination should return EFI_UNSUPPORTED
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4341
>
> Commit 21320ef66989 broke some tests in the AuthVar_Conf test
> in edk2-test. There are 2 testcases that invoke SetVariable
> with the following attribute value:
>
> (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
>
> EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and the UEFI spec
> says this should return EFI_UNSUPPORTED.
>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Sunny Wang <Sunny.Wang@arm.com>
>
> Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
> ---
> MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> index 6c1a3440ac..14c176887a 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> @@ -2676,7 +2676,11 @@ VariableServiceSetVariable (
> //
>
> // Only EFI_VARIABLE_NON_VOLATILE attribute is invalid
>
> //
>
> - return EFI_INVALID_PARAMETER;
>
> + if ((Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) != 0) {
>
> + return EFI_UNSUPPORTED;
>
> + } else {
>
> + return EFI_INVALID_PARAMETER;
>
> + }
>
> } else if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
>
> if (!mVariableModuleGlobal->VariableGlobal.AuthSupport) {
>
> //
>
> --
> 2.34.1
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#99932): https://edk2.groups.io/g/devel/message/99932
> Mute This Topic: https://groups.io/mt/96864645/1643496
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [michael.d.kinney@intel.com]
> -=-=-=-=-=-=
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* 回复: [edk2-devel] [PATCH] MdeModulePkg/Variable: Attribute combination should return EFI_UNSUPPORTED
2023-02-10 2:37 ` [edk2-devel] " Michael D Kinney
@ 2023-02-10 5:15 ` gaoliming
0 siblings, 0 replies; 5+ messages in thread
From: gaoliming @ 2023-02-10 5:15 UTC (permalink / raw)
To: 'Kinney, Michael D', devel, stuart.yoder
Cc: 'Wu, Hao A', Sunny.Wang
Mike:
I agree. This fix is very clear. It should be merged into this stable tag 202302.
Stuart:
This change is good to me. Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Thanks
Liming
> -----邮件原件-----
> 发件人: Kinney, Michael D <michael.d.kinney@intel.com>
> 发送时间: 2023年2月10日 10:37
> 收件人: devel@edk2.groups.io; stuart.yoder@arm.com; Gao, Liming
> <gaoliming@byosoft.com.cn>
> 抄送: Gao, Liming <gaoliming@byosoft.com.cn>; Wu, Hao A
> <hao.a.wu@intel.com>; Sunny.Wang@arm.com; Kinney, Michael D
> <michael.d.kinney@intel.com>
> 主题: RE: [edk2-devel] [PATCH] MdeModulePkg/Variable: Attribute
> combination should return EFI_UNSUPPORTED
>
> Liming,
>
> This appears to be a regression from a commit on Jan 11, 2023.
>
> I think this should be considered for edk2-stable202302
>
> Mike
>
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Stuart
> Yoder
> > Sent: Thursday, February 9, 2023 2:31 PM
> > To: devel@edk2.groups.io
> > Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Wu, Hao A
> <hao.a.wu@intel.com>; Sunny.Wang@arm.com
> > Subject: [edk2-devel] [PATCH] MdeModulePkg/Variable: Attribute
> combination should return EFI_UNSUPPORTED
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4341
> >
> > Commit 21320ef66989 broke some tests in the AuthVar_Conf test
> > in edk2-test. There are 2 testcases that invoke SetVariable
> > with the following attribute value:
> >
> > (EFI_VARIABLE_NON_VOLATILE |
> EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
> >
> > EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and the
> UEFI spec
> > says this should return EFI_UNSUPPORTED.
> >
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Hao A Wu <hao.a.wu@intel.com>
> > Cc: Sunny Wang <Sunny.Wang@arm.com>
> >
> > Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
> > ---
> > MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> > index 6c1a3440ac..14c176887a 100644
> > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> > @@ -2676,7 +2676,11 @@ VariableServiceSetVariable (
> > //
> >
> > // Only EFI_VARIABLE_NON_VOLATILE attribute is invalid
> >
> > //
> >
> > - return EFI_INVALID_PARAMETER;
> >
> > + if ((Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) !=
> 0) {
> >
> > + return EFI_UNSUPPORTED;
> >
> > + } else {
> >
> > + return EFI_INVALID_PARAMETER;
> >
> > + }
> >
> > } else if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
> >
> > if (!mVariableModuleGlobal->VariableGlobal.AuthSupport) {
> >
> > //
> >
> > --
> > 2.34.1
> >
> >
> >
> > -=-=-=-=-=-=
> > Groups.io Links: You receive all messages sent to this group.
> > View/Reply Online (#99932):
> https://edk2.groups.io/g/devel/message/99932
> > Mute This Topic: https://groups.io/mt/96864645/1643496
> > Group Owner: devel+owner@edk2.groups.io
> > Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [michael.d.kinney@intel.com]
> > -=-=-=-=-=-=
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] MdeModulePkg/Variable: Attribute combination should return EFI_UNSUPPORTED
2023-02-09 22:30 [PATCH] MdeModulePkg/Variable: Attribute combination should return EFI_UNSUPPORTED Stuart Yoder
2023-02-10 2:37 ` [edk2-devel] " Michael D Kinney
@ 2023-02-13 10:42 ` Sunny Wang
2023-02-15 3:42 ` 回复: [edk2-devel] " gaoliming
1 sibling, 1 reply; 5+ messages in thread
From: Sunny Wang @ 2023-02-13 10:42 UTC (permalink / raw)
To: Stuart Yoder, devel@edk2.groups.io
Cc: gaoliming@byosoft.com.cn, hao.a.wu@intel.com, Sunny Wang
Looks good to me. Thanks, Stuart.
Reviewed-by: Sunny Wang <sunny.wang@arm.com>
-----Original Message-----
From: Stuart Yoder <stuart.yoder@arm.com>
Sent: 09 February 2023 22:31
To: devel@edk2.groups.io
Cc: gaoliming@byosoft.com.cn; hao.a.wu@intel.com; Sunny Wang <Sunny.Wang@arm.com>
Subject: [PATCH] MdeModulePkg/Variable: Attribute combination should return EFI_UNSUPPORTED
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4341
Commit 21320ef66989 broke some tests in the AuthVar_Conf test
in edk2-test. There are 2 testcases that invoke SetVariable
with the following attribute value:
(EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and the UEFI spec
says this should return EFI_UNSUPPORTED.
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Sunny Wang <Sunny.Wang@arm.com>
Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
---
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 6c1a3440ac..14c176887a 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -2676,7 +2676,11 @@ VariableServiceSetVariable (
//
// Only EFI_VARIABLE_NON_VOLATILE attribute is invalid
//
- return EFI_INVALID_PARAMETER;
+ if ((Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) != 0) {
+ return EFI_UNSUPPORTED;
+ } else {
+ return EFI_INVALID_PARAMETER;
+ }
} else if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
if (!mVariableModuleGlobal->VariableGlobal.AuthSupport) {
//
--
2.34.1
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
^ permalink raw reply related [flat|nested] 5+ messages in thread
* 回复: [edk2-devel] [PATCH] MdeModulePkg/Variable: Attribute combination should return EFI_UNSUPPORTED
2023-02-13 10:42 ` Sunny Wang
@ 2023-02-15 3:42 ` gaoliming
0 siblings, 0 replies; 5+ messages in thread
From: gaoliming @ 2023-02-15 3:42 UTC (permalink / raw)
To: devel, Sunny.Wang, 'Stuart Yoder'; +Cc: hao.a.wu
Create PR https://github.com/tianocore/edk2/pull/4045 to merge it.
Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Sunny Wang
> 发送时间: 2023年2月13日 18:43
> 收件人: Stuart Yoder <Stuart.Yoder@arm.com>; devel@edk2.groups.io
> 抄送: gaoliming@byosoft.com.cn; hao.a.wu@intel.com; Sunny Wang
> <Sunny.Wang@arm.com>
> 主题: Re: [edk2-devel] [PATCH] MdeModulePkg/Variable: Attribute
> combination should return EFI_UNSUPPORTED
>
> Looks good to me. Thanks, Stuart.
> Reviewed-by: Sunny Wang <sunny.wang@arm.com>
>
> -----Original Message-----
> From: Stuart Yoder <stuart.yoder@arm.com>
> Sent: 09 February 2023 22:31
> To: devel@edk2.groups.io
> Cc: gaoliming@byosoft.com.cn; hao.a.wu@intel.com; Sunny Wang
> <Sunny.Wang@arm.com>
> Subject: [PATCH] MdeModulePkg/Variable: Attribute combination should
> return EFI_UNSUPPORTED
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4341
>
> Commit 21320ef66989 broke some tests in the AuthVar_Conf test
> in edk2-test. There are 2 testcases that invoke SetVariable
> with the following attribute value:
>
> (EFI_VARIABLE_NON_VOLATILE |
> EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
>
> EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and the UEFI
> spec
> says this should return EFI_UNSUPPORTED.
>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Sunny Wang <Sunny.Wang@arm.com>
>
> Signed-off-by: Stuart Yoder <stuart.yoder@arm.com>
> ---
> MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> index 6c1a3440ac..14c176887a 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> @@ -2676,7 +2676,11 @@ VariableServiceSetVariable (
> //
>
> // Only EFI_VARIABLE_NON_VOLATILE attribute is invalid
>
> //
>
> - return EFI_INVALID_PARAMETER;
>
> + if ((Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) != 0)
> {
>
> + return EFI_UNSUPPORTED;
>
> + } else {
>
> + return EFI_INVALID_PARAMETER;
>
> + }
>
> } else if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
>
> if (!mVariableModuleGlobal->VariableGlobal.AuthSupport) {
>
> //
>
> --
> 2.34.1
>
> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
recipient,
> please notify the sender immediately and do not disclose the contents to
any
> other person, use it for any purpose, or store or copy the information in
any
> medium. Thank you.
>
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-02-15 3:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-09 22:30 [PATCH] MdeModulePkg/Variable: Attribute combination should return EFI_UNSUPPORTED Stuart Yoder
2023-02-10 2:37 ` [edk2-devel] " Michael D Kinney
2023-02-10 5:15 ` 回复: " gaoliming
2023-02-13 10:42 ` Sunny Wang
2023-02-15 3:42 ` 回复: [edk2-devel] " gaoliming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox