New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 869194 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 31
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

CPP_EXCEPTION_e06d7363_chrome_elf.dll!Unknown in 68.0.3440.75

Project Member Reported by wfh@chromium.org, Jul 30

Issue description

Chrome Version: 68.0.3440.75
OS: Windows 10

This is from WER, there are number of crashes on 32-bit in chrome_elf. The stack appears to be:

[f:\dd\vctools\crt\vcruntime\src\eh\throw.cpp @ 131] (02f870e1)   chrome_elf!_CxxThrowException+0x66
[f:\dd\vctools\crt\crtw32\stdcpp\xthrow.cpp @ 18] (02f83b50)   chrome_elf!std::_Xlength_error+0x1f 
(02f51390)   chrome_elf!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Xlen+0xd
[C:\b\c\win_toolchain\vs_files\5454e45bf3764c03d3fc1024b3bf5bc41e3ab62c\VC\Tools\MSVC\14.14.26428\include\vector @ 1994] (02f53f56)   chrome_elf!std::vector<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >,std::allocator<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > > >::_Change_array
[C:\b\c\win_toolchain\vs_files\5454e45bf3764c03d3fc1024b3bf5bc41e3ab62c\VC\Tools\MSVC\14.14.26428\include\xstring @ 2650] (02f53e02)   chrome_elf!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::assign+0x3b 
[C:\b\c\win_toolchain\vs_files\5454e45bf3764c03d3fc1024b3bf5bc41e3ab62c\VC\Tools\MSVC\14.14.26428\include\vector @ 1010] (02f5654e)   chrome_elf!std::vector<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >,std::allocator<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > > >::_Emplace_reallocate<const wchar_t *&,int &>+0xcd
[C:\b\c\win_toolchain\vs_files\5454e45bf3764c03d3fc1024b3bf5bc41e3ab62c\VC\Tools\MSVC\14.14.26428\include\vector @ 1010] (02f5654e)   chrome_elf!std::vector<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >,std::allocator<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > > >::_Emplace_reallocate<const wchar_t *&,int &>+0xcd
[C:\b\c\b\win_clang\src\chrome\install_static\install_util.cc @ 736] (02f55bf0)   chrome_elf!install_static::TokenizeCommandLineToArray+0x7d
[C:\b\c\b\win_clang\src\chrome\install_static\install_util.cc @ 807] (02f55069)   chrome_elf!install_static::GetSwitchValueFromCommandLine+0x26
[C:\b\c\b\win_clang\src\chrome\install_static\install_util.cc @ 521] (02f54fc8)   chrome_elf!install_static::InitializeProcessType+0x6b
[C:\b\c\b\win_clang\src\chrome_elf\chrome_elf_main.cc @ 60] (02f510a2)   chrome_elf!DllMain+0x4f
[f:\dd\vctools\crt\vcstartup\src\startup\dll_dllmain.cpp @ 200] (02f86924)   chrome_elf!dllmain_dispatch+0x86
[f:\dd\vctools\crt\vcstartup\src\startup\dll_dllmain.cpp @ 253] (02f86a5a)   chrome_elf!_DllMainCRTStartup+0x1c

There is no way to get any additional data from WER.

Is the access on this line guaranteed to be safe?

https://chromium.googlesource.com/chromium/src/+/68.0.3440.25/chrome/install_static/install_util.cc#736


 
hmm I wrote a fuzzer for GetSwitchValueFromCommandLine in https://chromium-review.googlesource.com/c/chromium/src/+/1155941 and it finds a lot of crashes.

even when setting second param (which should be controlled by Chrome) to something fixed like "--no-sandbox" it still crashes.

Seems to crash on the same emplace_back.
Cc: grt@chromium.org
Owner: wfh@chromium.org
Status: Started (was: Untriaged)
A fix is up at https://chromium-review.googlesource.com/c/chromium/src/+/1155991.

With this fix in place I reach *almost* 100% of the tested functions on code coverage, there's two lines with no coverage:

http://shortn/_BZGEmNFdea
Project Member

Comment 3 by bugdroid1@chromium.org, Jul 31

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b46f6f20da2b5c2bd62eac17e5ff5c253429941a

commit b46f6f20da2b5c2bd62eac17e5ff5c253429941a
Author: Will Harris <wfh@chromium.org>
Date: Tue Jul 31 19:30:59 2018

Fix crash in TokenizeCommandLineToArray.

Previously, a command line where the first argument had an unterminated
double-quote would cause a crash.

This CL also has some cleanup of dead code.

BUG= 869194 

Change-Id: I20fa0814e35c5d10ab3ad76047c8233297f14a8d
Reviewed-on: https://chromium-review.googlesource.com/1155991
Commit-Queue: Will Harris <wfh@chromium.org>
Reviewed-by: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579526}
[modify] https://crrev.com/b46f6f20da2b5c2bd62eac17e5ff5c253429941a/chrome/install_static/install_util.cc
[modify] https://crrev.com/b46f6f20da2b5c2bd62eac17e5ff5c253429941a/chrome/install_static/install_util_unittest.cc

Status: Fixed (was: Started)
this should be fixed but I'll run the fuzzer overnight locally to make sure.
Labels: Merge-Request-69
This is technically a wild read, although this is likely not exploitable since an attacker would need to control the command line to Chrome. But we could consider merging to M69.
i'd support a merge for stability reasons. the fix includes test coverage (and is fuzzed), so the worst case is that it exposes a different crash later in startup (which we certainly need to discover). do you think that's a legit reason not to merge?
Cc: gov...@chromium.org pam@chromium.org
FWIW (in support of a merge) this is one of the top non-third-party crash in WER (Windows Error Reporting), which is where crashes go when crashpad doesn't catch them. Crashpad isn't catching this because it occurs so early in startup.
Project Member

Comment 8 by sheriffbot@chromium.org, Aug 1

Labels: -Merge-Request-69 Hotlist-Merge-Approved Merge-Approved-69
Your change meets the bar and is auto-approved for M69. Please go ahead and merge the CL to branch 3497 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), kariahda@(iOS), cindyb@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 9 by bugdroid1@chromium.org, Aug 2

Labels: -merge-approved-69 merge-merged-3497
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8b5d28848fc62ecd1c3d04e4db6b604fe2a05a4a

commit 8b5d28848fc62ecd1c3d04e4db6b604fe2a05a4a
Author: Will Harris <wfh@chromium.org>
Date: Thu Aug 02 22:12:06 2018

Merge M69: Fix crash in TokenizeCommandLineToArray.

Previously, a command line where the first argument had an unterminated
double-quote would cause a crash.

This CL also has some cleanup of dead code.

BUG= 869194 

(cherry picked from commit b46f6f20da2b5c2bd62eac17e5ff5c253429941a)

Change-Id: I20fa0814e35c5d10ab3ad76047c8233297f14a8d
Reviewed-on: https://chromium-review.googlesource.com/1155991
Commit-Queue: Will Harris <wfh@chromium.org>
Reviewed-by: Greg Thompson <grt@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#579526}
Reviewed-on: https://chromium-review.googlesource.com/1161384
Reviewed-by: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/branch-heads/3497@{#357}
Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
[modify] https://crrev.com/8b5d28848fc62ecd1c3d04e4db6b604fe2a05a4a/chrome/install_static/install_util.cc
[modify] https://crrev.com/8b5d28848fc62ecd1c3d04e4db6b604fe2a05a4a/chrome/install_static/install_util_unittest.cc

:( Thanks Will.

Sign in to add a comment