Skip to content

Commit

Permalink
mptcp: fix possible integer overflow in mptcp_reset_tout_timer
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dmikand authored and intel-lab-lkp committed Nov 7, 2024
1 parent 95505ae commit deec21e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2722,8 +2722,8 @@ void mptcp_reset_tout_timer(struct mptcp_sock *msk, unsigned long fail_tout)
if (!fail_tout && !inet_csk(sk)->icsk_mtup.probe_timestamp)
return;

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

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

0 comments on commit deec21e

Please sign in to comment.