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

Issue 2359803002: Thread safe initialization of OSCrypt cache (Closed)

Created:
4 years, 3 months ago by cfroussios
Modified:
4 years, 2 months ago
Reviewers:
Lei Zhang
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Thread safe initialization of OSCrypt cache Clients of OSCrypt run in multiple threads. This creates a race condition for the lazy initialization of OSCrypt, which currently isn't thread safe. Additionally, when a synchronous call to libsecret blocks waiting for user permission, parallel calls to it do not block on the same prompt. Rather, they fail. This means that, while the first caller will correctly identify that encryption should be used, subsequent callers will behave as if full encryption is not available, until the first caller gets permission and properly initialises OSCrypt. Fixing thread safety should fix reported cases of data loss. BUG=631171 Committed: https://crrev.com/fc6f304827896fb27397fc2a27f9f5717eff319c Cr-Commit-Position: refs/heads/master@{#421097}

Patch Set 1 #

Patch Set 2 : removed unrelated code #

Patch Set 3 : thread safety for both passwords #

Patch Set 4 : fixed refactoring #

Total comments: 2

Patch Set 5 : Added tests #

Patch Set 6 : Call encryption and decryption #

Patch Set 7 : removed commited log file #

Patch Set 8 : Test all platforms #

Patch Set 9 : lint #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -7 lines) Patch
M components/os_crypt/os_crypt.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M components/os_crypt/os_crypt_linux.cc View 1 2 3 4 5 6 7 4 chunks +16 lines, -6 lines 0 comments Download
M components/os_crypt/os_crypt_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +55 lines, -0 lines 0 comments Download

Messages

Total messages: 48 (36 generated)
cfroussios
Hi! Can you review this bug fix? Thanks!
4 years, 3 months ago (2016-09-21 15:14:37 UTC) #12
Lei Zhang
Let's add unit tests to exercise this code from multiple threads. Then we can run ...
4 years, 3 months ago (2016-09-21 19:04:56 UTC) #15
Lei Zhang
BTW, what's the current call stack from OSCrypt clients? Do they go through OSCrypt::{En,De}cryptString()? Should ...
4 years, 3 months ago (2016-09-21 19:10:35 UTC) #16
cfroussios
I added some tests. TSan would not accept the current pattern (reading the initialization condition ...
4 years, 3 months ago (2016-09-22 18:04:53 UTC) #22
Lei Zhang
lgtm On 2016/09/22 18:04:53, cfroussios wrote: > I added some tests. TSan would not accept ...
4 years, 2 months ago (2016-09-24 01:30:35 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2359803002/160001
4 years, 2 months ago (2016-09-26 10:48:15 UTC) #36
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/286039)
4 years, 2 months ago (2016-09-26 11:59:11 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2359803002/160001
4 years, 2 months ago (2016-09-26 18:13:12 UTC) #40
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/148323)
4 years, 2 months ago (2016-09-26 21:06:04 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2359803002/160001
4 years, 2 months ago (2016-09-27 02:40:13 UTC) #44
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 2 months ago (2016-09-27 04:11:38 UTC) #46
commit-bot: I haz the power
4 years, 2 months ago (2016-09-27 04:14:01 UTC) #48
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/fc6f304827896fb27397fc2a27f9f5717eff319c
Cr-Commit-Position: refs/heads/master@{#421097}

Powered by Google App Engine
This is Rietveld 408576698