Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to load modules built against an older longterm kernel #2867

Closed

Conversation

dimkr
Copy link
Contributor

@dimkr dimkr commented Feb 13, 2022

When building against kernel sources from an older 5.10.x:

~$ apt install broadcom-sta-dkms
...
Setting up dkms (2.8.4-3) ...
Setting up broadcom-sta-dkms (6.30.223.271-17) ...
Loading new broadcom-sta-6.30.223.271 DKMS files...
It is likely that 5.10.0 belongs to a chroot's host
Building for 5.10.0
Building initial module for 5.10.0
Done.

wl.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.10.0/updates/dkms/

depmod.....

DKMS: install completed.
~$ modprobe wl
modprobe: ERROR: could not insert 'wl': Exec format error
~$ dmesg | tail -n 1
[50315.182888] wl: disagrees about version of symbol module_layout

With a kernel built from this PR, modprobe wl works although the kernel sources SFS is older.

@mavrothal
Copy link
Contributor

If this implies that any module can be installed or force-installed in a puppy long-term kernel, looks like a very poor (and unsafe) idea.
Why would you want to do that?

@dimkr
Copy link
Contributor Author

dimkr commented Feb 13, 2022

This makes it possible to build wl.ko against 5.10.99, and load it with 5.10.100. This is safe.

What isn't safe, is trying to load a module built against 5.10.99 when running 5.16.9. But that wont' happen, because the module path is different, and the user who tries to force it is knowingly doing something stupid and dangerous.

@mavrothal
Copy link
Contributor

I still do not see what is the problem you try to solve
Why would someone want to load a kernel module from another kernel, instead of recompiling.
Different kernel - different modules.
Omitting this check opens a can of warms to stupidity or worse.

@dimkr
Copy link
Contributor Author

dimkr commented Feb 13, 2022

Why would someone want to load a kernel module from another kernel, instead of recompiling.

To avoid recompiling, that's the answer. Puppy doesn't support dkms like Debian, so you have to recompile after each kernel update.

@mavrothal
Copy link
Contributor

I would think that fixing support for dkms or recompiling is a way better solution than allowing a "free for all" in module loading.

@dimkr dimkr closed this Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants