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 746866 - [PATCH] wacom: don't unref GdkDevices when we don't own a reference
[PATCH] wacom: don't unref GdkDevices when we don't own a reference
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: wacom
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: Carlos Garnacho
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2015-03-27 07:41 UTC by Lubomir Rintel
Modified: 2015-04-15 08:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] wacom: don't unref GdkDevices when we don't own a reference (3.14 KB, patch)
2015-03-27 07:41 UTC, Lubomir Rintel
committed Details | Review

Description Lubomir Rintel 2015-03-27 07:41:19 UTC
Created attachment 300419 [details] [review]
[PATCH] wacom: don't unref GdkDevices when we don't own a reference

Commit 9e17dced137ff2fd05ed97c82e90a7725e9f82d7 added a bunch of unrefs
which always unref the gdk_device after a g_object_get ("gdk-device").
That is wrong -- getting a property doesn't increase a refcount.

This causes the GdkDevices to be freed too early causing all sorts of
crashes due to use-after-free() conditions:

https://bugzilla.redhat.com/show_bug.cgi?id=1194037
---
 plugins/wacom/gsd-wacom-manager.c | 4 ----
 plugins/wacom/list-wacom.c        | 1 -
 2 files changed, 5 deletions(-)
Comment 1 Bastien Nocera 2015-04-01 08:19:04 UTC
Review of attachment 300419 [details] [review]:

Looks good. Please make sure to cherry-pick.
Comment 2 Carlos Garnacho 2015-04-13 11:28:24 UTC
Comment on attachment 300419 [details] [review]
[PATCH] wacom: don't unref GdkDevices when we don't own a reference

The patch was pushed as is. I pushed 7b38b7fde on top replacing all g_object_get() calls with a getter.
Comment 3 Carlos Garnacho 2015-04-13 11:31:16 UTC
FWIW, the patch is not needed on gnome-3-14
Comment 4 Ray Strode [halfline] 2015-04-14 19:40:46 UTC
is there any reason the gdk-device property is GParamSpecPointer instead of GParamSpecObject ?
Comment 5 Bastien Nocera 2015-04-15 08:50:15 UTC
(In reply to Ray Strode [halfline] from comment #4)
> is there any reason the gdk-device property is GParamSpecPointer instead of
> GParamSpecObject ?

Because it's easier to avoid cyclic references.