[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Busybox modprobe brings error "Invalid ELF header magic: !=ELF"
From:       Jeff Pohlmeyer <yetanothergeek () gmail ! com>
Date:       2023-04-28 14:19:48
Message-ID: CAEuRe+2sL_n796G9yTo5RZuymZeCAphzCcsrRhEN9mXLvseWog () mail ! gmail ! com
[Download RAW message or body]

On Fri, Mar 31, 2023 at 6:20 AM Denys Vlasenko <vda.linux@googlemail.com> wrote:

> Kernel does not auto-detect compressed modules.
> We need to call finit_module() with MODULE_INIT_COMPRESSED_FILE flag
> if module is compressed.
>
> Fixed it in git. Please try it now.

This is not working for me. In the best case, finit_module() tries the
MODULE_INIT_COMPRESSED_FILE flag and returns -1 with errno set to
ENOEXEC (Exec format error). It then tries again with the flag set to
zero and returns the same error. Then it continues on to the
init_module() call, which successfully loads the module.

But in the worst case (which seems to happen randomly), finit_module()
tries the MODULE_INIT_COMPRESSED_FILE flag and immediately receives a
SIGKILL, killing busybox and failing to load the module. (See
attachment for dmesg output.)

This is on Artix Linux with their stock kernel 6.2.11. The modules are
zstd compressed and my busybox has the zstd patch applied, but I don't
think that is causing the problem since the random crashes occur when
the kernel is asked to do the decompression. If the code makes it to
the part where busybox does the decompression, all is well.

If I completely disable the `#ifdef __NR_finit_module` block,
everything works just fine. I wonder how many people actually need
this feature -- maybe there could be a build option to disable it? I
didn't find any usage of MODULE_INIT_COMPRESSED_FILE  in the kmod-30
sources, and there is scant mention of it on google or bing.

 - Jeff

["bb-modprobe.dmesg" (application/octet-stream)]

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic