ecore_evas_extn: do not update plug image when lockfile is invalid.
authorMinkyoung Kim <sleepigmk@gmail.com>
Tue, 21 Mar 2017 18:05:43 +0000 (11:05 -0700)
committerCedric BAIL <cedric@osg.samsung.com>
Tue, 21 Mar 2017 18:05:58 +0000 (11:05 -0700)
Summary:
This prevent invalid shared memory access.
Invalid access occur when server is resized sequentially from now to A-size
to B-size, and client receive A resize message after resizing B.
Then client try to render plug image with A-size, but shared memory is B-size
buffer. Size are mismatch. This makes segmentation fault when uploading texture(gl)
or rendering image(sw).

Test Plan: Indicator rendering on Tizen3.0 platform.

Reviewers: jypark, wonsik, dkdk, scholb.kim, jiin.moon, jpeg, cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4711

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/modules/ecore_evas/engines/extn/ecore_evas_extn.c

index 24b230b..af5f3de 100644 (file)
@@ -1021,6 +1021,17 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void *event)
            {
               Ipc_Data_Update *ipc;
               int n = e->response;
+              /* b->lockfd is not enough to ensure the size is same 
+               * between what server knows, and client knows.
+               * So should check file lock also. */
+              if (extn->b[n].buf && (!_extnbuf_lock_file_get(extn->b[n].buf)))
+                {  
+                   EINA_LIST_FREE(extn->file.updates, ipc)
+                     {
+                        free(ipc);
+                     }
+                   break;
+                }
 
               EINA_LIST_FREE(extn->file.updates, ipc)
                 {