[Lldb-commits] [lldb] [lldb][Mach-O] Fix two fuzzer-found hangs/crashes parsing universal Mach-O fat headers (PR #204471)
Yao Qi via lldb-commits
lldb-commits at lists.llvm.org
Thu Jun 18 01:00:28 PDT 2026
================
@@ -0,0 +1,30 @@
+--- !fat-mach-o
+# Regression fixture: a universal (fat) Mach-O whose header claims
+# nfat_arch = 0xFFFFFFFF while the file holds a single arch slice. The arch
+# loop in ObjectContainerUniversalMachO::ParseHeader used nfat_arch as its
+# bound without checking it against the available data, so this header sent it
+# spinning ~4.29 billion times. "target create" must instead parse the one
+# real slice and return promptly. Found by lldb-target-fuzzer.
+FatHeader:
+ magic: 0xCAFEBABF
----------------
qiyao wrote:
`0xCAFEBABF` is `FAT_MAGIC_64`. It is from the fuzzer's test case which found this bug, and I didn't tweak it for magic `0xCAFEBABE`. In both cases, `nfat_arch` is `uint32_t`, and its value `0xFFFFFFFF` in the test case can trigger the bug.
https://github.com/llvm/llvm-project/pull/204471
More information about the lldb-commits
mailing list