7 Commits

Author SHA1 Message Date
Savva Mitrofanov
d24fd429be
Ext4Pkg: Code correctness and security improvements
Applies latest upstream changes, which performs minor changes into
previous patchset

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-02-16 21:20:02 +06:00
Savva Mitrofanov
f335cf23f1
Revert "Ext4Pkg: Add comparison between Position and FileSize in Ext4SetPosition"
This reverts commit f21c8083753d667815d2719a9e7417dd4f1277c5.
We don't need to perform this check in SetPosition because by spec this
check done in read operation

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-01-13 12:57:46 +03:00
Savva Mitrofanov
ed668ba596
Ext4Pkg: Fix shift out of bounds in Ext4OpenSuperblock
Missing check for wrong s_log_block_size exponent leads to shift out of
bounds. Limit block size to 2 MiB

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2022-12-07 14:48:05 +06:00
Savva Mitrofanov
17fa176e4d
Ext4Pkg: Add inode number validity check
We need to validate inode number to prevent possible null-pointer
dereference of directory parent in Ext4OpenDirent. Also checks that
inode number valid across opened partition before we read it in
Ext4ReadInode.

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2022-12-07 14:48:04 +06:00
Savva Mitrofanov
f21c808375
Ext4Pkg: Add comparison between Position and FileSize in Ext4SetPosition
Missing such comparison leads to infinite loop states, for example code
which trying to read entire file can easily get out of bound of
file size by passing position value which exceeds file size without this
check. So we need to add there missing comparison between the desired
position to be set and file size

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2022-12-07 14:48:03 +06:00
Savva Mitrofanov
fbb8595120
Ext4Pkg: Move EXT4_NAME_MAX definition to Ext4Disk.h
Constant EXT4_NAME_MAX is related to EXT4_DIR_ENTRY FS structure, so it
should be placed into Ext4Disk.h header

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2022-12-07 14:47:59 +06:00
Savva Mitrofanov
03362e6d6f
Ext4Pkg: Add EDK II Ext4 package
Adds a Pedro Falcato's UEFI EXT4 filesystem driver that implements the EFI_FILE_PROTOCOL and EFI_SIMPLE_FILE_SYSTEM_PROTOCOL.

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2022-12-07 14:47:55 +06:00