Query : Regarding overwriting of DTB loading region while clearing BSS section

Mark Rutland mark.rutland at arm.com
Thu Nov 23 10:21:32 PST 2017


On Thu, Nov 23, 2017 at 10:26:07PM +0530, Kohli, Gaurav wrote:
> Hi Mark,
> 
> Thanks for the reply,
> 
> Actually, We solved our issue by removing unwanted code from kernel,

I would very strongly recommend that you update your bootladoer/firmware
to respect image_size, since any numbero f things may increase the size
of the kernel in future.

i.e. trimmign the kernel down is a workaround, but not a fix.

> But my request can't we put some check itself in head.s during clear
> of BSS region to check whether dtb is intact or not.  Because
> ultimately it will fail in start kernel.
> At that point(start_kernel),  we can not directly say what is the root cause
> for this overriding.

Perhaps we could add a check in setup_arch(). If the DTB pointer
overlaps any part of the kerenl (BSS included), the bootloader is
clearly broken.

Even then, it's going to be a slient panic(), since we won't be able to
parse anything out of the DTB...

Thanks,
Mark.



More information about the linux-arm-kernel mailing list