e_process: use eina_hash_int32_new instead of eina_hash_pointer_new when make hash... 46/275846/1 accepted/tizen/6.5/unified/20220603.141143 submit/tizen_6.5/20220603.034041
authorJunseok Kim <juns.kim@samsung.com>
Thu, 26 May 2022 09:36:03 +0000 (18:36 +0900)
committerJunSeok Kim <juns.kim@samsung.com>
Fri, 3 Jun 2022 02:21:16 +0000 (02:21 +0000)
there was a stack buffer overflow issue when access to pinfo hash on aarch64 system.
it caused by eina_hash_pointer_new (int64) to create hash using pid key (int32).
thus, stack overflow issue when memcpy on eina_hash_add.
for fix this issue, changed to eina_hash_int32_new instead of eina_hash_pointer_new.

Change-Id: I92fc6ef9778416f219af33b4c0ff4f571b3c3edf
(cherry picked from commit c20f36275df9536520509fe52d9e6faeeaffa67d)

src/bin/e_process.c

index 29af2003c49871dfd5e645d35e69ea519d2b0356..e910570de7422046546d998aeda193f2e748d23f 100644 (file)
@@ -598,7 +598,7 @@ _e_process_manager_new(void)
    pm = E_NEW(E_Process_Manager, 1);
    EINA_SAFETY_ON_NULL_RETURN_VAL(pm, NULL);
 
-   pm->pids_hash = eina_hash_pointer_new(NULL);
+   pm->pids_hash = eina_hash_int32_new(NULL);
    if (!pm->pids_hash) goto error;
 
    return pm;