Skip to content

validate_mem_reservations allow spilling into the next block #117

Description

@m4tx

validate_mem_reservations checks offset >= header.off_dt_struct(), but it does so before including the terminating element. It means that the terminating element can be inside dt_struct.

This is a cosmetic error, really, because such FDT will be rejected anyway because we check whether the first token in dt_struct is FDT_BEGIN_NODE. It would be nice to fix that and return a correct error in such case (FdtErrorKind::MemReserveNotTerminated).

Activity

  1. Daiyuanranfeng commented on Nov 15, 2026

    @Daiyuanranfeng

    I would like to take this issue. I will adjust the memory-reservation boundary validation so the terminating element must remain inside the structure block, and add focused regression coverage for the correct error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions