Closed
Bug 2046252
Opened 5 months ago
Closed 5 months ago
AddressSanitizer: heap-use-after-free [@ nsTArray_base<nsTArray_RelocateUsingMemutils>::Length] with READ of size 4
Categories
(Core :: Networking: Cookies, defect)
Core
Networking: Cookies
Tracking
()
RESOLVED
FIXED
153 Branch
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr140 | --- | unaffected |
| firefox151 | --- | unaffected |
| firefox152 | --- | unaffected |
| firefox153 | + | fixed |
People
(Reporter: tsmith, Assigned: jesup, NeedInfo)
References
(Blocks 1 open bug, )
Details
(Keywords: csectype-uaf, regression, sec-high)
Found with m-c 20260609-743f926f9fc5 (--enable-address-sanitizer)
This was found by visiting a live website with an ASan build.
STR:
- Launch browser and visit site
This issue was triggered by visiting http://coveryourtracks.eff.org/kcarter?aat=1.
==4588==ERROR: AddressSanitizer: heap-use-after-free on address 0x119a1f5ded90 at pc 0x7fffe41f999f bp 0x001acf3fa220 sp 0x001acf3fa268
READ of size 4 at 0x119a1f5ded90 thread T0
#0 0x7fffe41f999e in nsTArray_base<nsTArray_RelocateUsingMemutils>::Length /builds/worker/workspace/obj-build/dist/include/nsTArray.h:365
#1 0x7fffe41f999e in nsTArray_Impl<RefPtr<mozilla::net::Cookie>,nsTArrayInfallibleAllocator>::ElementAt /builds/worker/workspace/obj-build/dist/include/nsTArray.h:1056
#2 0x7fffe41f999e in nsTArray_Impl<RefPtr<mozilla::net::Cookie>,nsTArrayInfallibleAllocator>::operator[] /builds/worker/workspace/obj-build/dist/include/nsTArray.h:1104
#3 0x7fffe41f999e in mozilla::net::CookieStorage::CookieListIter::Cookie /builds/worker/workspace/obj-build/netwerk/cookie/./../../../../checkouts/gecko/netwerk/cookie/CookieStorage.h:175
#4 0x7fffe41f999e in mozilla::net::CookieStorage::AddCookie(class mozilla::net::CookieParser *, class nsTSubstring<char> const &, class mozilla::OriginAttributes const &, class mozilla::net::Cookie *, __int64, class nsIURI *, class nsTSubstring<char> const &, bool, bool, class mozilla::dom::BrowsingContext *, struct nsID const *) /builds/worker/workspace/obj-build/netwerk/cookie/./../../../../checkouts/gecko/netwerk/cookie/CookieStorage.cpp:980
#5 0x7fffe4204d55 in mozilla::net::CookieService::SetCookieStringFromHttp(class nsIURI *, class nsTSubstring<char> const &, class nsIChannel *) /builds/worker/workspace/obj-build/netwerk/cookie/./../../../../checkouts/gecko/netwerk/cookie/CookieService.cpp:652
#6 0x7fffe4a967e8 in mozilla::net::HttpBaseChannel::SetCookieHeaders(class nsTArray<class nsTString<char>> const &) /builds/worker/workspace/obj-build/netwerk/protocol/http/./../../../../../checkouts/gecko/netwerk/protocol/http/HttpBaseChannel.cpp:3774
#7 0x7fffe4c3d5d6 in mozilla::net::nsHttpChannel::ContinueProcessResponse1(class mozilla::net::nsHttpConnectionInfo *) /builds/worker/workspace/obj-build/netwerk/protocol/http/./../../../../../checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:3200
#8 0x7fffe4c3cbf7 in mozilla::net::nsHttpChannel::ProcessResponse(class mozilla::net::nsHttpConnectionInfo *) /builds/worker/workspace/obj-build/netwerk/protocol/http/./../../../../../checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:3138
#9 0x7fffe4c83a00 in mozilla::net::nsHttpChannel::OnStartRequest(class nsIRequest *) /builds/worker/workspace/obj-build/netwerk/protocol/http/./../../../../../checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:9251
#10 0x7fffe40725f8 in nsInputStreamPump::OnStateStart(void) /builds/worker/workspace/obj-build/netwerk/base/./../../../../checkouts/gecko/netwerk/base/nsInputStreamPump.cpp:533
#11 0x7fffe4071985 in nsInputStreamPump::OnInputStreamReady(class nsIAsyncInputStream *) /builds/worker/workspace/obj-build/netwerk/base/./../../../../checkouts/gecko/netwerk/base/nsInputStreamPump.cpp:435
#12 0x7fffe548a7de in std::_Func_class<void>::operator() /builds/worker/fetches/vs/VC/Tools/MSVC/14.50.35717/include/functional:930
#13 0x7fffe548a7de in PipeCallbackRunnable::Run(void) /builds/worker/workspace/obj-build/xpcom/io/./../../../../checkouts/gecko/xpcom/io/nsPipe3.cpp:74
#14 0x7fffe551d88e in mozilla::RunnableTask::Run(void) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:719
#15 0x7fffe54f6c42 in mozilla::TaskController::RunTask(class mozilla::Task *) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:210
#16 0x7fffe550133f in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(class mozilla::detail::BaseAutoLock<class mozilla::Mutex &> const &) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:1358
#17 0x7fffe54fdc78 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(class mozilla::detail::BaseAutoLock<class mozilla::Mutex &> const &) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:1181
#18 0x7fffe54fe574 in mozilla::TaskController::ProcessPendingMTTask(bool) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:655
#19 0x7fffe551b6b1 in mozilla::TaskController::TaskController::<lambda_5>::operator() /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:350
#20 0x7fffe551b6b1 in mozilla::detail::RunnableFunction<`lambda at .\..\..\..\..\checkouts\gecko\xpcom\threads\TaskController.cpp:350:7'>::Run /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/nsThreadUtils.h:536
#21 0x7fffe5546ee7 in nsThread::ProcessNextEvent(bool, bool *) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/nsThread.cpp:1179
#22 0x7fffe5554161 in NS_ProcessNextEvent(class nsIThread *, bool) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:472
#23 0x7fffe57688d0 in mozilla::ipc::MessagePump::Run(class base::MessagePump::Delegate *) /builds/worker/workspace/obj-build/ipc/glue/./../../../../checkouts/gecko/ipc/glue/MessagePump.cpp:105
#24 0x7fffe5680153 in MessageLoop::RunInternal /builds/worker/workspace/obj-build/ipc/chromium/./../../../../checkouts/gecko/ipc/chromium/src/base/message_loop.cc:371
#25 0x7fffe5680153 in MessageLoop::RunHandler(void) /builds/worker/workspace/obj-build/ipc/chromium/./../../../../checkouts/gecko/ipc/chromium/src/base/message_loop.cc:364
#26 0x7fffe567ff73 in MessageLoop::Run(void) /builds/worker/workspace/obj-build/ipc/chromium/./../../../../checkouts/gecko/ipc/chromium/src/base/message_loop.cc:346
#27 0x7fffefbb3dec in nsBaseAppShell::Run(void) /builds/worker/workspace/obj-build/widget/./../../../checkouts/gecko/widget/nsBaseAppShell.cpp:151
#28 0x7fffefe015aa in nsAppShell::Run(void) /builds/worker/workspace/obj-build/widget/windows/./../../../../checkouts/gecko/widget/windows/nsAppShell.cpp:682
#29 0x7ffff1e4d650 in nsAppStartup::Run(void) /builds/worker/workspace/obj-build/toolkit/components/startup/./../../../../../checkouts/gecko/toolkit/components/startup/nsAppStartup.cpp:307
#30 0x7ffff218d75c in XREMain::XRE_mainRun(void) /builds/worker/checkouts/gecko/toolkit/xre/nsAppRunner.cpp:6031
#31 0x7ffff2190711 in XREMain::XRE_main(int, char **const, struct mozilla::BootstrapConfig const &) /builds/worker/checkouts/gecko/toolkit/xre/nsAppRunner.cpp:6290
#32 0x7ffff2191824 in XRE_main(int, char **const, struct mozilla::BootstrapConfig const &) /builds/worker/checkouts/gecko/toolkit/xre/nsAppRunner.cpp:6363
#33 0x7ff7b83c3527 in do_main /builds/worker/checkouts/gecko/browser/app/nsBrowserApp.cpp:269
#34 0x7ff7b83c3527 in NS_internal_main(int, char **, char **) /builds/worker/checkouts/gecko/browser/app/nsBrowserApp.cpp:533
#35 0x7ff7b83c2424 in wmain /builds/worker/checkouts/gecko/toolkit/xre/nsWindowsWMain.cpp:150
#36 0x7ff7b84b2b77 in invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:90
#37 0x7ff7b84b2b77 in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
#38 0x7ff838fe4caf (C:\Windows\System32\KERNEL32.DLL+0x180014caf)
#39 0x7ff83a1dedda (C:\Windows\SYSTEM32\ntdll.dll+0x18007edda)
0x119a1f5ded90 is located 0 bytes inside of 16-byte region [0x119a1f5ded90,0x119a1f5deda0)
freed by thread T0 here:
#0 0x7ff819f5f5cd in free /builds/worker/fetches/llvm-project/compiler-rt/lib/asan/asan_malloc_win.cpp:71
#1 0x7fffe4233d8e in nsTArrayInfallibleAllocator::Free /builds/worker/workspace/obj-build/dist/include/nsTArray.h:252
#2 0x7fffe4233d8e in nsTArray_base<nsTArray_RelocateUsingMemutils>::~nsTArray_base /builds/worker/workspace/obj-build/dist/include/nsTArray.h:3089
#3 0x7fffe4233d8e in nsTArray_Impl<RefPtr<mozilla::net::Cookie>,nsTArrayInfallibleAllocator>::~nsTArray_Impl /builds/worker/workspace/obj-build/dist/include/nsTArray.h:898
#4 0x7fffe4233d8e in mozilla::net::CookieEntry::~CookieEntry /builds/worker/workspace/obj-build/netwerk/cookie/./../../../../checkouts/gecko/netwerk/cookie/CookieStorage.h:44
#5 0x7fffe4233d8e in nsTHashtable<class mozilla::net::CookieEntry>::s_ClearEntry(class PLDHashTable *, struct PLDHashEntryHdr *) /builds/worker/workspace/obj-build/dist/include/nsTHashtable.h:700
#6 0x7fffe53bf06a in PLDHashTable::RawRemove /builds/worker/workspace/obj-build/xpcom/ds/./../../../../checkouts/gecko/xpcom/ds/PLDHashTable.cpp:504
#7 0x7fffe53bf06a in PLDHashTable::RawRemove(struct PLDHashEntryHdr *) /builds/worker/workspace/obj-build/xpcom/ds/./../../../../checkouts/gecko/xpcom/ds/PLDHashTable.cpp:487
#8 0x7fffe41f97f8 in nsTHashtable<mozilla::net::CookieEntry>::RawRemoveEntry /builds/worker/workspace/obj-build/dist/include/nsTHashtable.h:399
#9 0x7fffe41f97f8 in mozilla::net::CookieStorage::RemoveCookieFromListInternal /builds/worker/workspace/obj-build/netwerk/cookie/./../../../../checkouts/gecko/netwerk/cookie/CookieStorage.cpp:1280
#10 0x7fffe41f97f8 in mozilla::net::CookieStorage::RemoveCookieFromList /builds/worker/workspace/obj-build/netwerk/cookie/./../../../../checkouts/gecko/netwerk/cookie/CookieStorage.cpp:1272
#11 0x7fffe41f97f8 in mozilla::net::CookieStorage::AddCookie(class mozilla::net::CookieParser *, class nsTSubstring<char> const &, class mozilla::OriginAttributes const &, class mozilla::net::Cookie *, __int64, class nsIURI *, class nsTSubstring<char> const &, bool, bool, class mozilla::dom::BrowsingContext *, struct nsID const *) /builds/worker/workspace/obj-build/netwerk/cookie/./../../../../checkouts/gecko/netwerk/cookie/CookieStorage.cpp:979
#12 0x7fffe4204d55 in mozilla::net::CookieService::SetCookieStringFromHttp(class nsIURI *, class nsTSubstring<char> const &, class nsIChannel *) /builds/worker/workspace/obj-build/netwerk/cookie/./../../../../checkouts/gecko/netwerk/cookie/CookieService.cpp:652
#13 0x7fffe4a967e8 in mozilla::net::HttpBaseChannel::SetCookieHeaders(class nsTArray<class nsTString<char>> const &) /builds/worker/workspace/obj-build/netwerk/protocol/http/./../../../../../checkouts/gecko/netwerk/protocol/http/HttpBaseChannel.cpp:3774
#14 0x7fffe4c3d5d6 in mozilla::net::nsHttpChannel::ContinueProcessResponse1(class mozilla::net::nsHttpConnectionInfo *) /builds/worker/workspace/obj-build/netwerk/protocol/http/./../../../../../checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:3200
#15 0x7fffe4c3cbf7 in mozilla::net::nsHttpChannel::ProcessResponse(class mozilla::net::nsHttpConnectionInfo *) /builds/worker/workspace/obj-build/netwerk/protocol/http/./../../../../../checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:3138
#16 0x7fffe4c83a00 in mozilla::net::nsHttpChannel::OnStartRequest(class nsIRequest *) /builds/worker/workspace/obj-build/netwerk/protocol/http/./../../../../../checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:9251
#17 0x7fffe40725f8 in nsInputStreamPump::OnStateStart(void) /builds/worker/workspace/obj-build/netwerk/base/./../../../../checkouts/gecko/netwerk/base/nsInputStreamPump.cpp:533
#18 0x7fffe4071985 in nsInputStreamPump::OnInputStreamReady(class nsIAsyncInputStream *) /builds/worker/workspace/obj-build/netwerk/base/./../../../../checkouts/gecko/netwerk/base/nsInputStreamPump.cpp:435
#19 0x7fffe548a7de in std::_Func_class<void>::operator() /builds/worker/fetches/vs/VC/Tools/MSVC/14.50.35717/include/functional:930
#20 0x7fffe548a7de in PipeCallbackRunnable::Run(void) /builds/worker/workspace/obj-build/xpcom/io/./../../../../checkouts/gecko/xpcom/io/nsPipe3.cpp:74
#21 0x7fffe551d88e in mozilla::RunnableTask::Run(void) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:719
#22 0x7fffe54f6c42 in mozilla::TaskController::RunTask(class mozilla::Task *) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:210
#23 0x7fffe550133f in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(class mozilla::detail::BaseAutoLock<class mozilla::Mutex &> const &) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:1358
#24 0x7fffe54fdc78 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(class mozilla::detail::BaseAutoLock<class mozilla::Mutex &> const &) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:1181
#25 0x7fffe54fe574 in mozilla::TaskController::ProcessPendingMTTask(bool) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:655
#26 0x7fffe551b6b1 in mozilla::TaskController::TaskController::<lambda_5>::operator() /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:350
#27 0x7fffe551b6b1 in mozilla::detail::RunnableFunction<`lambda at .\..\..\..\..\checkouts\gecko\xpcom\threads\TaskController.cpp:350:7'>::Run /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/nsThreadUtils.h:536
previously allocated by thread T0 here:
#0 0x7ff819f5f6dd in malloc /builds/worker/fetches/llvm-project/compiler-rt/lib/asan/asan_malloc_win.cpp:80
#1 0x7ff8319d115d in moz_xmalloc /builds/worker/workspace/obj-build/memory/mozalloc/./../../../../checkouts/gecko/memory/mozalloc/mozalloc.cpp:48
#2 0x7fffe32e4c21 in nsTArrayInfallibleAllocator::Malloc /builds/worker/workspace/obj-build/dist/include/nsTArray.h:246
#3 0x7fffe32e4c21 in nsTArray_base<struct nsTArray_RelocateUsingMemutils>::EnsureCapacityImpl<struct nsTArrayInfallibleAllocator>(unsigned __int64, unsigned __int64) /builds/worker/workspace/obj-build/dist/include/nsTArray.h:3135
#4 0x7fffe41ee131 in nsTArray_base<nsTArray_RelocateUsingMemutils>::EnsureCapacity /builds/worker/workspace/obj-build/dist/include/nsTArray.h:397
#5 0x7fffe41ee131 in nsTArray_Impl<RefPtr<mozilla::net::Cookie>,nsTArrayInfallibleAllocator>::AppendElementInternal /builds/worker/workspace/obj-build/dist/include/nsTArray.h:2582
#6 0x7fffe41ee131 in nsTArray<RefPtr<mozilla::net::Cookie> >::AppendElement /builds/worker/workspace/obj-build/dist/include/nsTArray.h:2716
#7 0x7fffe41ee131 in mozilla::net::CookieStorage::AddCookieToList(class nsTSubstring<char> const &, class mozilla::OriginAttributes const &, class mozilla::net::Cookie *) /builds/worker/workspace/obj-build/netwerk/cookie/./../../../../checkouts/gecko/netwerk/cookie/CookieStorage.cpp:1088
#8 0x7fffe41f9a95 in mozilla::net::CookieStorage::AddCookie(class mozilla::net::CookieParser *, class nsTSubstring<char> const &, class mozilla::OriginAttributes const &, class mozilla::net::Cookie *, __int64, class nsIURI *, class nsTSubstring<char> const &, bool, bool, class mozilla::dom::BrowsingContext *, struct nsID const *) /builds/worker/workspace/obj-build/netwerk/cookie/./../../../../checkouts/gecko/netwerk/cookie/CookieStorage.cpp:987
#9 0x7fffe4204d55 in mozilla::net::CookieService::SetCookieStringFromHttp(class nsIURI *, class nsTSubstring<char> const &, class nsIChannel *) /builds/worker/workspace/obj-build/netwerk/cookie/./../../../../checkouts/gecko/netwerk/cookie/CookieService.cpp:652
#10 0x7fffe4a967e8 in mozilla::net::HttpBaseChannel::SetCookieHeaders(class nsTArray<class nsTString<char>> const &) /builds/worker/workspace/obj-build/netwerk/protocol/http/./../../../../../checkouts/gecko/netwerk/protocol/http/HttpBaseChannel.cpp:3774
#11 0x7fffe4c3d5d6 in mozilla::net::nsHttpChannel::ContinueProcessResponse1(class mozilla::net::nsHttpConnectionInfo *) /builds/worker/workspace/obj-build/netwerk/protocol/http/./../../../../../checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:3200
#12 0x7fffe4c3cbf7 in mozilla::net::nsHttpChannel::ProcessResponse(class mozilla::net::nsHttpConnectionInfo *) /builds/worker/workspace/obj-build/netwerk/protocol/http/./../../../../../checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:3138
#13 0x7fffe4c83a00 in mozilla::net::nsHttpChannel::OnStartRequest(class nsIRequest *) /builds/worker/workspace/obj-build/netwerk/protocol/http/./../../../../../checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:9251
#14 0x7fffe40725f8 in nsInputStreamPump::OnStateStart(void) /builds/worker/workspace/obj-build/netwerk/base/./../../../../checkouts/gecko/netwerk/base/nsInputStreamPump.cpp:533
#15 0x7fffe4071985 in nsInputStreamPump::OnInputStreamReady(class nsIAsyncInputStream *) /builds/worker/workspace/obj-build/netwerk/base/./../../../../checkouts/gecko/netwerk/base/nsInputStreamPump.cpp:435
#16 0x7fffe548a7de in std::_Func_class<void>::operator() /builds/worker/fetches/vs/VC/Tools/MSVC/14.50.35717/include/functional:930
#17 0x7fffe548a7de in PipeCallbackRunnable::Run(void) /builds/worker/workspace/obj-build/xpcom/io/./../../../../checkouts/gecko/xpcom/io/nsPipe3.cpp:74
#18 0x7fffe551d88e in mozilla::RunnableTask::Run(void) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:719
#19 0x7fffe54f6c42 in mozilla::TaskController::RunTask(class mozilla::Task *) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:210
#20 0x7fffe550133f in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(class mozilla::detail::BaseAutoLock<class mozilla::Mutex &> const &) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:1358
#21 0x7fffe54fdc78 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(class mozilla::detail::BaseAutoLock<class mozilla::Mutex &> const &) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:1181
#22 0x7fffe551b4ca in mozilla::TaskController::ProcessPendingMTTask /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:655
#23 0x7fffe551b4ca in mozilla::TaskController::TaskController::<lambda_4>::operator() /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:347
#24 0x7fffe551b4ca in mozilla::detail::RunnableFunction<`lambda at .\..\..\..\..\checkouts\gecko\xpcom\threads\TaskController.cpp:347:7'>::Run /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/nsThreadUtils.h:536
| Reporter | ||
Updated•5 months ago
|
Keywords: regression
Comment 1•5 months ago
|
||
Okay, great. It looks like the use and free are on the same frame, so it is an iterator invalidation issue of some kind, and not a race.
The first common frame between the use and free appears to be:
mozilla::net::CookieService::SetCookieStringFromHttp(class nsIURI *, class nsTSubstring<char> const &, class nsIChannel *) netwerk/cookie/CookieService.cpp:652
Trimming the stack back to that and cleaning up the awful ../ stuff gives:
==4588==ERROR: AddressSanitizer: heap-use-after-free on address 0x119a1f5ded90 at pc 0x7fffe41f999f bp 0x001acf3fa220 sp 0x001acf3fa268
READ of size 4 at 0x119a1f5ded90 thread T0
#0 0x7fffe41f999e in nsTArray_base<nsTArray_RelocateUsingMemutils>::Length nsTArray.h:365
#1 0x7fffe41f999e in nsTArray_Impl<RefPtr<mozilla::net::Cookie>,nsTArrayInfallibleAllocator>::ElementAt nsTArray.h:1056
#2 0x7fffe41f999e in nsTArray_Impl<RefPtr<mozilla::net::Cookie>,nsTArrayInfallibleAllocator>::operator[] nsTArray.h:1104
#3 0x7fffe41f999e in mozilla::net::CookieStorage::CookieListIter::Cookie netwerk/cookie/CookieStorage.h:175
#4 0x7fffe41f999e in mozilla::net::CookieStorage::AddCookie(class mozilla::net::CookieParser *, class nsTSubstring<char> const &, class mozilla::OriginAttributes const &, class mozilla::net::Cookie *, __int64, class nsIURI *, class nsTSubstring<char> const &, bool, bool, class mozilla::dom::BrowsingContext *, struct nsID const *) netwerk/cookie/CookieStorage.cpp:980
#5 0x7fffe4204d55 in mozilla::net::CookieService::SetCookieStringFromHttp(class nsIURI *, class nsTSubstring<char> const &, class nsIChannel *) netwerk/cookie/CookieService.cpp:652
0x119a1f5ded90 is located 0 bytes inside of 16-byte region [0x119a1f5ded90,0x119a1f5deda0)
freed by thread T0 here:
#0 0x7ff819f5f5cd in free /builds/worker/fetches/llvm-project/compiler-rt/lib/asan/asan_malloc_win.cpp:71
#1 0x7fffe4233d8e in nsTArrayInfallibleAllocator::Free nsTArray.h:252
#2 0x7fffe4233d8e in nsTArray_base<nsTArray_RelocateUsingMemutils>::~nsTArray_base nsTArray.h:3089
#3 0x7fffe4233d8e in nsTArray_Impl<RefPtr<mozilla::net::Cookie>,nsTArrayInfallibleAllocator>::~nsTArray_Impl nsTArray.h:898
#4 0x7fffe4233d8e in mozilla::net::CookieEntry::~CookieEntry netwerk/cookie/CookieStorage.h:44
#5 0x7fffe4233d8e in nsTHashtable<class mozilla::net::CookieEntry>::s_ClearEntry(class PLDHashTable *, struct PLDHashEntryHdr *) nsTHashtable.h:700
#6 0x7fffe53bf06a in PLDHashTable::RawRemove xpcom/ds/PLDHashTable.cpp:504
#7 0x7fffe53bf06a in PLDHashTable::RawRemove(struct PLDHashEntryHdr *) xpcom/ds/PLDHashTable.cpp:487
#8 0x7fffe41f97f8 in nsTHashtable<mozilla::net::CookieEntry>::RawRemoveEntry nsTHashtable.h:399
#9 0x7fffe41f97f8 in mozilla::net::CookieStorage::RemoveCookieFromListInternal netwerk/cookie/CookieStorage.cpp:1280
#10 0x7fffe41f97f8 in mozilla::net::CookieStorage::RemoveCookieFromList netwerk/cookie/CookieStorage.cpp:1272
#11 0x7fffe41f97f8 in mozilla::net::CookieStorage::AddCookie(class mozilla::net::CookieParser *, class nsTSubstring<char> const &, class mozilla::OriginAttributes const &, class mozilla::net::Cookie *, __int64, class nsIURI *, class nsTSubstring<char> const &, bool, bool, class mozilla::dom::BrowsingContext *, struct nsID const *) netwerk/cookie/CookieStorage.cpp:979
#12 0x7fffe4204d55 in mozilla::net::CookieService::SetCookieStringFromHttp(class nsIURI *, class nsTSubstring<char> const &, class nsIChannel *) netwerk/cookie/CookieService.cpp:652
Comment 2•5 months ago
|
||
The common frame also shows up in the allocation stack so that's probably relevant:
previously allocated by thread T0 here:
#0 0x7ff819f5f6dd in malloc /builds/worker/fetches/llvm-project/compiler-rt/lib/asan/asan_malloc_win.cpp:80
#1 0x7ff8319d115d in moz_xmalloc memory/mozalloc/mozalloc.cpp:48
#2 0x7fffe32e4c21 in nsTArrayInfallibleAllocator::Malloc nsTArray.h:246
#3 0x7fffe32e4c21 in nsTArray_base<struct nsTArray_RelocateUsingMemutils>::EnsureCapacityImpl<struct nsTArrayInfallibleAllocator>(unsigned __int64, unsigned __int64) nsTArray.h:3135
#4 0x7fffe41ee131 in nsTArray_base<nsTArray_RelocateUsingMemutils>::EnsureCapacity nsTArray.h:397
#5 0x7fffe41ee131 in nsTArray_Impl<RefPtr<mozilla::net::Cookie>,nsTArrayInfallibleAllocator>::AppendElementInternal nsTArray.h:2582
#6 0x7fffe41ee131 in nsTArray<RefPtr<mozilla::net::Cookie> >::AppendElement nsTArray.h:2716
#7 0x7fffe41ee131 in mozilla::net::CookieStorage::AddCookieToList(class nsTSubstring<char> const &, class mozilla::OriginAttributes const &, class mozilla::net::Cookie *) netwerk/cookie/CookieStorage.cpp:1088
#8 0x7fffe41f9a95 in mozilla::net::CookieStorage::AddCookie(class mozilla::net::CookieParser *, class nsTSubstring<char> const &, class mozilla::OriginAttributes const &, class mozilla::net::Cookie *, __int64, class nsIURI *, class nsTSubstring<char> const &, bool, bool, class mozilla::dom::BrowsingContext *, struct nsID const *) netwerk/cookie/CookieStorage.cpp:987
#9 0x7fffe4204d55 in mozilla::net::CookieService::SetCookieStringFromHttp(class nsIURI *, class nsTSubstring<char> const &, class nsIChannel *) netwerk/cookie/CookieService.cpp:652
Comment 3•5 months ago
|
||
I'm going to call this fixed by backout, but I'll needinfo jesup so they don't miss this.
Status: NEW → RESOLVED
Closed: 5 months ago
status-firefox151:
--- → unaffected
status-firefox152:
--- → unaffected
status-firefox-esr115:
--- → unaffected
status-firefox-esr140:
--- → unaffected
Flags: needinfo?(rjesup)
Resolution: --- → FIXED
Updated•5 months ago
|
Assignee: nobody → rjesup
Group: network-core-security → core-security-release
tracking-firefox153:
--- → +
Target Milestone: --- → 153 Branch
Updated•5 months ago
|
QA Whiteboard: [qa-ver-opt-c154/b153][qa-triage-done-c154/b153][sec]
Updated•2 months ago
|
Group: core-security-release
You need to log in
before you can comment on or make changes to this bug.
Description
•