1 / 16

DieHarder : Securing the Heap

DieHarder : Securing the Heap. Previously in DieHard … . Increase Reliability by random positioning of data Replicated Execution detects invalid memory accesses Because objects are randomly placed , buffer overflows are likely to hit unused space. Memory Management Errors.

mckile
Download Presentation

DieHarder : Securing the Heap

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DieHarder: Securingthe Heap

  2. Previously in DieHard… • IncreaseReliabilitybyrandompositioningofdata • ReplicatedExecutiondetects invalid memoryaccesses • Becauseobjectsarerandomlyplaced, bufferoverflowsarelikelytohitunusedspace

  3. Memory Management Errors • Heap overflow: • char* f = newchar[10];f[11] = 'x'; • Heap underflow: • stack<int> mystack;mystack.pop();

  4. Memory Management Errors • Danglingpointers: • char*dp = malloc(123);free(dp);dp[10] = 'a'; • Double free: • char *foo = dp;free(dp);free(foo);

  5. Memory Management Errors • Invalid free: • char*dp = malloc(123);free(dp[10]); • Uninitializedread: • char *foo = dp;puts(foo); • All oftheseattackscanbe (andare) exploited!

  6. The Allocator‘s fault? • Freelist-baseallocatorsstoremetadatabetweentheobjects • Attackerscan not onlycorruptstoreddata, but also thefreelist, leadingtoarbitrarycodeexecution • Solution: BiBOP (Big Bagof Pages) Allocatorsstoremetadataseperately • SomeBiBOPsstoremetadataatthebeginningof a page, allowingittobeoverwritten (e.g. PHKmalloc)

  7. OpenBSD‘sallocator • Based on PHKmalloc • Metadataisentirelystored in a different place • Pages arerandomlymmap‘edso thatthereareunmappedguardpages in between • Ifactivated, freedobjectsarescrambled • Objects areplacedrandomly in thepage • Reuse offreedobjectsis not predictable

  8. Comparison

  9. Threats • First, memoryerrorshavetoexist • Toattacksystemsusingrandomizedplacement, theattackhastoberepeatable • The highertheentropy, thelongerittakestoattackspecificmemoryareas • In somecases, theattackerhasmoretriesthan in others (server vs. client)

  10. PreviousCountermeasures • ASLR • Randomized Placement (seeOpenBSD) • Guard Pages • Canaries • W^X / DEP • Noheaders

  11. Analysis ofDieHard • The probabilityofoverwriting a specifictargetis in O(1/N) with N beingthenumberofheapobjects • Much betterthanOpenBSD‘s 4 bitentropy • Because M timesmorespacethanneededisallocated, thereuseentropyis in O(log N) • Betterthan 5.4 in OpenBSD

  12. ChangestoDieHard • Sparse Page Layout allocatedpages all overthepossibleaddressspace • Whilethisdecreasestheallocationperformance, itmeansthattherearemoreguardpages in between • This also increasesthesizeofthepagetable • Trade-Off betweensecurityandperformance

  13. ChangestoDieHard • Byrandomizingreuseandoverwritingdeletedobjects, theattackercannotusethisinformationforhisattacks

  14. Evaluation

  15. Windows 7: Fault-Tolerant Heap • The ideahasbeenusedtobuildthe FTH in Windows 7 • Becauseoftheperformanceimplications, FTH isonlyactivatedforcrashingprograms (bydefault, 3 crashes in 60 minutes) • Thislimitstherepeatabilityofattacksdrasticallyandcanhelptoidentifyand fix problems

  16. Questions?

More Related