Harden dumpDebugLoc against malformed .debug_loc sections
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start in dumpDebugLoc in third_party/llvm-project/dwarf2yaml.cpp, where the exit(1) on a null list sits, and read parseOneLocationList to see how entry.Loc is sized before the copy. Check how the address size is taken from the first CU. Done means a malformed list prints a warning and skips the rest of the section instead of exiting, the entry.Loc length is bounded, and a debug-build assert covers the shared address size. The issue does not give the length limit, so that needs a maintainer decision.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Background:
#6879 was a SIGSEGV in dumpDebugLoc for modules with empty .debug_loc
sections. Fixed by #7910 with a null-CU guard. While reviewing that fix,
three defensive improvements to the same function became apparent. None
is a regression, but each turns a malformed-input case into a hard
failure when it could fail gracefully.
Location: third_party/llvm-project/dwarf2yaml.cpp, dumpDebugLoc.
-
exit(1)on parse failure.if (!list) { errs() << "debug_loc error\n"; exit(1); }A single malformed location list aborts the entire
wasm-optrun. A
warning plus break (skip the rest of the section) would let the tool
finish processing the module with incomplete debug info, which is
the behavior for every other diagnostic in wasm-opt. -
Unbounded copy of location expression bytes.
entry.Locis read from the section byparseOneLocationList. There is
no upper bound on its length before the copy intoloc.Location. A
malformed length field causes unbounded allocation. -
Address-size heuristic.
The comment "should be ok since they all have the same address size?"
is a heuristic. All CUs in well-formed modules share the same
AddrSize, so reading it from the first CU is safe in practice, but
the assumption is not enforced.
Proposed changes:
- Replace
exit(1)with a warning and break. - Add a length sanity check before copying
entry.Loc. - Promote the
address-sizecomment from a question to an explicit
assumption with a debug-build assert.
Refs #6879, #7910.
- Lingua principale
- WebAssembly
- Stelle
- 8.7k
- Fork
- 895
- Merge medio
- 1g 22h
- PR unite (30g)
- 97
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di WebAssembly/binaryen
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
WebAssembly/binaryen#9135 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 76/100
WebAssembly/binaryen#9018 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
WebAssembly/binaryen#9246 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Memory64Lowering: table.get/table.set keep i64 index on lowered table64, output fails validationAperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 66/100
WebAssembly/binaryen#9245 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
WebAssembly/binaryen#9244 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di WebAssembly/binaryen
Issue simili
-
flang:semantics
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
llvm/llvm-project#231051 ·
I maintainer di solito rispondono entro 1 giorno
-
bug derived types format I/O medium priority semantics
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
webgpu-tools/wesl-rs#329 ·
I maintainer di solito rispondono entro 1 giorno
-
compiler/runtime
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
golang/go#82141 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno