Re: [question] insert ko failed because count_plts return 0 when CONFIG_RANDOMIZE_BASE is not set

From: Ard Biesheuvel
Date: Thu Mar 25 2021 - 03:36:50 EST


On Thu, 25 Mar 2021 at 07:22, chenjun (AM) <chenjun102@xxxxxxxxxx> wrote:
>
> 在 2021/3/24 16:29, Ard Biesheuvel 写道:
> > On Wed, 24 Mar 2021 at 08:27, chenjun (AM) <chenjun102@xxxxxxxxxx> wrote:
> >>
> >> Hi
> >>
> >> I make a Image for arm64 (without CONFIG_RANDOMIZE_BASE). And a ko (13M)
> >> can not be inserted.
> >>
> >
> > How many large modules have you loaded already? The module region is
> > only 128 MB, so if your modules are huge, you may run out of space.
> >
> > Please check the kernel VA address and the load address of the module,
> > and check whether they are more than 128 MB apart.
> >
>
> Thanks Ard
>
> I will check it.
>
> One more question, why is CONFIG_ARM64_MODULE_PLTS depended on
> CONFIG_RANDOMIZE_BASE?
>

Because modules should never go out of branching range if the
placement is not randomized and the total size of all modules does not
exceed 128 MB.