From: Thomas Gleixner Date: Wed, 6 Sep 2006 07:03:42 +0000 (-0700) Subject: [PATCH] prevent timespec/timeval to ktime_t overflow X-Git-Tag: v2.6.18-rc7~32 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96dd7421a06a5bc6eb731323b95efcb2fd864854;p=pandora-kernel.git [PATCH] prevent timespec/timeval to ktime_t overflow Frank v. Waveren pointed out that on 64bit machines the timespec to ktime_t conversion might overflow. This is also true for timeval to ktime_t conversions. This breaks a "sleep inf" on 64bit machines. While a timespec/timeval with tx.sec = MAX_LONG is valid by specification the internal representation of ktime_t is based on nanoseconds. The conversion of seconds to nanoseconds overflows for seconds values >= (MAX_LONG / NSEC_PER_SEC). Check the seconds argument to the conversion and limit it to the maximum time which can be represented by ktime_t. Signed-off-by: Thomas Gleixner Cc: Ingo Molnar Cc: Frank v Waveren Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed