Commit 2a8d5eca authored by Alex Henrie's avatar Alex Henrie Committed by sanglipeng
Browse files

net: ipv6/addrconf: avoid integer underflow in ipv6_create_tempaddr

stable inclusion
from stable-v5.10.195
commit 98e12d075c7ff263c1b6bc0c25ee6dcd16dbe2b0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I95JOC

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=98e12d075c7ff263c1b6bc0c25ee6dcd16dbe2b0



--------------------------------

[ Upstream commit f31867d0 ]

The existing code incorrectly casted a negative value (the result of a
subtraction) to an unsigned value without checking. For example, if
/proc/sys/net/ipv6/conf/*/temp_prefered_lft was set to 1, the preferred
lifetime would jump to 4 billion seconds. On my machine and network the
shortest lifetime that avoided underflow was 3 seconds.

Fixes: 76506a98 ("IPv6: fix DESYNC_FACTOR")
Signed-off-by: default avatarAlex Henrie <alexhenrie24@gmail.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent e1b2a964
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment