forked from tianocore/edk2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NetworkPkg: Ip6Dxe: SECURITY PATCH CVE-2023-45232 Unit Tests
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4537 REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4538 Unit tests to confirm that.. Infinite loop when parsing unknown options in the Destination Options header and Infinite loop when parsing a PadN option in the Destination Options header ... have been patched This patch tests the following functions: Ip6IsOptionValid Cc: Saloni Kasbekar <[email protected]> Cc: Zachary Clark-williams <[email protected]> Signed-off-by: Doug Flick [MSFT] <[email protected]>
- Loading branch information
Showing
3 changed files
with
324 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** @file | ||
Exposes the functions needed to test the Ip6Option module. | ||
Copyright (c) Microsoft Corporation | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#ifndef IP6_OPTION_HEADER_GOOGLE_TEST_H_ | ||
#define IP6_OPTION_HEADER_GOOGLE_TEST_H_ | ||
|
||
#include <Uefi.h> | ||
#include "../Ip6Impl.h" | ||
|
||
/** | ||
Validate the IP6 option format for both the packets we received | ||
and that we will transmit. It will compute the ICMPv6 error message fields | ||
if the option is malformatted. | ||
@param[in] IpSb The IP6 service data. | ||
@param[in] Packet The to be validated packet. | ||
@param[in] Option The first byte of the option. | ||
@param[in] OptionLen The length of the whole option. | ||
@param[in] Pointer Identifies the octet offset within | ||
the invoking packet where the error was detected. | ||
@retval TRUE The option is properly formatted. | ||
@retval FALSE The option is malformatted. | ||
**/ | ||
BOOLEAN | ||
Ip6IsOptionValid ( | ||
IN IP6_SERVICE *IpSb, | ||
IN NET_BUF *Packet, | ||
IN UINT8 *Option, | ||
IN UINT16 OptionLen, | ||
IN UINT32 Pointer | ||
); | ||
|
||
#endif // __IP6_OPTION_HEADER_GOOGLE_TEST_H__ |