On 10 Jan 2023, at 20:18, Vineet Gupta <vineetg@xxxxxxxxxxxx> wrote:
This implements the elf loader hook to parse RV specificThis code is full of buffer overruns and uninitialised reads in the
.riscv.attributes section. This section is inserted by compilers
(gcc/llvm) with build related information such as -march organized as
tag/value attribute pairs.
It identifies the various attribute tags (and corresponding values) as
currently specified in the psABI specification.
This patch only implements the elf parsing mechanics, leaving out the
recording/usage of the attributes to subsequent patches.
Reported-by: kernel test robot <lkp@xxxxxxxxx> # code under CONFIG_COMPAT
Signed-off-by: Vineet Gupta <vineetg@xxxxxxxxxxxx>
presence of malicious files,
and fails to check the version, vendor and sub-subsection tag.
You also should handle more than one sub-subsection even if tools don’t
emit it today.
You also have an unaligned access for reading the sub-subsection’s data
length (maybe that’s ok in kernel land, but worth making sure).