[PATCH v2 1/2] modutils: check ELF header before calling finit_module()

Kang-Che Sung explorer09 at gmail.com
Mon Jan 4 10:01:13 UTC 2021


On Sun, Jan 3, 2021 at 12:11 PM Qu Wenruo <wqu at suse.com> wrote:
>
> finit_module() and init_module() system calls have clear specification
> to only accept valid ELF image.
>
> Although we try finit_module() on compressed modules to let the kernel
> determine if it's an ELF image, but it's not ideal, especially when
> newer kernel will complain when some invalid files/memory is passed in.
>
> Treat the kernel better by just doing a very basic ELF header check
> before calling finit_module().
>
> Signed-off-by: Qu Wenruo <wqu at suse.com>

What is the reason for not letting the kernel do all the ELF sanity checks?
Performance? Security? For now this looks like extra code to busybox
without obvious benefits.


More information about the busybox mailing list