kitakar5525 / chromeos-kernel-linux-surface

linux-surface kernel for chromiumos.
GNU General Public License v3.0
18 stars 1 forks source link

LoadPin module can't handle compressed modules #3

Open kitakar5525 opened 5 years ago

kitakar5525 commented 5 years ago

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

kitakar5525 commented 4 years ago

I tried loading gzip compressed module on a working chromeos:

  1. compress modules with gzip (e.g. gzip mwifiex_pcie.ko)
  2. copy them into /lib/modules/$(uname -r)/updates/
  3. run sudo depmod
  4. unload module (e.g. sudo modprobe -r mwifiex_pcie)
  5. 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...

Allen-Webb commented 2 years ago

See: https://lore.kernel.org/linux-modules/YbLo8wjBWDxwICf1@google.com/ and https://lore.kernel.org/lkml/YbLnAeaKW4HdtRWL@google.com/