Changeset 143811 in webkit


Ignore:
Timestamp:
Feb 22, 2013, 3:37:20 PM (13 years ago)
Author:
jschuh@chromium.org
Message:

RenderArena masking has low entropy
https://bugs.webkit.org/show_bug.cgi?id=110394

Reviewed by Oliver Hunt.

No new tests. This is a hardening measure.

  • rendering/RenderArena.cpp:

(WebCore::RenderArena::RenderArena):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r143809 r143811  
     12013-02-22  Justin Schuh  <jschuh@chromium.org>
     2
     3        RenderArena masking has low entropy
     4        https://bugs.webkit.org/show_bug.cgi?id=110394
     5
     6        Reviewed by Oliver Hunt.
     7
     8        No new tests. This is a hardening measure.
     9
     10        * rendering/RenderArena.cpp:
     11        (WebCore::RenderArena::RenderArena):
     12
    1132013-02-22  Min Qin  <qinmin@chromium.org>
    214
  • trunk/Source/WebCore/rendering/RenderArena.cpp

    r133119 r143811  
    3737#include "RenderArena.h"
    3838
     39#include <limits>
    3940#include <stdlib.h>
    4041#include <string.h>
    4142#include <wtf/Assertions.h>
     43#include <wtf/CryptographicallyRandomNumber.h>
    4244
    4345#define ROUNDUP(x, y) ((((x)+((y)-1))/(y))*(y))
     
    9092    // RenderObject pointer.
    9193    // See http://download.crowdstrike.com/papers/hes-exploiting-a-coalmine.pdf.
    92 
    93     // The bottom bits are predictable because the binary is loaded on a
    94     // boundary. This just shifts most of those predictable bits out.
    95     m_mask = ~(reinterpret_cast<uintptr_t>(WTF::fastMalloc) >> 13);
     94    WTF::cryptographicallyRandomValues(&m_mask, sizeof(m_mask));
     95    m_mask |= (static_cast<uintptr_t>(3) << (std::numeric_limits<uintptr_t>::digits - 2)) | 1;
    9696}
    9797
Note: See TracChangeset for help on using the changeset viewer.