Changeset c4267b1 in rtems for cpukit/dtc/libfdt/fdt_sw.c

Timestamp:
04/10/18 07:06:18 (6 years ago)
Author:
David Gibson <david@…>
Branches:
5, master
Children:
8073f95e
Parents:
85d1769
git-author:
David Gibson <david@…> (04/10/18 07:06:18)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/19/18 05:01:11)
Message:

libfdt: Improve sequential write state checking

When creating a tree with the sequential write functions, certain things
have to be done in a certain order. You must create the memory reserve map
and only then can you create the actual tree structure.

The -FDT_ERR_BADSTATE return code is for if you try to do things out of
order. However, we weren't checking that very thoroughly, so it was
possible to generate a corrupted blob if, for example, you started calling
fdt_begin_node() etc. before calling fdt_finish_reservemap().

This makes the state checking more thorough disallow that.

Signed-off-by: David Gibson <david@…>
Tested-by: Alexey Kardashevskiy <aik@…>
Reviewed-by: Alexey Kardashevskiy <aik@…>
Reviewed-by: Simon Glass <sjg@…>

(No files)

Note: See TracChangeset for help on using the changeset viewer.