Repository navigation
Commit 7ff7d12
committed
[JSC]
https://bugs.webkit.org/show_bug.cgi?id=319215
Reviewed by Yusuke Suzuki.
A sane pointer to a T must be aligned like a T. Add a typed overload that
checks this on top of the existing canonical-address check. The void*
overload keeps its old behavior for callers probing arbitrary addresses
(e.g. the disassembler); all typed call sites pick up the stricter check
without change.
This catches the value seen in a real crash: a concurrent DFG thread read
HeapCell::zap() residue (0x21700000002) out of a freshly reused JSString and
dereferenced it as a StringImpl*, because it passed every existing check in
speculationFromCell() (oven-sh#285). The
reordering race itself is fixed in bug 319213; this hardens the checks that
bug 216638 added as a mitigation for bad pointers from profiling data.
* Source/JavaScriptCore/tools/Integrity.h:
(JSC::Integrity::isSanePointer):
Canonical link: https://commits.webkit.org/317118@mainIntegrity::isSanePointer() should check alignment for typed pointers1 parent 904ba51 commit 7ff7d12
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
118 | 124 | | |
119 | 125 | | |
120 | 126 | | |
| |||
0 commit comments