Smatch report for ubispl
Greg Malysa
malysagreg at gmail.com
Fri Aug 1 17:25:58 CEST 2025
On Fri, Aug 1, 2025 at 10:50 AM Benedikt Spranger
<b.spranger at linutronix.de> wrote:
>
> On Fri, 1 Aug 2025 12:42:06 +0100
> Andrew Goodbody <andrew.goodbody at linaro.org> wrote:
>
> > Smatch reports the following error.
> Fine.
>
> > drivers/mtd/ubispl/ubispl.c:782 ubi_scan_fastmap() error: memcpy()
> > 'vh' too small (64 vs 268)
> OK. And how does it come to that conclusion?
> What config - what extra shebang was used to get here?
>
> > I do not know the code well enough to attempt a fix in this case.
> And I have no glasball to get sufficient information...
Look at the line mentioned. It is a memcpy from a much larger struct
to a much smaller struct using the size of the larger struct. On a 32
bit system it's a 268 byte copy into a 32 byte destination.
>
> So please provide more information, what you are doing, what
> configuration you use, what is going on behind the scenes.
>
> We are talking mainly about SPL code here. How are you shure that the
> suggestion of your tool is correct? Can your tool handle code which
> interacts with flat mamory without any memory management?
Irrelevant.
> And last but not least how is UBI_FM_MAX_BLOCKS configured?
It's fixed in the header at 32. There is no configuration for it.
>
> Regards
> Benedikt Spranger
More information about the U-Boot
mailing list