
On Mon, Aug 20, 2018 at 02:00:24AM +0200, Eugeniu Rosca wrote:
While certain classes of bugs (e.g. locking related) are totally irrelevant for U-Boot, undefined behavior is something U-Boot may experience all over the place and this certainly can lead to hidden and difficult to debug issues.
As of v4.18, Linux kernel contains roughly 119 UBSAN fixes [1]. Hence the sanity checker has been quite a productive and useful tool to play with during development.
Thanks to UBSAN, this series proposes 7 (+1 in [2]) UB fixes, revealed by a simple cold boot of sandbox and arm64 R-Car Gen3 U-Boot. There could be more issues in arch/platform/board-specific code, whose reproduction needs specific hardware.
A certain class of UBs [3] is reported regularly at runtime and looks to be related to the implementation of U-Boot linker-generated arrays. I believe some feedback from the authors/maintainers of those is required to assess if this is a UBSAN false positive or a real bug.
This series collects the low-hanging fruit and leaves others to experiment with UBSAN themselves.
Thanks for doing this, and I am totally behind the idea. Further, given the QEMU-based setups we have available it could be interesting to run some of them those as well (and further the list of places this could be run on). That said, I have some specific patch feedback to follow.