After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791404 - vaapipostproc: race condition between transform_caps and start for src caps
vaapipostproc: race condition between transform_caps and start for src caps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
git master
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-08 18:32 UTC by Michael Tretter
Modified: 2018-01-12 19:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-vaapipostproc-lock-ensure_filter-with-postproc_lock.patch (1.72 KB, patch)
2017-12-08 18:32 UTC, Michael Tretter
committed Details | Review

Description Michael Tretter 2017-12-08 18:32:58 UTC
Created attachment 365265 [details] [review]
0001-vaapipostproc-lock-ensure_filter-with-postproc_lock.patch

The vaapipostproc element contains a race between gst_vaapipostproc_transform_caps and gst_vaapipostproc_start for postproc->allowed_srcpad_caps. 

The caps are copied with the postproc_lock (introduced in https://bugzilla.gnome.org/show_bug.cgi?id=766940) held via

gst_vaapipostproc_transform_caps -> gst_vaapipostproc_transform_caps_impl -> gst_vaapipostproc_transform_srccaps -> gst_caps_get_structure

And the same structure is released without holding the lock in

gst_vaapipostproc_start -> gst_vaapipostproc_ensure_filter -> gst_caps_replace

The call from gst_vaapipostproc_start to gst_vaapipostproc_ensure_filter should also be protected by the postproc_lock.
Comment 1 Víctor Manuel Jáquez Leal 2017-12-12 09:23:44 UTC
Review of attachment 365265 [details] [review]:

lgtm
Comment 2 Víctor Manuel Jáquez Leal 2018-01-12 19:19:16 UTC
* aed40889 (origin/master) vaapipostproc: lock ensure_filter with postproc_lock
* fdf70ba1 (origin/1.12) vaapipostproc: lock ensure_filter with postproc_lock