fixup! Fix heap-use-after-free issue 34/285834/4 accepted/tizen/unified/20221222.055310
authorYoungHun Kim <yh8004.kim@samsung.com>
Wed, 21 Dec 2022 04:42:53 +0000 (13:42 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Wed, 21 Dec 2022 07:07:15 +0000 (16:07 +0900)
 - By thread scheduling, the data thread can be executed before setting the value of 'is_created'.
   where is set at _ms_ipc_dispatch_create().  So I remove to check value of 'is_created' which cause
   it not to run despite normal data thread execution. Instead we can use muse_server_module_is_valid().

Change-Id: I8bc4c0ac65d4ee98e477c0d5e475c2c60cff289e

packaging/mused.spec
server/src/muse_server_ipc.c

index 5797e7d..2c817ea 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mused
 Summary:    A multimedia daemon
-Version:    0.3.160
+Version:    0.3.161
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index f107e2b..5e6b6b5 100644 (file)
@@ -394,9 +394,10 @@ static gpointer _ms_ipc_data_worker(gpointer data)
        muse_return_val_if_fail(data, NULL);
 
        m = (muse_module_h)data;
-       SECURE_LOGW("module : %p pid %d handle %zd created %d", m, m->pid, m->handle, m->is_created);
+       SECURE_LOGW("module : %p pid %d handle %zd created %d fd %d",
+               m, m->pid, m->handle, m->is_created, m->ch[MUSE_CHANNEL_MSG].sock_fd);
 
-       muse_return_val_if_fail(m->pid > 0 && m->handle && m->is_created, NULL);
+       muse_return_val_if_fail(muse_server_module_is_valid(m), NULL);
 
        fd = m->ch[MUSE_CHANNEL_DATA].sock_fd;
        ch = &m->ch[MUSE_CHANNEL_DATA];