Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] cross-built kernel cannot load externally-built modules
@ 2024-06-26  0:13 classabbyamp
  2024-06-26 17:03 ` [ISSUE] [CLOSED] " classabbyamp
  0 siblings, 1 reply; 2+ messages in thread
From: classabbyamp @ 2024-06-26  0:13 UTC (permalink / raw)
  To: ml

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

New 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 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
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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ISSUE] [CLOSED] cross-built kernel cannot load externally-built modules
  2024-06-26  0:13 [ISSUE] cross-built kernel cannot load externally-built modules classabbyamp
@ 2024-06-26 17:03 ` classabbyamp
  0 siblings, 0 replies; 2+ messages in thread
From: classabbyamp @ 2024-06-26 17:03 UTC (permalink / raw)
  To: ml

[-- 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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-26 17:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26  0:13 [ISSUE] cross-built kernel cannot load externally-built modules classabbyamp
2024-06-26 17:03 ` [ISSUE] [CLOSED] " classabbyamp

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).