Edward Hervey 605cb6a4d4 gstpad: Avoid race in (un)setting EOS flag on sinkpads
The scenario is the following:

* Thread 1 is pushing an EOS event on a sinkpad
* Thread 2 is pushing a STREAM_START event on the same sinkpad before Thread 1
returns. Note : It starts pushing the event after Thread 1 took the object lock.

There is a potential race between:

* The moment Thread 1 sets the EOS flag once it has finished sending the
event (via store_sticky_event). When it does that it has both the STREAM and
OBJECT lock

* The moment Thread 2 sends the STREAM_START event (Which should release that
EOS status), but removing the EOS flag is only done while holding the OBJECT
lock and not the STREAM_LOCK, which means it could be re-set by Thread 1 before
it then checks again the EOS flag (without the STREAM lock taken).

The EOS flag unsetting by STREAM_START should be done with the STREAM lock
taken, otherwise it will be racy.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1452

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3320>
2022-11-07 06:28:39 +01:00
..
2022-04-01 08:15:53 +00:00
2022-10-04 11:19:14 +00:00
2022-10-18 13:51:16 +03:00
2022-02-08 16:24:13 +11:00
2022-10-18 13:51:16 +03:00
2022-10-18 13:51:16 +03:00
2022-10-18 13:51:16 +03:00
2022-10-18 13:51:16 +03:00
2022-10-18 13:51:16 +03:00
2022-10-22 22:06:13 +09:00
2022-10-18 13:51:16 +03:00
2022-10-18 13:51:16 +03:00
2022-10-18 13:51:16 +03:00