Skip to content

Commit

Permalink
Bug 1615401 - Part 3: Use OSInfo::Kernel32Version() to select a thunk…
Browse files Browse the repository at this point in the history
… resolver. r=bobowen

Cherry-picking Chromium's commit 01c8afd0dc14a1acef383c5f231258d0cfac95e5
to fix the crash caused by Chromium's sandbox code.

The original bug on Chromium side: https://crbug.com/1053805

Differential Revision: https://phabricator.services.mozilla.com/D65745

Depends on D65802
  • Loading branch information
Toshihito Kikuchi committed Mar 6, 2020
1 parent 866761c commit d992a09
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions security/sandbox/chromium/sandbox/win/src/interception.cc
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,15 @@ ResultCode InterceptionManager::PatchClientFunctions(
thunk.reset(new ServiceResolverThunk(child_->Process(), relaxed_));
#else
base::win::OSInfo* os_info = base::win::OSInfo::GetInstance();
base::win::Version real_os_version = os_info->Kernel32Version();
if (os_info->wow64_status() == base::win::OSInfo::WOW64_ENABLED) {
if (os_info->version() >= base::win::VERSION_WIN10)
if (real_os_version >= base::win::VERSION_WIN10)
thunk.reset(new Wow64W10ResolverThunk(child_->Process(), relaxed_));
else if (os_info->version() >= base::win::VERSION_WIN8)
else if (real_os_version >= base::win::VERSION_WIN8)
thunk.reset(new Wow64W8ResolverThunk(child_->Process(), relaxed_));
else
thunk.reset(new Wow64ResolverThunk(child_->Process(), relaxed_));
} else if (os_info->version() >= base::win::VERSION_WIN8) {
} else if (real_os_version >= base::win::VERSION_WIN8) {
thunk.reset(new Win8ResolverThunk(child_->Process(), relaxed_));
} else {
thunk.reset(new ServiceResolverThunk(child_->Process(), relaxed_));
Expand Down

0 comments on commit d992a09

Please sign in to comment.