resource: system: Fix possible vulnerability 58/288558/1
authorDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 20 Feb 2023 02:34:02 +0000 (11:34 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 20 Feb 2023 03:21:44 +0000 (12:21 +0900)
Change-Id: Ic6c261ea13e1a85086a15376ad360deb05f5d6cd
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/resource/resource-system.c

index b9f6fec40698462517fb7b47f310bd553762eef1..dcef99a36b5ac6f68bc6a9d65d696284ab009b23 100644 (file)
@@ -287,7 +287,7 @@ system_handle_psi_listener(int resource_id,
 
        /* If event occurs in debounce time, lower level event is ignored. */
        gettimeofday(&current, NULL);
-       current_msec = current.tv_sec * 1000 + current.tv_usec / 1000;
+       current_msec = (u_int64_t)current.tv_sec * 1000 + current.tv_usec / 1000;
        if (current_msec - sysdata->memory_pressure_last_update < PSI_EVENT_DEBOUNCE_TIME
            && memory_pressure_level <= sysdata->memory_pressure_level)
                return;