riscv: support the elf-fdpic binfmt loader
authorGreg Ungerer <gerg@kernel.org>
Tue, 11 Jul 2023 13:07:54 +0000 (23:07 +1000)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 23 Aug 2023 21:17:43 +0000 (14:17 -0700)
commit9549fb354ef1a451ceddfa404ae3e943c5c803d0
tree997fbf877b8e35e957479814c29510c767ebc74a
parentb922bf04d2c1355633bdefbc2ed5fba1f0d4df07
riscv: support the elf-fdpic binfmt loader

Add support for enabling and using the binfmt_elf_fdpic program loader
on RISC-V platforms. The most important change is to setup registers
during program load to pass the mapping addresses to the new process.

One of the interesting features of the elf-fdpic loader is that it
also allows appropriately compiled ELF format binaries to be loaded on
nommu systems. Appropriate being those compiled with -pie.

Signed-off-by: Greg Ungerer <gerg@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230711130754.481209-3-gerg@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/elf.h
arch/riscv/include/asm/mmu.h
arch/riscv/include/uapi/asm/ptrace.h
fs/Kconfig.binfmt