Skip to content

Commit d818e97

Browse files
dmikandsmb49
authored andcommitted
mptcp: fix possible integer overflow in mptcp_reset_tout_timer
BugLink: https://bugs.launchpad.net/bugs/2101915 commit b169e76 upstream. In 'mptcp_reset_tout_timer', promote 'probe_timestamp' to unsigned long to avoid possible integer overflow. Compile tested only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Kandybka <d.kandybka@gmail.com> Link: https://patch.msgid.link/20241107103657.1560536-1-d.kandybka@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> [ Conflict in this version because commit d866ae9 ("mptcp: add a new sysctl for make after break timeout") is not in this version, and replaced TCP_TIMEWAIT_LEN in the expression. The fix can still be applied the same way: by forcing a cast to unsigned long for the first item. ] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> [koichiroden: applied patch from v6.12.5 cleanly] Signed-off-by: Koichiro Den <koichiro.den@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent d24cd2e commit d818e97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/mptcp/protocol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,8 +2719,8 @@ void mptcp_reset_tout_timer(struct mptcp_sock *msk, unsigned long fail_tout)
27192719
if (!fail_tout && !inet_csk(sk)->icsk_mtup.probe_timestamp)
27202720
return;
27212721

2722-
close_timeout = inet_csk(sk)->icsk_mtup.probe_timestamp - tcp_jiffies32 + jiffies +
2723-
mptcp_close_timeout(sk);
2722+
close_timeout = (unsigned long)inet_csk(sk)->icsk_mtup.probe_timestamp -
2723+
tcp_jiffies32 + jiffies + mptcp_close_timeout(sk);
27242724

27252725
/* the close timeout takes precedence on the fail one, and here at least one of
27262726
* them is active

0 commit comments

Comments
 (0)