net: ipv6/addrconf: avoid integer underflow in ipv6_create_tempaddr
stable inclusion from stable-v4.19.295 commit 897bd8f5823d28f7e8c9d6cece94b13185f9a213 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8EK5K CVE: NA -------------------------------- [ 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:Alex Henrie <alexhenrie24@gmail.com> Reviewed-by:
David Ahern <dsahern@kernel.org> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Yongqiang Liu <liuyongqiang13@huawei.com>
Loading
Please sign in to comment