Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c991c3db authored by Will Deacon's avatar Will Deacon
Browse files

toolbox/modprobe: Filter module directories based on kernel page size

When modules for multiple kernels with the same major/minor versions
are installed on a device, modprobe will search the module directories
based on whatever order scandir() returned them. In this case, it is
possible that we will try to load modules with the wrong page size for
the running kernel, which can lead to obscure symbol CRC mismatches and
ultimately a system crash.

Adjust the scandir() filtering function so that the kernel page size is
taken into account in addition to the major/minor versions returned by
utsname(). The general rule is that module directories ending in "_Nk"
contain modules for a page-size of N KiB, whilst the absence of such
a suffix implies the default of 4 KiB.

Bug: 343971855
Test: Verified that _16k module directory is excluded by modprobe when running in userspace fastboot with 4k pages.
Change-Id: I78a0a249028bbb0bcdd78eb14de36e631e233be0
parent 4e1776ce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment