Page MenuHomeFreeBSD

stand/fdt: don't send clobbered FDT to the kernel
ClosedPublic

Authored by kevans on Dec 31 2017, 6:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 22, 7:57 PM
Unknown Object (File)
Fri, Mar 22, 7:57 PM
Unknown Object (File)
Fri, Mar 22, 7:57 PM
Unknown Object (File)
Fri, Mar 22, 7:57 PM
Unknown Object (File)
Mar 9 2024, 1:23 PM
Unknown Object (File)
Jan 9 2024, 11:54 AM
Unknown Object (File)
Jan 3 2024, 9:53 PM
Unknown Object (File)
Jan 3 2024, 9:53 PM
Subscribers

Details

Summary

If fdt_overlay_apply fails at some stage to apply the overlay to the base, both the base and overlay may be in an inconsistent state (some fixups applied, some phandles adjusted, some symbols merged). These can be bad for a number of reasons, to include user frustration if some fixups applied and not others. Fail a life safer by making a clean copy of the base FDT for every overlay that we can simply discard if things go awry.

This also allows us the luxury of simply discarding overlays if we hit some kind of memory limit or if they're malformed and extremely large for some reason. We'll now leave a nice error message indicating that some overlays could not be applied due to size restrictions and we apply what we can.

I note that our overlay implementation has some flaws that might still leave your system in an unbootable state even if an overlay applies correctly; please exercise caution in using overlays until we can swap it out for libfdt's implementation.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 13986

Event Timeline

Tested on a clean -HEAD now; corrected an inverted check (== 0 vs. != 0)

This revision was not accepted when it landed; it landed in state Needs Review.Jan 15 2018, 5:00 AM
This revision was automatically updated to reflect the committed changes.