LoadPin module can't handle compressed modules
I can compress the modules:
CONFIG_MODULE_COMPRESS=y
CONFIG_MODULE_COMPRESS_GZIP=y
but Chromium OS will not load the compressed modules (fail to boot).
I tried loading gzip compressed module on a working chromeos:
- compress modules with gzip (e.g.
gzip mwifiex_pcie.ko) - copy them into /lib/modules/$(uname -r)/updates/
- run
sudo depmod - unload module (e.g.
sudo modprobe -r mwifiex_pcie) - load the compressed modules (e.g.
sudo modprobe mwifiex_pcie)
And the following is the message on dmesg:
kern :notice: [ 1273.001299] LoadPin: kernel-module old-api-denied obj=<unknown> pid=11317 cmdline="modprobe mwifiex_pcie"
If I disable enforcing loadpin (sudo echo 0 | sudo tee /proc/sys/kernel/loadpin/enforce), it loaded:
LoadPin: kernel-module old-api-pinning-ignored obj=<unknown> pid=22313 cmdline="modprobe mwifiex_pcie"
Related code: https://github.com/torvalds/linux/blob/caffb99b6929f41a69edbb5aef3a359bf45f3315/security/loadpin/loadpin.c#L131-L140
Further search revealed that currently the LoadPin module can't handle compressed modules...
- https://www.spinics.net/lists/linux-modules/msg01663.html ("Module compression & loadpin")
See: https://lore.kernel.org/linux-modules/[email protected]/ and https://lore.kernel.org/lkml/[email protected]/