Github messages for voidlinux
 help / color / mirror / Atom feed
From: classabbyamp <classabbyamp@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [ISSUE] [CLOSED] cross-built kernel cannot load externally-built modules
Date: Wed, 26 Jun 2024 19:03:02 +0200	[thread overview]
Message-ID: <20240626170302.4B60926A40@inbox.vuxu.org> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-51005@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1636 bytes --]

Closed issue by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/issues/51005

Description:
### System Info

Void 6.8.12_2 aarch64-glibc

### Package(s) Affected

linux6.8 at minimum, probably other `linux6.*` kernels (rpi-kernel is *not* affected)

if the kernel is built natively, this issue does not occur

### Expected behaviour

externally-built (dkms or other mechanism) modules load successfully

```
nm --print-size --size-sort hello.ko | grep __this_module       
0000000000000000 0000000000000500 D __this_module
```

### Actual behaviour

```
# modprobe ./hello.ko
modprobe: ERROR: could not insert 'hello': Exec format error
```
dmesg:
```
[...] module hello: .gnu.linkonce.this_module section size must match the kernel's built struct module size at run time
```

```
nm --print-size --size-sort hello.ko | grep __this_module
0000000000000000 00000000000004c0 D __this_module
```

### Steps to reproduce

```sh
mkdir -p hello-mod && cd hello-mod

cat <<EOF > Makefile 
obj-m += hello.o

PWD := $(CURDIR)

all:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
EOF

cat <<EOF > hello.c
#include <linux/module.h>
#include <linux/printk.h>

int init_module(void) {
    pr_info("hello");
    return 0;
}

void cleanup_module(void) {
    pr_info("goodbye");
}

MODULE_LICENSE("GPL");
EOF

make
sudo modprobe ./hello.ko
```

### Notes

Error message introduced by https://lore.kernel.org/lkml/ZBuShv1hx03WmzH4@bombadil.infradead.org/T/

      reply	other threads:[~2024-06-26 17:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-26  0:13 [ISSUE] " classabbyamp
2024-06-26 17:03 ` classabbyamp [this message]

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=20240626170302.4B60926A40@inbox.vuxu.org \
    --to=classabbyamp@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).