libfdt: Check that the root-node name is empty
The root node is supposed to have an empty name, but at present this is
not checked. The behaviour of such a tree is not well defined. Most
software rightly assumes that the root node is at offset 0 and does not
check the name. This oddity was discovered as part of a security
investigation into U-Boot verified boot.
Add a check for this to fdt_check_full().
Signed-off-by: Simon Glass <firstname.lastname@example.org>
Reported-by: Arie Haenel <email@example.com>
Reported-by: Julien Lenoir <firstname.lastname@example.org>
Signed-off-by: David Gibson <email@example.com>
6 files changed