]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ntp: Fix integer overflow when setting time
authorSasha Levin <levinsasha928@gmail.com>
Thu, 15 Mar 2012 16:36:14 +0000 (12:36 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Apr 2012 16:52:35 +0000 (09:52 -0700)
commit1f2c44df43fef14718d2713f89b1ce1fada45577
treef304a0ec7a74f3307274a14498ced24fd9b22fd2
parentc2b033667cb7080061978656681a6ba2108e51bb
ntp: Fix integer overflow when setting time

commit a078c6d0e6288fad6d83fb6d5edd91ddb7b6ab33 upstream.

'long secs' is passed as divisor to div_s64, which accepts a 32bit
divisor. On 64bit machines that value is trimmed back from 8 bytes
back to 4, causing a divide by zero when the number is bigger than
(1 << 32) - 1 and all 32 lower bits are 0.

Use div64_long() instead.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Cc: johnstul@us.ibm.com
Link: http://lkml.kernel.org/r/1331829374-31543-2-git-send-email-levinsasha928@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/time/ntp.c