Re: [Qemu-devel] [PATCH 1/3] rtc: fix overflow in mktimegm

2012-10-05 Thread Anthony Liguori
Paolo Bonzini writes: > When setting a date in 1980, Linux is actually disregarding the century > byte and setting the year to 2080. This causes a year-2038 overflow > in mktimegm. Fix this by doing the days-to-seconds computation in > 64-bit math. > > Reported-by: Lucas Meneghel Rodrigues > S

[Qemu-devel] [PATCH 1/3] rtc: fix overflow in mktimegm

2012-10-01 Thread Paolo Bonzini
When setting a date in 1980, Linux is actually disregarding the century byte and setting the year to 2080. This causes a year-2038 overflow in mktimegm. Fix this by doing the days-to-seconds computation in 64-bit math. Reported-by: Lucas Meneghel Rodrigues Signed-off-by: Paolo Bonzini --- cut