Re: [PATCH v4] ipv6: fix incorrect route 'expires' value passed to userspace
From: David Miller <davem@davemloft.net>
Date: 2012-07-30 06:20:04
From: David Miller <davem@davemloft.net>
Date: 2012-07-30 06:20:04
From: Li Wei <redacted> Date: Mon, 30 Jul 2012 10:01:30 +0800
When userspace use RTM_GETROUTE to dump route table, with an already expired route entry, we always got an 'expires' value(2147157) calculated base on INT_MAX. The reason of this problem is in the following satement: rt->dst.expires - jiffies < INT_MAX gcc promoted the type of both sides of '<' to unsigned long, thus a small negative value would be considered greater than INT_MAX. With the help of Eric Dumazet, do the out of bound checks in rtnl_put_cacheinfo(), _after_ conversion to clock_t. Signed-off-by: Li Wei <redacted>
Applied.