Re: [edk2-devel] [PATCH 1/5] MdeModulePkg/PeiCore: Align fixed-address error behaviour

2021-08-21 Thread Marvin Häuser
Good day, Is someone firm with the details around git send-mail? I explicitly disabled threading (i.e. "git config sendemail.thread" yields "false"), and the original patch file does not contain any "In-Reply-To" header. Yet I can see it being added referring to the cover letter of a differen

Re: [edk2-devel] [PATCH 1/1] BaseTools/tools_def: Correct 64-bit type alignment for IA32 CLANG38

2021-08-21 Thread Marvin Häuser
For whom it may interest, this was caught with the help of this patch: https://edk2.groups.io/g/devel/message/79318 Best regards, Marvin On 21/08/2021 21:55, Marvin Häuser wrote: The CLANG38 toolchain aligns 64-bit data types on an 4-Byte boundary for IA32, which is the default for the GNU ABI

[edk2-devel] [PATCH 2/5] MdeModulePkg/DxeCore: Align fixed-address error behaviour

2021-08-21 Thread Marvin Häuser
Update the control flow to take the same actions for failed fixed-address loading as if the feature was disabled. This allows Images to still be loaded to their preferred address in the case of a mismatch between fixed-address and preferred address, and also ensures correct handling of stripped rel

[edk2-devel] [PATCH 2/3] ArmPkg: Use Image base address for GDB symbols loading

2021-08-21 Thread Marvin Häuser
GDB symbols are currently loaded by specifying the .text section address. It is assumed to be the value of the PE/COFF SizeOfHeaders field. This may not be the case for various reasons, including a sufficiently strict Image section alignment. Use the "-o" parameter to specify the Image base address

[edk2-devel] [PATCH 5/5] MdeModulePkg/PiSmmCore: Disallow stripped Image relocations

2021-08-21 Thread Marvin Häuser
The SMM stack does not support loading Images to preferred addresses in any way. Add checks that Image relocations have not been stripped. Cc: Jian J Wang Cc: Hao A Wu Cc: Eric Dong Cc: Ray Ni Cc: Vitaly Cheptsov Signed-off-by: Marvin Häuser --- MdeModulePkg/Core/PiSmmCore/Dispatcher.c | 12

[edk2-devel] [PATCH 4/5] MdeModulePkg/PiSmmIpl: Disallow stripped Image relocations

2021-08-21 Thread Marvin Häuser
The SMM stack does not support loading Images to preferred addresses in any way. Add checks that Image relocations have not been stripped. Cc: Jian J Wang Cc: Hao A Wu Cc: Eric Dong Cc: Ray Ni Cc: Vitaly Cheptsov Signed-off-by: Marvin Häuser --- MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c | 9 ++

[edk2-devel] [PATCH 3/3] ArmPkg: Use Image base address for RVCT symbols loading

2021-08-21 Thread Marvin Häuser
The initial import of the RVCT debug code used 0 for the address of the first Image section [1]. This commit has been made in 2010, when "--ro-base 0" was still passed as a build argument [2]. In 2015, this was changed to mirror the PE/COFF memory layout the same way that ELF does [3]. Update the c

[edk2-devel] [PATCH 3/5] MdeModulePkg/DxeCore: Check for fixed-address Image relocations

2021-08-21 Thread Marvin Häuser
Especially in the relative mode, fixed-address loading may not target the preferred Image base address. In this case, Image relocations are required to load the Image. Add the necessary check for this. Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao Cc: Vitaly Cheptsov Signed-off-by

[edk2-devel] [PATCH 1/5] MdeModulePkg/PeiCore: Align fixed-address error behaviour

2021-08-21 Thread Marvin Häuser
Update the control flow to take the same actions for failed fixed-address loading as if the feature was disabled. This primarily removes code duplication. Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao Cc: Debkumar De Cc: Harry Han Cc: Catharine West Cc: Vitaly Cheptsov Signed-o

[edk2-devel] [PATCH 1/1] MdeModulePkg: Move PiSmmCoreMemoryAllocationLib into PiSmmCore

2021-08-21 Thread Marvin Häuser
PiSmmCoreMemoryAllocationLib duplicates private definitions of PiSmmCore, namely the SMM_CORE_PRIVATE_DATA structure. Move this code into PiSmmCore, so that the struct definition can be consumed directly instead. Cc: Jian J Wang Cc: Hao A Wu Cc: Eric Dong Cc: Ray Ni Cc: Vitaly Cheptsov Signed

[edk2-devel] [PATCH 1/3] EmulatorPkg: Use Image base address for GDB symbols loading

2021-08-21 Thread Marvin Häuser
GDB symbols are currently loaded by specifying the .text section address. It is assumed to be the value of the PE/COFF SizeOfHeaders field. This may not be the case for various reasons, including a sufficiently strict Image section alignment. Use the "-o" parameter to specify the Image base address

[edk2-devel] [PATCH 1/1] BaseTools/tools_def: Correct 64-bit type alignment for IA32 CLANG38

2021-08-21 Thread Marvin Häuser
The CLANG38 toolchain aligns 64-bit data types on an 4-Byte boundary for IA32, which is the default for the GNU ABI. For the Microsoft ABI used by UEFI however, natural alignment holds for all data types on all architectures. Add the "-malign-double" flag already used by the GCC toolchains to ensur

[edk2-devel] [PATCH 1/1] BaseTools/tools_def: Fix CLANGPDB X64 RCPATH

2021-08-21 Thread Marvin Häuser
Use the correct X64 path for CLANGPDB RCPATH. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Cc: Vitaly Cheptsov Signed-off-by: Marvin Häuser --- BaseTools/Conf/tools_def.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/C

[edk2-devel] [PATCH 0/3] Update GDB and RVCT symbols loading to use the Image base address

2021-08-21 Thread Marvin Häuser
Both GDB and RVCT debugging libraries currently use .text address based symbols loading for different reasons. As the current code is making assumptions that are not guaranteed, update both usages to use the Image base address instead. Marvin Häuser (3): EmulatorPkg: Use Image base address for G

[edk2-devel] [edk2-platforms PATCH v2 5/5] Ext4Pkg: Sanity check more EXT4_DIR_ENTRY values.

2021-08-21 Thread Pedro Falcato
This should close up some possible exploits using crafted filesystem images. Cc: Leif Lindholm Cc: Michael D Kinney Cc: Bret Barkelew Signed-off-by: Pedro Falcato --- Features/Ext4Pkg/Ext4Dxe/Directory.c | 90 1 file changed, 51 insertions(+), 39 deletions(-) di

[edk2-devel] [edk2-platforms PATCH v2 4/5] Ext4Pkg: Add handling of EFI_FILE_SYSTEM_VOLUME_LABEL GetInfo().

2021-08-21 Thread Pedro Falcato
This commit adds support for EFI_FILE_SYSTEM_VOLUME_LABEL requests in GetInfo(). Cc: Leif Lindholm Cc: Michael D Kinney Cc: Bret Barkelew Signed-off-by: Pedro Falcato --- Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c | 1 - Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h | 17 Features/Ext4Pkg/Ext4Dxe/File.

[edk2-devel] [edk2-platforms PATCH v2 3/5] Ext4Pkg: Add a directory entry tree.

2021-08-21 Thread Pedro Falcato
This helps us track directories and directory entries, which helps us getting a general idea of how the filesystem looks. In the future, it might serve as a directory cache. Right now, it only lets us know which name "." and ".." may refer to, which fixes a EFI_FILE_PROTOCOL::GetInfo() bug that got

[edk2-devel] [edk2-platforms PATCH v2 2/5] Ext4Pkg: Hide "." and ".." entries from Read() callers.

2021-08-21 Thread Pedro Falcato
This makes it so callers that may expect FAT32 filesystems (most do) have more normal looking ReadDir() results. This commit also presents a better filename for files opened through Open("."). Cc: Leif Lindholm Cc: Michael D Kinney Cc: Bret Barkelew Signed-off-by: Pedro Falcato --- Features/

[edk2-devel] [edk2-platforms PATCH v2 1/5] Ext4Pkg: Fix incorrect usage of Ext4InitExtentsMap.

2021-08-21 Thread Pedro Falcato
Fixes bug triggered by ShellPkg code, in usage of EFI_FILE_PROTOCOL's Open(). Cc: Leif Lindholm Cc: Michael D Kinney Cc: Bret Barkelew Signed-off-by: Pedro Falcato --- Features/Ext4Pkg/Ext4Dxe/File.c | 29 ++--- 1 file changed, 22 insertions(+), 7 deletions(-) diff -

[edk2-devel] [edk2-platforms PATCH v2 0/5] Ext4Pkg: Fix bugs

2021-08-21 Thread Pedro Falcato
This patch-series addresses bugs found when testing the filesystem with more complex usage of the file protocol, particularly through the shell itself. This is version 2 of the patch series and addresses feedback received from the community. This version also adds two new patches to further improv