Commit Graph

2296 Commits

Author SHA1 Message Date
Jiaxin Wu d52f9163de MdeModulePkg/Ip4Dxe: Fix the potential NULL pointer free
Ip4Config2SetDnsServer may cause ASSERT if the invalid DNS
server address received. The issue is triggered by the NULL
pointer(Tmp) free.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
2017-01-04 08:40:09 +08:00
Laszlo Ersek 387ccad8f6 MdeModulePkg: S3SaveStateDxe, SmmS3SaveState: save 64-bit LoopTimes
The BootScriptWriteMemPoll() helper function in both drivers does the
following:

- pop Delay from the variable argument list as UINT64, then truncate it to
  UINTN,

- divide Delay by 10, using DivU64x32Remainder(), then store the quotient
  in LoopTimes (also UINTN),

- pass LoopTimes to S3BootScriptSaveMemPoll() as last argument.

The truncation to UINTN is superfluous and wrong in this logic (not to
mention incompatible with the PI spec); it prevents callers from
specifying Delays longer than 0xFFFF_FFFF * 100ns (approximately 429
seconds == 7 minutes 9 seconds) on Ia32. In particular it prevents callers
from specifying an infinite timeout (for example, 0xFFFF_FFFF_FFFF_FFFF *
100ns, approximately 58494 years).

Change the type of Delay and LoopTimes to UINT64. Keep the same logic,
just remove the truncations. The resultant LoopTimes values can be safely
passed to S3BootScriptSaveMemPoll() thanks to the previous patch.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
2017-01-03 12:23:38 +01:00
Star Zeng 47b612db90 MdeModulePkg TerminalDxe: Execute key notify func at TPL_CALLBACK
Current implementation executes key notify function in TimerHandler
at TPL_NOTIFY. The code change is to make key notify function
executed at TPL_CALLBACK to reduce the time occupied at TPL_NOTIFY.

The code will signal KeyNotify process event if the key pressed
matches any key registered and insert the KeyData to the EFI Key
queue for notify, then the KeyNotify process handler will invoke
key notify functions at TPL_CALLBACK.

Cc: Ruiyu Ni <Ruiyu.ni@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
2016-12-26 18:16:59 +08:00
Star Zeng cf88579c10 MdeModulePkg ConSplitterDxe: Support toggle state sync
Register key notify for toggle state (CapsLock, NumLock and ScrollLock)
sync between multiple keyboards.
The implementation for this feature requires keyboard driver supports
EFI_KEY_STATE_EXPOSED, and turns on physical TextInEx partial key
report for toggle state sync.
The virtual TextInEx will report the partial key after it is required
by calling SetState(X | KEY_STATE_VALID_EXPOSED) explicitly.

Cc: Ruiyu Ni <Ruiyu.ni@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
2016-12-26 18:16:58 +08:00
Hao Wu 81a1084340 MdeModulePkg/UefiPxeBcDxe: Refine the CvtNum function logic
This commit refines the logic for the CvtNum function. It avoids using the
decrement operator '--' for array index to prevent possible mis-reports by
static code checkers.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2016-12-22 16:17:21 +08:00
Dandan Bi 4d9ea30931 MdeModulePkg/TerminalDxe: Initialize variable after declaration
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-12-20 10:51:22 +08:00
Dandan Bi 789b86acfb MdeModulePkg/EbcDxe: Make variable name follow rules
For variable name, it should contain lower case characters.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-12-20 10:51:19 +08:00
Fu Siyuan 471342bbef MdeModulePkg: Replace ASSERT with error return code in PXE driver.
This patch remove the ASSERT when receive a DHCP packet large than the maximum
cache buffer size.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2016-12-19 08:54:15 +08:00
Liming Gao 9a7d1adf5d MdeModulePkg EbcDxe: Fix CLANG38 build failure
Change structure value assignment with CopyMem() API.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-12-14 14:38:05 +08:00
Star Zeng d5aef955b9 MdeModulePkg VariableSmm: Check InfoSize correctly
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=290

Current SmmVariableGetStatistics() in VariableSmm.c is always
checking input InfoSize against the first variable info,
it is incorrect.

For instance, there are three variables.
BootOrder
Boot0000
Boot0001

If the input InfoEntry is holding the second variable info (Boot0000)
and InfoSize is sizeof (VARIABLE_INFO_ENTRY) + StrSize (L"Boot0000"),
current code will return EFI_BUFFER_TOO_SMALL, but it should return
the third variable info (Boot0001).

This patch is to refine the code logic.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-12-12 09:55:37 +08:00
Star Zeng 62016c1e89 MdeModulePkg VariableSmm: Do not need check CommBufferSize buffer
Current code in SmmVariableHandler() checks CommBufferSize
buffer to make sure it points to outside SMRAM in
"case SMM_VARIABLE_FUNCTION_GET_STATISTICS".

But after eaae7b33b1,
CommBufferSize buffer points to SMRAM that was used by
SMM core to cache CommSize from SmmCommunication protocol,
then the check will fail definitely and GET_STATISTICS
feature breaks.

In fact, do not need check CommBufferSize buffer at all
even before eaae7b33b1.
Before eaae7b33b1,
CommBufferSize buffer pointed to gSmmCorePrivate->BufferSize
that is outside SMRAM, the check will success definitely;
after eaae7b33b1,
CommBufferSize buffer points to local variable BufferSize
(in SMRAM) in SmmEntryPoint(), the check is not needed
definitely.

The patch is to remove the check.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-12-12 09:17:58 +08:00
Dandan Bi f42f22f5dd MdeModulePkg/EbcDxe: Fix incorrect Copyright format
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
2016-12-09 10:38:36 +08:00
Ruiyu Ni 8537bd7ef6 MdeModulePkg/BdsDxe: Initialize gConnectConInEvent earlier
PlatformBootManagerBeforeConsole() might want to trigger this event
to connect ConIn so BdsDxe initializes this event before
PlatformBootManagerBeforeConsole().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
2016-12-08 10:11:01 +08:00
Zhang Lubo 5a066b87bd MdeModulePkg: Fix assert in iSCSI.
The bug is caused by using already freed memory.
If there is already an attempt and execute
'reconnect -r' command, all the ConfigFormEntry structure
will be freed in IScsiDriverBindingStop, but the
mCallbackInfo->Current is not configured as null and
this pointer will be used again in IScsiFormExtractConfig.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-12-07 16:13:11 +08:00
Dandan Bi 919278054f MdeModulePkg/SetupBrowserDxe: Fix incorrect local variable used
https://bugzilla.tianocore.org/show_bug.cgi?id=280

Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-12-06 18:41:43 +08:00
Dandan Bi d138a2e987 MdeModulePkg/EbcDxe: Add comments for functions
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Pete Batard <pete@akeo.ie>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen.yao@intel.com
2016-12-06 18:40:19 +08:00
Dandan Bi 532daaed0d MdeModulePkg/EbcDxe: Avoid Non-Boolean type used as Boolean
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Pete Batard <pete@akeo.ie>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen.yao@intel.com
2016-12-06 18:40:19 +08:00
Dandan Bi 3e118ea87d MdeModulePkg/EbcDxe: Make the variable name follow rules
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Pete Batard <pete@akeo.ie>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen.yao@intel.com
2016-12-06 18:40:15 +08:00
Dandan Bi 8fd543c77a MdeModulePkg/EbcDxe: Initialize variable after declaration
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Pete Batard <pete@akeo.ie>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen.yao@intel.com
2016-12-06 18:40:14 +08:00
Dandan Bi e8a5ac7c49 MdeModulePkg/EbcDxe: Make the comments align with EDKII coding style
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Pete Batard <pete@akeo.ie>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen.yao@intel.com
2016-12-06 18:40:13 +08:00
Pete Batard 2b2efe33ea MdeModulePkg/EbcDxe: add EBC Debugger configuration application
* Introduce a generic Debugger Configuration protocol.
* Add private configuration data in the EBC Debugger and make it
  register the Debugger Configuration protocol on initialization.
* Add a shell application that uses the protocol above to access
  the private data in order to configure the EBC debugger.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Pete Batard <pete@akeo.ie>
reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-11-29 12:48:33 +08:00
Dandan Bi 8ae1714047 MdeModulePkg: Fix GCC build failure
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Pete Batard <pete@akeo.ie>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen.yao@intel.com
2016-11-29 09:42:54 +08:00
Hao Wu 45b18ce5b1 MdeModulePkg/EbcDebugger: Compare ASCII char with '\0'
Current code is using L'\0' to compare with a ASCII char.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-11-25 13:34:28 +08:00
Hao Wu eebfb7b2a5 MdeModulePkg/EbcDebugger: Add ASSERT to ensure FieldBuffer is not NULL
In function EdbLoadCodBySymbolByIec(), AsciiStrGetNewTokenField() at line
1589 will return NULL if the first character in 'LineBuffer' is '\0'. But
the previous if statement at line 1576 ensures the above case will not
happen.

This commit adds ASSERT as warnings for the case that will not happen.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-11-25 13:34:24 +08:00
Hao Wu a8a624d0a4 MdeModulePkg/EbcDebugger: Add missing check for symbol not found
In function DebuggerDisplaySymbolAccrodingToAddress(), when variable
'CandidateAddress' (returned by EbdFindSymbolAddress function) equals
(UINTN) -1, it also indicates that the symbol is not found at the given
address.

This commit adds this missing check.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-11-25 13:34:21 +08:00
Hao Wu 12f49354e6 MdeModulePkg/EbcDebugger: Add check for invalid 'CommandArg'
Add checks for the return value of function Atoi() in EdbCmdBreakpoint.c.
If the input parameter 'CommandArg' contains non-digit character, print
corresponding error message.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-11-25 13:34:17 +08:00
Hao Wu 0978bd0dc1 MdeModulePkg/EbcDebugger: Operands of same size for bitwise operation
Operands in a bitwise operation should have the same size to eliminate
unexpected results.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-11-25 13:34:13 +08:00
Dandan Bi 6bfd7ea7d6 MdeModulePkg/DriverSample: Remove the password related codes
In current DriverSampleDxe, the sample code of password is
not a good example, so we plan to remove it.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-25 10:50:27 +08:00
Dandan Bi 87f04621ad MdeModulePkg/DriverSampleDxe: Remove the non-interactive password
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-25 10:50:27 +08:00
Dandan Bi a275df8f9a MdeModulePkg: Clear the buffer after using it
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-25 10:50:27 +08:00
Dandan Bi 9e2462b8a2 MdeModulePkg/SetupBrowser:Don't support password without interactive flag
In current SetupBrowser, the logic related to non-interative password
is not correct. How to support it correctly or whether support it
is still under investigation. First step remove the incorrect logic.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-25 10:50:26 +08:00
Dandan Bi 88f0c4e29c MdeModulePkg/DisplayEngine: Popup dialogue when password is not supported
when the password is not supported, pop up a dialogue
to let user know the reason.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-25 10:50:26 +08:00
Pete Batard 3e2c784302 MdeModulePkg/EbcDxe: reorganize EBC header definitions
VM related defs are now in EbcVmTest.h, and opocode related definitions in
Ebc.h.
Because it is used by both the EBC Debugger and driver,
EbcDebugSignalException() sees its definition factorized in
EbcDebuggerHook.h.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-11-23 10:20:28 +08:00
Pete Batard 748edcd5eb MdeModulePkg/EbcDxe: add EBC Debugger
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-11-23 10:20:26 +08:00
Pete Batard 6f0a3cd23e MdeModulePkg/EbcDxe: prepare support for EBC Debugger
* This patch introduces EbcDebuggerHook.c/h and inserts the required
  EBCDebugger references into the existing EBC source files.
* With all the hooks defined to their empty version in EbcDebuggerHook.c
  the existing EBC VM behaviour is left unaffected.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-11-23 10:20:25 +08:00
Dandan Bi 0265811dbe MdeModulePkg/DisplayEngine: Return the selectable menu correctly
When returning selectable menu, should return the menu in current form,
the codes miss to do the check. Now returning the selectable menu behind
the codes "if ((UINTN) Distance + NextMenuOption->Skip > GapToTop)".
Then can cover the check, can return the menu correctly.

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

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-11-23 10:11:47 +08:00
Fu Siyuan 4f6b33b460 MdeModulePkg: Check for the max DHCP packet length before use it.
This patch updates the PXE driver to drop the input DHCP packet if it
exceed the maximum length.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
2016-11-18 16:30:37 +08:00
Ruiyu Ni 0dc3fb06b2 MdeModulePkg/BdsDxe: Avoid overwriting PlatformRecovery####
Current implementation always creates PlatformRecovery0000
pointing to \EFI\BOOT\BOOT$(ARCH).efi but it may overwrite
PlatformRecovery#### created before (maybe by a DXE driver).

The patch only uses the smallest unused option number for
the \EFI\BOOT\BOOT$(ARCH).efi PlatformRecovery#### to avoid
overwriting already-created PlatformRecovery####.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jie Lin <jie.lin@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-11-18 10:42:04 +08:00
Ruiyu Ni de67c35c8a MdeModulePkg/BdsDxe: Fix bug to run non-first PlatformRecovery####
The implementation doesn't check the LoadOptions[Index].Status but
only depends on the Status returned from
EfiBootManagerProcessLoadOption(), which results only the first
PlatformRecovery#### runs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jie Lin <jie.lin@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-11-18 10:42:04 +08:00
Eric Dong a52aed37f3 MdeModulePkg HiiDatabase: Remove extra memory initialization.
The memory will be set to background color after success allocate
the data, so not need to call AllocateZeroPool.

Related bugz: https://bugzilla.tianocore.org/show_bug.cgi?id=223

Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-17 17:32:35 +08:00
Jiaxin Wu 7278ce8cec MdeModulePkg/Ip4Dxe: Correct the return status
This patch made the following change:
* DataItem->Status should be updated to the status code.
* Data should not be freed if EFI_NOT_READY returned.

Cc: Santhapur Naveen <naveens@amiindia.co.in>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-11-17 08:21:29 +08:00
Jiaxin Wu 818ba0ef81 MdeModulePkg/Ip4Dxe: Add wrong/invalid subnet check
v2:
* Separate out the return status fix.
* Replace IP4_MASK_MAX with IP4_MASK_NUM.
* Remove the ON_EXIT label.

This patch is used to add the wrong/invalid subnet check.

Cc: Santhapur Naveen <naveens@amiindia.co.in>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-11-17 08:21:13 +08:00
Ruiyu Ni e048823f57 MdeModulePkg/SecurityStubDxe: Report failure if image is load earlier
The 3rd party image should be loaded after EndOfDxe event signal and
DxeSmmReadyToLock protocol installation. But non-SMM platform doesn't
published DxeSmmReadyToLock protocol.
So the SecurityStubDxe can only depend on EndOfDxe event.

This patch enhances the SecurityStubDxe to listen on
DxeSmmReadyToLock protocol installation and if any 3rd party image
is loaded before DxeSmmReadyToLock, it reports failure.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-11-10 15:58:00 +08:00
Ruiyu Ni 048bcba1bc MdeModulePkg/BdsDxe: Check deferred images before booting to OS
The patch adds check of deferred images before booting to OS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-11-10 15:55:39 +08:00
Ruiyu Ni 8be37a5cee MdeModulePkg/SecurityStubDxe: Defer 3rd party image before EndOfDxe
The images not from FV are treated as 3rd party images. They will
be deferred to dispatch when they are dispatched before EndOfDxe
event.
It's a new feature in the BS.LoadImage() path which can disallow
executing 3rd party images before EndOfDxe and re-execute them
after EndOfDxe (through EfiBootManagerDispatchDeferredImages
introduced in next commit).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-11-10 15:55:34 +08:00
Jeff Fan 6fb389d0a1 MdeModulePkg: Display new stack base and size
Dump new stack base and size information could help developer to narrow down
stack crash issue.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-11-09 16:00:04 +08:00
Jiewen Yao ab3aac14ab MdeModulePkg/Esrt: Add ESRT_FW_TYPE_SYSTEMFIRMWARE check.
The previous ESRT driver unconditionally treat FMP to be
ESRT_FW_TYPE_DEVICEFIRMWARE.
EDKII System Capsule reuses FMP, but it is ESRT_FW_TYPE_SYSTEMFIRMWARE.

Add check to ImageTypeId check to see if it is ESRT_FW_TYPE_SYSTEMFIRMWARE.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
2016-11-08 22:37:03 +08:00
Cinnamon Shia bfb4c2ba37 MdeModulePkg/PCD: Fix PcdGetNextToken may get a wrong PCD token
If there are two DynamicEx PCDs have the same PCD token number but
in different PCD token spaces, the PcdGetNextToken function may get
the wrong PCD token.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-11-03 11:00:52 +08:00
Fu Siyuan e86f363564 MdeModulePkg: Check for NULL pointer before dereference it.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2016-10-31 16:03:00 +08:00
Jiaxin Wu 4b7aee0a33 MdeModulePkg: Fix the wrong Timer event check
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-10-31 08:45:08 +08:00