Werk #6190: Win-agent: prevent unsigned integer overflow in process uptime

Component Checks & agents
Title Win-agent: prevent unsigned integer overflow in process uptime
Date Jun 12, 2018
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
1.6.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
1.5.0b7 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
1.4.0p34 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)

The process uptimes for Windows are calculated by subtracting the process creation time from the current system time. Under certain circumstances, setting up the system clock e. g. with daylight saving time has led to a situation where some processes have reported a creation time with false offset and an unsigned integer overflow through negative subtraction result. This has further led to the crash of the ps check.

The unsigned integer overflow is now prevented by checking the result of the subtraction and, in case of a negative value, logging it as an error and setting the process uptime to the default value 1.

To the list of all Werks