From bc6f854478d4fa7a3f4bcfe88c58042cd9d7d08d Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 17 Jul 2014 10:54:33 -0600 Subject: [PATCH] Fix possible race conditions in strmbase/quartz. --- debian/changelog | 4 ++ ...e-condition-on-InputPin_BeginFlush-b.patch | 27 ++++++++++++++ ...e-condition-on-InputPin_EndFlush-bet.patch | 37 +++++++++++++++++++ ...e-condition-on-InputPin_EndOfStream-.patch | 37 +++++++++++++++++++ ...condition-on-EndOfStream-between-csR.patch | 27 ++++++++++++++ ...condition-on-EndFlush-between-csRend.patch | 27 ++++++++++++++ .../c64ef9a8-0dd2-11e4-ab01-0090f5c75ad5.def | 3 ++ patches/patch-list.patch | 3 +- 8 files changed, 164 insertions(+), 1 deletion(-) create mode 100644 patches/17-strmbase-Lock_Race_Conditions/0001-strmbase-Fix-race-condition-on-InputPin_BeginFlush-b.patch create mode 100644 patches/17-strmbase-Lock_Race_Conditions/0002-strmbase-Fix-race-condition-on-InputPin_EndFlush-bet.patch create mode 100644 patches/17-strmbase-Lock_Race_Conditions/0003-strmbase-Fix-race-condition-on-InputPin_EndOfStream-.patch create mode 100644 patches/17-strmbase-Lock_Race_Conditions/0004-quartz-Fix-race-condition-on-EndOfStream-between-csR.patch create mode 100644 patches/17-strmbase-Lock_Race_Conditions/0005-quartz-Fix-race-condition-on-EndFlush-between-csRend.patch create mode 100644 patches/17-strmbase-Lock_Race_Conditions/c64ef9a8-0dd2-11e4-ab01-0090f5c75ad5.def diff --git a/debian/changelog b/debian/changelog index e8ddf099..e277adbd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,7 @@ +wine-compholio (1.7.22) UNRELEASED; urgency=low + * Fix possible race conditions in strmbase/quartz. + -- Erich E. Hoover Thu, 17 Jul 2014 10:53:49 -0600 + wine-compholio (1.7.22) unstable; urgency=low * Implement passing ACLs to CreateProcess. * Removed several patches (accepted upstream). diff --git a/patches/17-strmbase-Lock_Race_Conditions/0001-strmbase-Fix-race-condition-on-InputPin_BeginFlush-b.patch b/patches/17-strmbase-Lock_Race_Conditions/0001-strmbase-Fix-race-condition-on-InputPin_BeginFlush-b.patch new file mode 100644 index 00000000..45625eb2 --- /dev/null +++ b/patches/17-strmbase-Lock_Race_Conditions/0001-strmbase-Fix-race-condition-on-InputPin_BeginFlush-b.patch @@ -0,0 +1,27 @@ +From b089b250846590430d7908f2cff86ba40f40a696 Mon Sep 17 00:00:00 2001 +From: "Erich E. Hoover" +Date: Thu, 17 Jul 2014 10:28:42 -0600 +Subject: strmbase: Fix race condition on InputPin_BeginFlush between + csRenderLock and filter.csFilter. + +--- + dlls/strmbase/renderer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c +index bb91236..fb0902e 100644 +--- a/dlls/strmbase/renderer.c ++++ b/dlls/strmbase/renderer.c +@@ -130,8 +130,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_BeginFlush(IPin * iface) + + TRACE("(%p/%p)->()\n", This, iface); + +- EnterCriticalSection(&pFilter->filter.csFilter); + EnterCriticalSection(&pFilter->csRenderLock); ++ EnterCriticalSection(&pFilter->filter.csFilter); + EnterCriticalSection(This->pin.pCritSec); + hr = BaseInputPinImpl_BeginFlush(iface); + if (SUCCEEDED(hr)) +-- +1.7.9.5 + diff --git a/patches/17-strmbase-Lock_Race_Conditions/0002-strmbase-Fix-race-condition-on-InputPin_EndFlush-bet.patch b/patches/17-strmbase-Lock_Race_Conditions/0002-strmbase-Fix-race-condition-on-InputPin_EndFlush-bet.patch new file mode 100644 index 00000000..f7d8e9e8 --- /dev/null +++ b/patches/17-strmbase-Lock_Race_Conditions/0002-strmbase-Fix-race-condition-on-InputPin_EndFlush-bet.patch @@ -0,0 +1,37 @@ +From 9941d6cd8ac96f5f90d3a93257acb9bee8181ba6 Mon Sep 17 00:00:00 2001 +From: "Erich E. Hoover" +Date: Thu, 17 Jul 2014 10:35:43 -0600 +Subject: strmbase: Fix race condition on InputPin_EndFlush between + csRenderLock and filter.csFilter. + +--- + dlls/strmbase/renderer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c +index fb0902e..d175fa5 100644 +--- a/dlls/strmbase/renderer.c ++++ b/dlls/strmbase/renderer.c +@@ -155,8 +155,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface) + + TRACE("(%p/%p)->()\n", This, pFilter); + +- EnterCriticalSection(&pFilter->filter.csFilter); + EnterCriticalSection(&pFilter->csRenderLock); ++ EnterCriticalSection(&pFilter->filter.csFilter); + EnterCriticalSection(This->pin.pCritSec); + hr = BaseInputPinImpl_EndFlush(iface); + if (SUCCEEDED(hr)) +@@ -167,8 +167,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface) + hr = BaseRendererImpl_EndFlush(pFilter); + } + LeaveCriticalSection(This->pin.pCritSec); +- LeaveCriticalSection(&pFilter->csRenderLock); + LeaveCriticalSection(&pFilter->filter.csFilter); ++ LeaveCriticalSection(&pFilter->csRenderLock); + return hr; + } + +-- +1.7.9.5 + diff --git a/patches/17-strmbase-Lock_Race_Conditions/0003-strmbase-Fix-race-condition-on-InputPin_EndOfStream-.patch b/patches/17-strmbase-Lock_Race_Conditions/0003-strmbase-Fix-race-condition-on-InputPin_EndOfStream-.patch new file mode 100644 index 00000000..f221710f --- /dev/null +++ b/patches/17-strmbase-Lock_Race_Conditions/0003-strmbase-Fix-race-condition-on-InputPin_EndOfStream-.patch @@ -0,0 +1,37 @@ +From 88b8e012138b2fc81718cde5f4e4f50cc6b4ed6b Mon Sep 17 00:00:00 2001 +From: "Erich E. Hoover" +Date: Thu, 17 Jul 2014 10:37:37 -0600 +Subject: strmbase: Fix race condition on InputPin_EndOfStream between + csRenderLock and filter.csFilter. + +--- + dlls/strmbase/renderer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c +index d175fa5..c8f130c 100644 +--- a/dlls/strmbase/renderer.c ++++ b/dlls/strmbase/renderer.c +@@ -105,8 +105,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface) + + TRACE("(%p/%p)->()\n", This, pFilter); + +- EnterCriticalSection(&pFilter->filter.csFilter); + EnterCriticalSection(&pFilter->csRenderLock); ++ EnterCriticalSection(&pFilter->filter.csFilter); + hr = BaseInputPinImpl_EndOfStream(iface); + EnterCriticalSection(This->pin.pCritSec); + if (SUCCEEDED(hr)) +@@ -117,8 +117,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface) + hr = BaseRendererImpl_EndOfStream(pFilter); + } + LeaveCriticalSection(This->pin.pCritSec); +- LeaveCriticalSection(&pFilter->csRenderLock); + LeaveCriticalSection(&pFilter->filter.csFilter); ++ LeaveCriticalSection(&pFilter->csRenderLock); + return hr; + } + +-- +1.7.9.5 + diff --git a/patches/17-strmbase-Lock_Race_Conditions/0004-quartz-Fix-race-condition-on-EndOfStream-between-csR.patch b/patches/17-strmbase-Lock_Race_Conditions/0004-quartz-Fix-race-condition-on-EndOfStream-between-csR.patch new file mode 100644 index 00000000..c083732b --- /dev/null +++ b/patches/17-strmbase-Lock_Race_Conditions/0004-quartz-Fix-race-condition-on-EndOfStream-between-csR.patch @@ -0,0 +1,27 @@ +From a67e8965650e75947a899cec4540d428e2cd1236 Mon Sep 17 00:00:00 2001 +From: "Erich E. Hoover" +Date: Thu, 17 Jul 2014 10:30:19 -0600 +Subject: quartz: Fix race condition on EndOfStream between csRenderLock and + filter.csFilter. + +--- + dlls/quartz/dsoundrender.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c +index 57e3d3b..8c67374 100644 +--- a/dlls/quartz/dsoundrender.c ++++ b/dlls/quartz/dsoundrender.c +@@ -254,8 +254,8 @@ static HRESULT DSoundRender_HandleEndOfStream(DSoundRenderImpl *This) + LeaveCriticalSection(&This->renderer.filter.csFilter); + LeaveCriticalSection(&This->renderer.csRenderLock); + WaitForSingleObject(This->blocked, 10); +- EnterCriticalSection(&This->renderer.filter.csFilter); + EnterCriticalSection(&This->renderer.csRenderLock); ++ EnterCriticalSection(&This->renderer.filter.csFilter); + This->in_loop = 0; + } + +-- +1.7.9.5 + diff --git a/patches/17-strmbase-Lock_Race_Conditions/0005-quartz-Fix-race-condition-on-EndFlush-between-csRend.patch b/patches/17-strmbase-Lock_Race_Conditions/0005-quartz-Fix-race-condition-on-EndFlush-between-csRend.patch new file mode 100644 index 00000000..949f52e4 --- /dev/null +++ b/patches/17-strmbase-Lock_Race_Conditions/0005-quartz-Fix-race-condition-on-EndFlush-between-csRend.patch @@ -0,0 +1,27 @@ +From 90faffc9d768d674eb603dabe72b107444e19712 Mon Sep 17 00:00:00 2001 +From: "Erich E. Hoover" +Date: Thu, 17 Jul 2014 10:31:17 -0600 +Subject: quartz: Fix race condition on EndFlush between csRenderLock and + filter.csFilter. + +--- + dlls/quartz/videorenderer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c +index 4e8f359..5fe0aea 100644 +--- a/dlls/quartz/videorenderer.c ++++ b/dlls/quartz/videorenderer.c +@@ -377,8 +377,8 @@ static HRESULT WINAPI VideoRenderer_EndFlush(BaseRenderer* iface) + LeaveCriticalSection(&iface->csRenderLock); + LeaveCriticalSection(&iface->filter.csFilter); + WaitForSingleObject(This->hEvent, INFINITE); +- EnterCriticalSection(&iface->filter.csFilter); + EnterCriticalSection(&iface->csRenderLock); ++ EnterCriticalSection(&iface->filter.csFilter); + EnterCriticalSection(iface->pInputPin->pin.pCritSec); + } + if (This->renderer.filter.state == State_Paused) { +-- +1.7.9.5 + diff --git a/patches/17-strmbase-Lock_Race_Conditions/c64ef9a8-0dd2-11e4-ab01-0090f5c75ad5.def b/patches/17-strmbase-Lock_Race_Conditions/c64ef9a8-0dd2-11e4-ab01-0090f5c75ad5.def new file mode 100644 index 00000000..02ac92ea --- /dev/null +++ b/patches/17-strmbase-Lock_Race_Conditions/c64ef9a8-0dd2-11e4-ab01-0090f5c75ad5.def @@ -0,0 +1,3 @@ +Revision: 1 +Author: Erich E. Hoover +Title: Fix possible race conditions in strmbase/quartz. diff --git a/patches/patch-list.patch b/patches/patch-list.patch index 135806f3..8ebe53f6 100644 --- a/patches/patch-list.patch +++ b/patches/patch-list.patch @@ -6,7 +6,7 @@ diff --git a/libs/wine/config.c b/libs/wine/config.c index a273502..5fa0cd5 100644 --- a/libs/wine/config.c +++ b/libs/wine/config.c -@@ -478,6 +478,44 @@ const char *wine_get_version(void) +@@ -478,6 +478,45 @@ const char *wine_get_version(void) return PACKAGE_VERSION; } @@ -32,6 +32,7 @@ index a273502..5fa0cd5 100644 + { "e46b26df-3c1b-419c-9579-f0d1e1c50bea:1", "Sebastian Lackner", "Workaround for broken implementation of shlwapi url functions." }, + { "3790a2d5-f930-423e-9c03-f7fc1c1e0811:1", "Sebastian Lackner", "Partial implementation of WTSEnumerateProcessesW." }, + { "a3f43350-092c-11e4-9b1e-0090f5c75ad5:1", "Joris van der Wel", "Implement passing ACLs to CreateProcess." }, ++ { "c64ef9a8-0dd2-11e4-ab01-0090f5c75ad5:1", "Erich E. Hoover", "Fix possible race conditions in strmbase/quartz." }, + { "0b21d7ac-0387-4493-aa38-fbafe3e749f5:2", "Michael Müller", "Decrease minimum SetTimer interval to 5 ms." }, + { "2394843e-2bc4-4fa4-8368-1ef32093b89e:1", "Michael Müller", "Allow changing strict draw ordering through an exported function." }, + { "255473fa-4e0a-4f51-952b-4deecc1a2181:1", "Michael Müller", "Indicate direct rendering through OpenGL extension." },