GNOME Bugzilla – Bug 727893
mutter crashes with malicious buffer
Last modified: 2015-01-10 00:40:47 UTC
Hey, when client creates buffer and then truncates it's size to 0 (and then mutter tries to use it), mutter gets SIGBUS and is killed instead of sending an error to client. This is one of Weston's testcases (bad-buffer-test.c) (I ran it using https://github.com/mchalupa/mutter/tree/tests2) Regards, Marek Chalupa
We should start enforcing buffers being sealed and fix up all clients.
Created attachment 294163 [details] Testing program This program creates buffer, truncates it and commit it - this leads to mutter crash.
Created attachment 294164 [details] [review] Seal buffer when accessing it
Created attachment 294166 [details] [review] Seal buffer when accessing it
Pushed with a few changes. I added shm_buffer tests around the code for the Cogl textures, since they might not be SHM buffers. I also added begin_access / end_access guards around the corresponding code in the cursor management code as well.