REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054

V8 Add DEBUG_VERBOSE message and unit test
V7 addressed review comments (only documentation changes).

Current implementation of SafeString does not let one parse untrusted
data with its interfaces as they ASSERT on failing runtime checks and
require one to effectively reimplement the function on the caller side.

All the former proposals made it clear that the attempts to introduce
a solution preserving this behavior require a lot of changes
throughout the codebase including platform code (e.g. introducing
constraint assertions and updating all DebugLib implementations)
or require all sorts of hacks.

Since the original code has roughly no benefit except in some very
special cases and the effort required to preserve it is very high,
I propose to remove it as agreed on with several other parties.

Please note, that this patch does not change the behaviour of the
functions in RELEASE builds. I.e. they will still check for NULL
and return RETURN_INVALID_PARAMETER. In the future we may (or may
not) want them to simply ASSERT in this case. Regardless this should
be done in a separate BZ entry and a separate commit. For this reason
I ask everyone not to touch this subject.

Due to the amount of discussion this has already undergone after
almost a year I kindly request everyone to reduce the communication
to the minimum and abstain from proposing another approach.

Requesting to merge this into edk2-stable202005.

Cc: Andrew Fish [email protected]
Cc: Ard Biesheuvel [email protected]
Cc: Bret Barkelew [email protected]
Cc: Brian J. Johnson [email protected]
Cc: Chasel Chiu [email protected]
Cc: Jordan Justen [email protected]
Cc: Laszlo Ersek [email protected]
Cc: Leif Lindholm [email protected]
Cc: Liming Gao [email protected]
Cc: Marvin Häuser [email protected]
Cc: Michael D Kinney [email protected]
Cc: Vincent Zimmer [email protected]
Cc: Zhichao Gao [email protected]
Cc: Jiewen Yao [email protected]
Signed-off-by: Vitaly Cheptsov [email protected]

Michael D Kinney (2):
  MdePkg: Fix SafeString performing assertions on runtime checks
  MdePkg/Test/BaseLib: Add SAFE_STRING_CONSTRAINT_CHECK unit test

 MdePkg/Include/Library/BaseLib.h              | 111 -----------------
 MdePkg/Library/BaseLib/SafeString.c           | 115 +-----------------
 .../UnitTest/Library/BaseLib/Base64UnitTest.c |  85 +++++++++++++
 3 files changed, 88 insertions(+), 223 deletions(-)

-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#59911): https://edk2.groups.io/g/devel/message/59911
Mute This Topic: https://groups.io/mt/74341928/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to