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 750816 - mutter crashes when setting invalid properties
mutter crashes when setting invalid properties
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
git master
Other Linux
: Normal critical
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2015-06-12 00:32 UTC by Peter Hutterer
Modified: 2015-07-14 21:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-input-settings-x11-check-properties-for-correctness-.patch (4.14 KB, patch)
2015-06-16 01:59 UTC, Peter Hutterer
committed Details | Review

Description Peter Hutterer 2015-06-12 00:32:01 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1228011

on a touchpad that doesn't have two-finger scrolling, setting the scroll method to that will cause a BadValue, which in turn brings the session down.
These touchpads are fairly uncommon now, but it's quite nasty nonetheless.
Comment 1 Peter Hutterer 2015-06-12 01:01:08 UTC
looks like MetaDisplay is not set when we get here, it's called during meta_init. so a simple meta_error_trap_push/pop around the XIChangeProperty call doesn't work. This needs some bigger change then in call order, any hints would be appreciated.

There's the other solution of checking each property separately for validity before we change it, but not sure that's sensible either.
Comment 2 Jasper St. Pierre (not reading bugmail) 2015-06-12 01:14:14 UTC
https://git.gnome.org/browse/mutter/commit/?id=989f9630a43fe0c6efab64ea36e8a0e909d97c19
Comment 3 Peter Hutterer 2015-06-12 04:18:33 UTC
did this work for you? I'm getting a crash on the very first property (happens to be the left-handed one), and the cause of it appears to be libxcb. Part of that is misalignment of the properties [1] but the second part is that it looks like libxcb will assert on any data pointer passed in that's not 4-byte aligned (libxcb bug). So now I'm left wondering why this worked for you - luck of the compiler?

[1] http://lists.freedesktop.org/archives/xcb/2015-June/010385.html
Comment 4 Peter Hutterer 2015-06-16 01:16:59 UTC
reverted, xcb-xinput doesn't work.

https://git.gnome.org/browse/mutter/commit/?id=9747277b7e47fff5d0c7a9d2a60ede18b00a1d55
Comment 5 Peter Hutterer 2015-06-16 01:59:24 UTC
Created attachment 305355 [details] [review]
0001-input-settings-x11-check-properties-for-correctness-.patch

To avoid the BadValue altogether, check the properties for correctness before sending the request. Not ideal, but better than a crash.

Only three properties are checked where the BadValue is most likely to occur. The others are generally safer because most of them are booleans and we handle non-existing properties correctly already.
Comment 6 Peter Hutterer 2015-06-24 21:54:46 UTC
ping?
Comment 7 Michael Catanzaro 2015-07-04 12:43:54 UTC
This bug makes it impossible for some users to log in to GNOME. Could anyone take a look at the patch?
Comment 8 Jasper St. Pierre (not reading bugmail) 2015-07-04 16:27:03 UTC
Review of attachment 305355 [details] [review]:

Not super happy with this patch, but let's land it for now if users are really crashing.
Comment 9 Michael Catanzaro 2015-07-14 21:21:34 UTC
Peter, do you need someone to push this for you?
Comment 10 Peter Hutterer 2015-07-14 21:24:57 UTC
yes please. I may have git access (not sure) but I'm sure you have a better mutter build setup than I do :)
Comment 11 Michael Catanzaro 2015-07-14 21:42:19 UTC
OK thanks.

I think you would know if you had git access :)