binfmt_elf: Use elf_load() for library
authorKees Cook <keescook@chromium.org>
Fri, 29 Sep 2023 03:24:32 +0000 (20:24 -0700)
committerKees Cook <keescook@chromium.org>
Wed, 4 Oct 2023 02:48:43 +0000 (19:48 -0700)
commitd5ca24f639588811af57ceac513183fa2004bd3a
tree18f775306dc281e750c9abdcfe9df0d2e6dafa8f
parent8b04d32678e3c46b8a738178e0e55918eaa3be17
binfmt_elf: Use elf_load() for library

While load_elf_library() is a libc5-ism, we can still replace most of
its contents with elf_load() as well, further simplifying the code.

Some historical context:
- libc4 was a.out and used uselib (a.out support has been removed)
- libc5 was ELF and used uselib (there may still be users)
- libc6 is ELF and has never used uselib

Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-mm@kvack.org
Suggested-by: Eric Biederman <ebiederm@xmission.com>
Tested-by: Pedro Falcato <pedro.falcato@gmail.com>
Signed-off-by: Sebastian Ott <sebott@redhat.com>
Link: https://lore.kernel.org/r/20230929032435.2391507-4-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
fs/binfmt_elf.c