Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Issue 1342303003: Replace calls to rand_s with calls to RtlGenRandom (Closed)

Created:
5 years, 3 months ago by Will Harris
Modified:
5 years, 3 months ago
Reviewers:
jschuh
CC:
chromium-reviews, wfh+watch_chromium.org, rickyz+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace calls to rand_s with calls to RtlGenRandom. Add a test for GetGranularAlignedRandomOffset. This potentially fixes two similar crashes in sandbox::ApplyProcessMitigationsToSuspendedProcess and sandbox::InterceptionManager::PatchNtdll. BUG=379218, 501813 TEST=sbox_unittests Committed: https://crrev.com/f4b1928eaa63736de442317980682bcf1244bd17 Cr-Commit-Position: refs/heads/master@{#349748}

Patch Set 1 #

Patch Set 2 : call directly into RtlGenRandom #

Patch Set 3 : remove unneeded header #

Total comments: 2

Patch Set 4 : fix nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -6 lines) Patch
M sandbox/win/BUILD.gn View 1 1 chunk +2 lines, -0 lines 0 comments Download
M sandbox/win/sandbox_win.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
M sandbox/win/src/interception.cc View 1 3 chunks +10 lines, -5 lines 0 comments Download
M sandbox/win/src/interception_unittest.cc View 3 chunks +47 lines, -0 lines 0 comments Download
M sandbox/win/src/process_mitigations.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
A sandbox/win/src/sandbox_rand.h View 1 1 chunk +17 lines, -0 lines 0 comments Download
A sandbox/win/src/sandbox_rand.cc View 1 2 3 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (3 generated)
Will Harris
PTAL
5 years, 3 months ago (2015-09-16 03:24:39 UTC) #2
Will Harris
The #define that is needed to get to SystemFunction036 messes up other #includes that are ...
5 years, 3 months ago (2015-09-16 16:54:46 UTC) #3
jschuh
Thanks for switching it to RtlGenRandom. lgtm with one nit. https://codereview.chromium.org/1342303003/diff/40001/sandbox/win/src/sandbox_rand.cc File sandbox/win/src/sandbox_rand.cc (right): https://codereview.chromium.org/1342303003/diff/40001/sandbox/win/src/sandbox_rand.cc#newcode20 ...
5 years, 3 months ago (2015-09-17 23:40:18 UTC) #4
Will Harris
thanks for the review https://codereview.chromium.org/1342303003/diff/40001/sandbox/win/src/sandbox_rand.cc File sandbox/win/src/sandbox_rand.cc (right): https://codereview.chromium.org/1342303003/diff/40001/sandbox/win/src/sandbox_rand.cc#newcode20 sandbox/win/src/sandbox_rand.cc:20: RtlGenRandom(random_value, sizeof(unsigned int)) != FALSE; ...
5 years, 3 months ago (2015-09-18 19:08:19 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1342303003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1342303003/60001
5 years, 3 months ago (2015-09-18 19:09:20 UTC) #8
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 3 months ago (2015-09-18 20:02:57 UTC) #9
commit-bot: I haz the power
5 years, 3 months ago (2015-09-18 20:03:42 UTC) #10
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/f4b1928eaa63736de442317980682bcf1244bd17
Cr-Commit-Position: refs/heads/master@{#349748}

Powered by Google App Engine
This is Rietveld 408576698