Bug 121307 - [Windows] Activate FastMalloc hardening on Windows
Summary: [Windows] Activate FastMalloc hardening on Windows
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Enhancement
Assignee: Brent Fulgham
Keywords: InRadar
Depends on: 109334
  Show dependency treegraph
Reported: 2013-09-13 10:32 PDT by Brent Fulgham
Modified: 2013-09-13 12:40 PDT (History)
6 users (show)

See Also:

Patch (2.34 KB, patch)
2013-09-13 10:45 PDT, Brent Fulgham
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2013-09-13 10:32:29 PDT
The hardening logic in the FastMalloc implementation works fine on Windows (with a couple of small changes to work around some Visual Studio compiler bugs).

Let's turn it on so that we can have comparable safety to our other ports!
Comment 1 Radar WebKit Bug Importer 2013-09-13 10:34:42 PDT
Comment 2 Brent Fulgham 2013-09-13 10:45:50 PDT
Created attachment 211563 [details]
Comment 3 Oliver Hunt 2013-09-13 10:52:41 PDT
Comment on attachment 211563 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=211563&action=review

r=me with comments

> Source/WTF/wtf/FastMalloc.cpp:110

maybe we can just try !PLATFORM(QT) and see what happens?

> Source/WTF/wtf/FastMalloc.cpp:840
> +    void* tValNext = *(reinterpret_cast<void**>(t.value())); // FIXME: This exists to work around a MSVC bug
> +    return HardenedSLL::create(XOR_MASK_PTR_WITH_KEY(tValNext, t.value(), entropy));
> +#else
>      return HardenedSLL::create(XOR_MASK_PTR_WITH_KEY(*(reinterpret_cast<void**>(t.value())), t.value(), entropy));
> +#endif

Remove the #if MSVC and just always use that path.  It's conceivable that it's a "legitimate" piece of behaviour and it really shouldn't hurt.
Comment 4 Brent Fulgham 2013-09-13 12:40:16 PDT
Committed r155717: <http://trac.webkit.org/changeset/155717>