[all-commits] [llvm/llvm-project] cbf10b: [lld-macho] Avoid infinite recursion when parsing ...

Daniel Rodríguez Troitiño via All-commits all-commits at lists.llvm.org
Fri Aug 29 17:08:56 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cbf10bcbb3f43ec035d6ba9cb2f23d7ea7c34c1f
      https://github.com/llvm/llvm-project/commit/cbf10bcbb3f43ec035d6ba9cb2f23d7ea7c34c1f
  Author: Daniel Rodríguez Troitiño <danielrodriguez at meta.com>
  Date:   2025-08-29 (Fri, 29 Aug 2025)

  Changed paths:
    M lld/MachO/ExportTrie.cpp
    M lld/MachO/ExportTrie.h
    M lld/MachO/InputFiles.cpp
    A lld/test/MachO/invalid/Inputs/macho-trie-node-loop
    A lld/test/MachO/invalid/export-trie-node-loop.s

  Log Message:
  -----------
  [lld-macho] Avoid infinite recursion when parsing corrupted export tries (#152569)

If an export trie is encoded incorrectly, and one of the children
offsets points back to one of the nodes earlier in the serialization,
the current code will end up in an infinite recursion, and eventually
fail exhausting the available memory.

The failure can be avoided if, before recursing, one checks that the
offset is valid, that is, that the offset is beyond the current
position. This is similar to a check done by llvm-objdump which reports
the trie being corrupted.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list