iOS Kernel Heap Armageddon - Hakim

iOS Kernel Heap Armageddon - Hakim iOS Kernel Heap Armageddon - Hakim

28.11.2014 Views

Heap Feng Shui / Heap Massage / ... • allocate repeatedly ✔ • allocate arbitrary sized memory blocks ✔ • poke allocation holes in specific positions • control the memory layout • fill memory with interesting meta / application data ✔ Stefan Esser • iOS Kernel Heap Armageddon REVISITED • July 2012 • 94

Poking Holes into Allocated Data • deallocation of arbitrary sized memory is possible with • reusing the same dictionary key will delete the previously inserted value • in this example the middle value ZZZ...ZZZ is freed AAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBB AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA CCCC ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ DDDD AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA EEEE AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA CCCC Stefan Esser • iOS Kernel Heap Armageddon REVISITED • July 2012 • 95

<strong>Heap</strong> Feng Shui / <strong>Heap</strong> Massage / ...<br />

• allocate repeatedly ✔<br />

• allocate arbitrary sized memory blocks ✔<br />

• poke allocation holes in specific positions<br />

• control the memory layout<br />

• fill memory with interesting meta / application data ✔<br />

Stefan Esser • <strong>iOS</strong> <strong>Kernel</strong> <strong>Heap</strong> <strong>Armageddon</strong> REVISITED • July 2012 •<br />

94

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!