Data races in cryptohomed |
||
Issue descriptionCryptohomed uses multiple threads, but fails to properly synchronize access to data. TSAN report from an invocation of cryptohomed --noclose --direncryption --auto_initialize_tpm, followed by logging in via Chrome is attached. We should figure out how we should fix cryptohomed's wild west threading behavior. Not really urgent though given that there aren't any documented cases of failures caused by this that I'm aware of.
,
Nov 26
The two data race reports from the log file for convenience:
==================
WARNING: ThreadSanitizer: data race (pid=25813)
Write of size 1 at 0x7b28000003a1 by thread T3:
#0 0x555555762777 in cryptohome::TpmPersistentState::SetReady(bool) /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_persistent_state.cc:148:14
#1 0x555555760b23 in cryptohome::TpmInit::TakeOwnership(bool*) /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_init.cc:311:25
#2 0x55555575fc1d in cryptohome::TpmInit::ThreadMain() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_init.cc:154:27
#3 0x555555761ad8 in cryptohome::TpmInitTask::ThreadMain() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_init.cc:56:14
#4 0x7ffff7935d49 in base::(anonymous namespace)::ThreadFunc(void*) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/platform_thread_posix.cc:70:13
#5 0x5555555b0e23 in __cxa_guard_abort ??:?
#6 0x5555555b0e23 in ?? ??:0
Previous read of size 1 at 0x7b28000003a1 by thread T2:
#0 0x555555762681 in cryptohome::TpmPersistentState::IsReady() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_persistent_state.cc:141:10
#1 0x55555575f942 in cryptohome::TpmInit::IsTpmReady() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_init.cc:115:33
#2 0x555555633055 in cryptohome::Service::ResetDictionaryAttackMitigation() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/service.cc:2854:46
#3 0x555555632fdf in cryptohome::Service::DoAutoCleanup() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/service.cc:2794:3
#4 0x55555563a023 in void base::internal::RunnableAdapter<void (cryptohome::Service::*)()>::Run<cryptohome::Service*>(cryptohome::Service*&&) /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../usr/include/base-395517/base/bind_internal.h:186:12
#5 0x55555563a023 in void base::internal::InvokeHelper<false, void, base::internal::RunnableAdapter<void (cryptohome::Service::*)()> >::MakeItSo<cryptohome::Service*>(base::internal::RunnableAdapter<void (cryptohome::Service::*)()>, cryptohome::Service*&&) /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../usr/include/base-395517/base/bind_internal.h:311:0
#6 0x55555563a023 in base::internal::Invoker<base::IndexSequence<0ul>, base::internal::BindState<base::internal::RunnableAdapter<void (cryptohome::Service::*)()>, void (cryptohome::Service*), base::internal::UnretainedWrapper<cryptohome::Service> >, base::internal::InvokeHelper<false, void, base::internal::RunnableAdapter<void (cryptohome::Service::*)()> >, void ()>::Run(base::internal::BindStateBase*) /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../usr/include/base-395517/base/bind_internal.h:362:0
#7 0x7ffff787955b in base::Callback<void (), (base::internal::CopyMode)1>::Run() const /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/./base/callback.h:397:12
#8 0x7ffff787955b in base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask const&) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/debug/task_annotator.cc:51:0
#9 0x7ffff78b4010 in base::MessageLoop::RunTask(base::PendingTask const&) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/message_loop/message_loop.cc:478:19
#10 0x7ffff78b43ee in base::MessageLoop::DeferOrRunPendingTask(base::PendingTask const&) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/message_loop/message_loop.cc:487:5
#11 0x7ffff78b4a33 in base::MessageLoop::DoWork() /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/message_loop/message_loop.cc:604:13
#12 0x7ffff78b9fd3 in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/message_loop/message_pump_default.cc:33:31
#13 0x7ffff78b39bf in base::MessageLoop::RunHandler() /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/message_loop/message_loop.cc:442:10
#14 0x7ffff78f80c8 in base::RunLoop::Run() /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/run_loop.cc:35:10
#15 0x7ffff78b265c in base::MessageLoop::Run() /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/message_loop/message_loop.cc:294:12
#16 0x7ffff79431ba in base::Thread::Run(base::MessageLoop*) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/thread.cc:201:17
#17 0x7ffff794359b in base::Thread::ThreadMain() /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/thread.cc:252:3
#18 0x7ffff7935d49 in base::(anonymous namespace)::ThreadFunc(void*) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/platform_thread_posix.cc:70:13
#19 0x5555555b0e23 in __cxa_guard_abort ??:?
#20 0x5555555b0e23 in ?? ??:0
Location is heap block of size 152 at 0x7b2800000320 allocated by main thread:
#0 0x55555561aeae in operator new(unsigned long) ??:0:0
#1 0x55555562142e in cryptohome::Service::Initialize() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/service.cc:505:29
#2 0x55555561be3d in main /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/cryptohomed.cc:82:17
#3 0x7ffff66d3a94 in __libc_start_main /var/tmp/portage/cross-x86_64-cros-linux-gnu/glibc-2.27-r6/work/glibc-2.27/csu/../csu/libc-start.c:308:0
Thread T3 (tid=25822, running) created by main thread at:
#0 0x5555555b0ea6 in pthread_create ??:0:0
#1 0x7ffff79357e7 in base::(anonymous namespace)::CreateThread(unsigned long, bool, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/platform_thread_posix.cc:109:13
#2 0x7ffff79356a6 in base::PlatformThread::CreateWithPriority(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/platform_thread_posix.cc:190:10
#3 0x55555575f7fd in base::PlatformThread::Create(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*) /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../usr/include/base-395517/base/threading/platform_thread.h:163:12
#4 0x55555575f7fd in cryptohome::TpmInit::AsyncTakeOwnership() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_init.cc:103:0
#5 0x555555621c83 in cryptohome::Service::Initialize() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/service.cc:654:18
#6 0x55555561be3d in main /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/cryptohomed.cc:82:17
#7 0x7ffff66d3a94 in __libc_start_main /var/tmp/portage/cross-x86_64-cros-linux-gnu/glibc-2.27-r6/work/glibc-2.27/csu/../csu/libc-start.c:308:0
Thread T2 'MountThread' (tid=25820, running) created by main thread at:
#0 0x5555555b0ea6 in pthread_create ??:0:0
#1 0x7ffff79357e7 in base::(anonymous namespace)::CreateThread(unsigned long, bool, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/platform_thread_posix.cc:109:13
#2 0x7ffff79356a6 in base::PlatformThread::CreateWithPriority(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/platform_thread_posix.cc:190:10
#3 0x7ffff7942b72 in base::Thread::StartWithOptions(base::Thread::Options const&) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/thread.cc:115:10
#4 0x7ffff7942915 in base::Thread::Start() /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/thread.cc:85:10
#5 0x555555621acc in cryptohome::Service::Initialize() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/service.cc:640:17
#6 0x55555561be3d in main /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/cryptohomed.cc:82:17
#7 0x7ffff66d3a94 in __libc_start_main /var/tmp/portage/cross-x86_64-cros-linux-gnu/glibc-2.27-r6/work/glibc-2.27/csu/../csu/libc-start.c:308:0
SUMMARY: ThreadSanitizer: data race (/usr/sbin/cryptohomed+0x20e776)
==================
==================
WARNING: ThreadSanitizer: data race (pid=25813)
Write of size 1 at 0x7b28000002f2 by thread T3:
#0 0x55555577a0cf in cryptohome::TpmImpl::SetIsBeingOwned(bool) /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_impl.h:55:63
#1 0x55555575fad4 in cryptohome::TpmInit::SetTpmBeingOwned(bool) /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_init.cc:135:30
#2 0x555555760b41 in cryptohome::TpmInit::TakeOwnership(bool*) /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_init.cc:314:3
#3 0x55555575fc1d in cryptohome::TpmInit::ThreadMain() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_init.cc:154:27
#4 0x555555761ad8 in cryptohome::TpmInitTask::ThreadMain() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_init.cc:56:14
#5 0x7ffff7935d49 in base::(anonymous namespace)::ThreadFunc(void*) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/platform_thread_posix.cc:70:13
#6 0x5555555b0e23 in __cxa_guard_abort ??:?
#7 0x5555555b0e23 in ?? ??:0
Previous read of size 1 at 0x7b28000002f2 by thread T2:
#0 0x55555577a09b in cryptohome::TpmImpl::IsBeingOwned() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_impl.h:54:41
#1 0x55555575f91e in cryptohome::TpmInit::IsTpmReady() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_init.cc:114:39
#2 0x555555633055 in cryptohome::Service::ResetDictionaryAttackMitigation() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/service.cc:2854:46
#3 0x555555632fdf in cryptohome::Service::DoAutoCleanup() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/service.cc:2794:3
#4 0x55555563a023 in void base::internal::RunnableAdapter<void (cryptohome::Service::*)()>::Run<cryptohome::Service*>(cryptohome::Service*&&) /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../usr/include/base-395517/base/bind_internal.h:186:12
#5 0x55555563a023 in void base::internal::InvokeHelper<false, void, base::internal::RunnableAdapter<void (cryptohome::Service::*)()> >::MakeItSo<cryptohome::Service*>(base::internal::RunnableAdapter<void (cryptohome::Service::*)()>, cryptohome::Service*&&) /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../usr/include/base-395517/base/bind_internal.h:311:0
#6 0x55555563a023 in base::internal::Invoker<base::IndexSequence<0ul>, base::internal::BindState<base::internal::RunnableAdapter<void (cryptohome::Service::*)()>, void (cryptohome::Service*), base::internal::UnretainedWrapper<cryptohome::Service> >, base::internal::InvokeHelper<false, void, base::internal::RunnableAdapter<void (cryptohome::Service::*)()> >, void ()>::Run(base::internal::BindStateBase*) /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../usr/include/base-395517/base/bind_internal.h:362:0
#7 0x7ffff787955b in base::Callback<void (), (base::internal::CopyMode)1>::Run() const /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/./base/callback.h:397:12
#8 0x7ffff787955b in base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask const&) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/debug/task_annotator.cc:51:0
#9 0x7ffff78b4010 in base::MessageLoop::RunTask(base::PendingTask const&) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/message_loop/message_loop.cc:478:19
#10 0x7ffff78b43ee in base::MessageLoop::DeferOrRunPendingTask(base::PendingTask const&) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/message_loop/message_loop.cc:487:5
#11 0x7ffff78b4a33 in base::MessageLoop::DoWork() /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/message_loop/message_loop.cc:604:13
#12 0x7ffff78b9fd3 in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/message_loop/message_pump_default.cc:33:31
#13 0x7ffff78b39bf in base::MessageLoop::RunHandler() /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/message_loop/message_loop.cc:442:10
#14 0x7ffff78f80c8 in base::RunLoop::Run() /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/run_loop.cc:35:10
#15 0x7ffff78b265c in base::MessageLoop::Run() /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/message_loop/message_loop.cc:294:12
#16 0x7ffff79431ba in base::Thread::Run(base::MessageLoop*) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/thread.cc:201:17
#17 0x7ffff794359b in base::Thread::ThreadMain() /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/thread.cc:252:3
#18 0x7ffff7935d49 in base::(anonymous namespace)::ThreadFunc(void*) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/platform_thread_posix.cc:70:13
#19 0x5555555b0e23 in __cxa_guard_abort ??:?
#20 0x5555555b0e23 in ?? ??:0
Location is heap block of size 160 at 0x7b2800000280 allocated by main thread:
#0 0x55555561aeae in operator new(unsigned long) ??:0:0
#1 0x55555575f387 in cryptohome::Tpm::GetSingleton() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm.cc:86:18
#2 0x5555556213da in cryptohome::Service::Initialize() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/service.cc:502:12
#3 0x55555561be3d in main /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/cryptohomed.cc:82:17
#4 0x7ffff66d3a94 in __libc_start_main /var/tmp/portage/cross-x86_64-cros-linux-gnu/glibc-2.27-r6/work/glibc-2.27/csu/../csu/libc-start.c:308:0
Thread T3 (tid=25822, running) created by main thread at:
#0 0x5555555b0ea6 in pthread_create ??:0:0
#1 0x7ffff79357e7 in base::(anonymous namespace)::CreateThread(unsigned long, bool, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/platform_thread_posix.cc:109:13
#2 0x7ffff79356a6 in base::PlatformThread::CreateWithPriority(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/platform_thread_posix.cc:190:10
#3 0x55555575f7fd in base::PlatformThread::Create(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*) /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../usr/include/base-395517/base/threading/platform_thread.h:163:12
#4 0x55555575f7fd in cryptohome::TpmInit::AsyncTakeOwnership() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/tpm_init.cc:103:0
#5 0x555555621c83 in cryptohome::Service::Initialize() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/service.cc:654:18
#6 0x55555561be3d in main /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/cryptohomed.cc:82:17
#7 0x7ffff66d3a94 in __libc_start_main /var/tmp/portage/cross-x86_64-cros-linux-gnu/glibc-2.27-r6/work/glibc-2.27/csu/../csu/libc-start.c:308:0
Thread T2 'MountThread' (tid=25820, running) created by main thread at:
#0 0x5555555b0ea6 in pthread_create ??:0:0
#1 0x7ffff79357e7 in base::(anonymous namespace)::CreateThread(unsigned long, bool, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/platform_thread_posix.cc:109:13
#2 0x7ffff79356a6 in base::PlatformThread::CreateWithPriority(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/platform_thread_posix.cc:190:10
#3 0x7ffff7942b72 in base::Thread::StartWithOptions(base::Thread::Options const&) /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/thread.cc:115:10
#4 0x7ffff7942915 in base::Thread::Start() /build/cyan/tmp/portage/chromeos-base/libchrome-395517-r46/work/libchrome-395517/base/threading/thread.cc:85:10
#5 0x555555621acc in cryptohome::Service::Initialize() /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/service.cc:640:17
#6 0x55555561be3d in main /build/cyan/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-9999/work/cryptohome-9999/platform2/cryptohome/cryptohomed.cc:82:17
#7 0x7ffff66d3a94 in __libc_start_main /var/tmp/portage/cross-x86_64-cros-linux-gnu/glibc-2.27-r6/work/glibc-2.27/csu/../csu/libc-start.c:308:0
SUMMARY: ThreadSanitizer: data race (/usr/sbin/cryptohomed+0x2260ce)
==================
,
Nov 26
,
Nov 26
--auto_initialize_tpm is not used on chromebooks (but used on other devices with Chrome OS), though unclear if this race exists only in case of auto-initialization. Were there tsan issues when run w/o --auto_initialize_tpm and doing manual cryptohome --action=tpm_take_ownership in parallel with taking ownership?
,
Nov 26
I only used --auto_initialize_tpm to trigger the ownership thread again. 99% sure that the same (and more) races happen when the ownership thread actually takes ownership during normal operation - TpmPersistentState and TpmImpl members are accessed from 3 threads without any synchronization.
,
Dec 4
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/9423ae125b7cca14414ad4092e8c32ebdbfdf204 commit 9423ae125b7cca14414ad4092e8c32ebdbfdf204 Author: Mattias Nissler <mnissler@chromium.org> Date: Tue Dec 04 16:32:16 2018 cryptohome: Protect TpmPersistentState data with lock This protects data members in TpmPersistentState with a lock to make it safe to use from multiple threads. Reality is that this object is accessed by multiple threads, and there isn't a clear path towards restricting TPM state tracking to only a single thread as a potential alternative option. BUG=chromium:908393 TEST=tsan no longer reports data races on TpmPeristentState::IsTpmReady() Change-Id: I746afc30b184d9463cd3232c0f0341dffb448205 Reviewed-on: https://chromium-review.googlesource.com/1350969 Commit-Ready: Mattias Nissler <mnissler@chromium.org> Tested-by: Mattias Nissler <mnissler@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org> [modify] https://crrev.com/9423ae125b7cca14414ad4092e8c32ebdbfdf204/cryptohome/tpm_persistent_state.cc [modify] https://crrev.com/9423ae125b7cca14414ad4092e8c32ebdbfdf204/cryptohome/tpm_persistent_state.h |
||
►
Sign in to add a comment |
||
Comment 1 by mnissler@chromium.org
, Nov 2698.6 KB
98.6 KB Download