[PATCH 1/1] mvebu: fix end-of-array check
Pali Rohár
pali at kernel.org
Sun Dec 4 22:51:03 CET 2022
On Monday 05 December 2022 10:16:51 Simon Glass wrote:
> On Thu, 1 Dec 2022 at 07:55, Derek LaHousse <derek at seaofdirac.org> wrote:
> >
> > Properly seek the end of default_environment variables.
> >
> > The current algorithm overwrites from the second variable. This
> > replacement finds the end of the array of strings.
> >
> > Stomped variables include "board", "soc", "loadaddr". These can be
> > seen on a "env default -a" after patch, but they are not seen with a
> > version before the patch.
> >
> > Signed-off-by: Derek LaHousse <derek at seaofdirac.org>
> > ---
> > board/Marvell/mvebu_armada-37xx/board.c | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
>
> Reviewed-by: Simon Glass <sjg at chromium.org>
>
> It seems odd to update the default environment, but if we want to do
> this, it should really be done in a function in env/ along with some
> tests in test/env
>
> Regards,
> Simon
Well, this is just a temporary solution until Marek's env patch series is merged:
https://lore.kernel.org/u-boot/20211103232332.2737-1-kabel@kernel.org/
But I agree that tests would prevent these bugs.
More information about the U-Boot
mailing list