From: Sumitra Sharma <sumitraartsy@gmail.com>
To: Ira Weiny <ira.weiny@intel.com>
Cc: outreachy@lists.linux.dev, julia.lawall@inria.fr
Subject: Re: Help in loading modules
Date: Sun, 19 Mar 2023 07:23:13 -0700 [thread overview]
Message-ID: <20230319142313.GA119933@sumitra.com> (raw)
In-Reply-To: <640e7b815280e_229a89294ef@iweiny-mobl.notmuch>
On Sun, Mar 12, 2023 at 06:25:21PM -0700, Ira Weiny wrote:
> Sumitra Sharma wrote:
> > More information:
> >
> > Upon running the "dmesg" it shows
> > ##
> > BPF: Invalid name_offset:2154618
> > [ 2905.429687] failed to validate module [pi433] BTF: -22
> > ##
>
> Good start. I did some digging.
>
> $ git grep "failed to validate module"
> kernel/bpf/btf.c: pr_warn("failed to validate module [%s] BTF: %ld\n",
>
>
> kernel/bpf/btf.c:
> ...
> if (!IS_ENABLED(CONFIG_MODULE_ALLOW_BTF_MISMATCH)) {
> pr_warn("failed to validate module [%s] BTF: %ld\n",
> mod->name, PTR_ERR(btf));
> err = PTR_ERR(btf);
> } else {
> ...
>
>
> $ git grep BTF_MISMATCH
> kernel/bpf/btf.c: if (env->btf->base_btf && IS_ENABLED(CONFIG_MODULE_ALLOW_BTF_MISMATCH))
> kernel/bpf/btf.c: if (env->btf->base_btf && IS_ENABLED(CONFIG_MODULE_ALLOW_BTF_MISMATCH))
> kernel/bpf/btf.c: if (!IS_ENABLED(CONFIG_MODULE_ALLOW_BTF_MISMATCH)) {
> lib/Kconfig.debug:config MODULE_ALLOW_BTF_MISMATCH
>
>
> lib/Kconfig.debug:
> ...
> config MODULE_ALLOW_BTF_MISMATCH
> bool "Allow loading modules with non-matching BTF type info"
> depends on DEBUG_INFO_BTF_MODULES
> help
> For modules whose split BTF does not match vmlinux, load without
> BTF rather than refusing to load. The default behavior with
> module BTF enabled is to reject modules with such mismatches;
> this option will still load module BTF where possible but ignore
> it when a mismatch is found.
> ...
>
> For more information on BTF:
>
> https://docs.kernel.org/bpf/btf.html
>
> Are you building this module in the same place as the running kernel? It would
> probably be easier to do so.
>
> Ira
>
Hi Ira,
What is the solution to this?
Regards,
Sumitra
> >
> > Also I checked under "/lib/modules/`uname -r`" in the "modules.dep" file it do contains the "kernel/drivers/staging/pi433/pi433.ko:".
> >
> > I also tried running "sudo insmod ./kernel/drivers/staging/pi433/pi433.ko" which again prints the error:
> >
> > ##
> > insmod: ERROR: could not insert module ./kernel/drivers/staging/pi433/pi433.ko: Invalid parameters
> > ##
> >
> > Other than these I also checked the ".config" which contains:
> >
> > ##
> > CONFIG_SPI=y
> > CONFIG_STAGING=y
> > CONFIG_PI433=m
> > ##
> >
> > where the module dependencies were given as
> >
> > Symbol: PI433 [=m] │
> > │ Type : tristate │
> > │ Defined at drivers/staging/pi433/Kconfig:2 │
> > │ Prompt: Pi433 - a 433MHz radio module for Raspberry Pi │
> > │ Depends on: STAGING [=y] && SPI [=y] │
> > │ Location: │
> > │ -> Device Drivers │
> > │ -> Staging drivers (STAGING [=y]) │
> > │ (1) -> Pi433 - a 433MHz radio module for Raspberry Pi (PI433 [=m])
> >
> >
>
>
next prev parent reply other threads:[~2023-03-19 14:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230311085922.GC11242@ubuntu>
2023-03-11 9:01 ` Help in loading modules Julia Lawall
2023-03-11 10:28 ` Sumitra Sharma
2023-03-11 10:33 ` Julia Lawall
2023-03-13 1:25 ` Ira Weiny
2023-03-19 14:23 ` Sumitra Sharma [this message]
2023-03-21 0:29 ` Ira Weiny
[not found] <20230311073128.GA11242@ubuntu>
2023-03-11 8:49 ` Julia Lawall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230319142313.GA119933@sumitra.com \
--to=sumitraartsy@gmail.com \
--cc=ira.weiny@intel.com \
--cc=julia.lawall@inria.fr \
--cc=outreachy@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.